diff options
author | Tim Smith <tsmith@chef.io> | 2018-07-30 14:17:12 -0700 |
---|---|---|
committer | Tim Smith <tsmith@chef.io> | 2018-07-30 14:17:12 -0700 |
commit | ed8eb575d801acf4101e23fc58145f976b5545d8 (patch) | |
tree | af1ba69818a5b6b653104aa3da9b7fe6b2215a73 | |
parent | 8d1f48eae2d48cea4637e61f13b7783faa5c323d (diff) | |
download | mixlib-shellout-more_ruby.tar.gz |
Add console and yard tasks to the rakefilemore_ruby
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r-- | Rakefile | 38 |
1 files changed, 29 insertions, 9 deletions
@@ -1,16 +1,36 @@ -require "bundler" +require "bundler/gem_tasks" require "rspec/core/rake_task" +task default: [:style, :spec] + Bundler::GemHelper.install_tasks name: "mixlib-shellout" -require "chefstyle" -require "rubocop/rake_task" -desc "Run Ruby style checks" -RuboCop::RakeTask.new(:style) +desc "Run specs" +RSpec::Core::RakeTask.new(:spec) do |spec| + spec.pattern = "spec/**/*_spec.rb" +end -desc "Run all specs in spec directory" -RSpec::Core::RakeTask.new(:spec) do |t| - t.pattern = FileList["spec/**/*_spec.rb"] +begin + require "chefstyle" + require "rubocop/rake_task" + RuboCop::RakeTask.new(:style) do |task| + task.options += ["--display-cop-names", "--no-color"] + end +rescue LoadError + puts "chefstyle/rubocop is not available. bundle install first to make sure all dependencies are installed." end -task default: [:spec, :style] +begin + require "yard" + YARD::Rake::YardocTask.new(:docs) +rescue LoadError + puts "yard is not available. bundle install first to make sure all dependencies are installed." +end + +task :console do + require "irb" + require "irb/completion" + require "mixlib/shellout" + ARGV.clear + IRB.start +end |