summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-07-30 14:17:12 -0700
committerTim Smith <tsmith@chef.io>2018-07-30 14:17:12 -0700
commited8eb575d801acf4101e23fc58145f976b5545d8 (patch)
treeaf1ba69818a5b6b653104aa3da9b7fe6b2215a73
parent8d1f48eae2d48cea4637e61f13b7783faa5c323d (diff)
downloadmixlib-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--Rakefile38
1 files changed, 29 insertions, 9 deletions
diff --git a/Rakefile b/Rakefile
index 06a7620..28f9e96 100644
--- a/Rakefile
+++ b/Rakefile
@@ -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