summaryrefslogtreecommitdiff
path: root/Rakefile
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-07-24 11:08:43 -0700
committerTim Smith <tsmith@chef.io>2018-07-24 11:08:43 -0700
commitb070806ffef16a1dcba70c693848669503544e8a (patch)
tree934815c34c4945584872675d6969bf476d9f1896 /Rakefile
parent85ae3a7ad23a7d452cafbd36afbc581906cd8f83 (diff)
downloadmixlib-cli-b070806ffef16a1dcba70c693848669503544e8a.tar.gz
Add yard to rakefile and sync with others
Make the default task run style/specs Remove require on rubygems Remove rdoc task Suggest bundle install for chefstyle Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile25
1 files changed, 11 insertions, 14 deletions
diff --git a/Rakefile b/Rakefile
index 549ba72..8978010 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,26 +1,16 @@
-require "bundler"
-require "rubygems"
-require "rubygems/package_task"
-require "rdoc/task"
+require "bundler/gem_tasks"
require "rspec/core/rake_task"
require "mixlib/cli/version"
-Bundler::GemHelper.install_tasks
+task default: [:style, :unit]
-task default: :spec
+Bundler::GemHelper.install_tasks
desc "Run specs"
RSpec::Core::RakeTask.new(:spec) do |spec|
spec.pattern = "spec/**/*_spec.rb"
end
-RDoc::Task.new do |rdoc|
- rdoc.rdoc_dir = "rdoc"
- rdoc.title = "mixlib-cli #{Mixlib::CLI::VERSION}"
- rdoc.rdoc_files.include("README*")
- rdoc.rdoc_files.include("lib/**/*.rb")
-end
-
begin
require "chefstyle"
require "rubocop/rake_task"
@@ -28,5 +18,12 @@ begin
task.options += ["--display-cop-names", "--no-color"]
end
rescue LoadError
- puts "chefstyle/rubocop is not available. gem install chefstyle to do style checking."
+ puts "chefstyle/rubocop is not available. bundle install first to make sure all dependencies are installed."
+end
+
+begin
+ require "yard"
+ YARD::Rake::YardocTask.new(:doc)
+rescue LoadError
+ puts "yard is not available. bundle install first to make sure all dependencies are installed."
end