summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-09-09 08:46:40 -0700
committerGitHub <noreply@github.com>2018-09-09 08:46:40 -0700
commitb04cd3de89f347f3533f72616238ed8be54a389a (patch)
treed5070b306f3b4edf410d6ecef43f337338354316
parent548e8668921324d21a1eb1c4ee1bf3241ae5ddac (diff)
parent901d003e42839145fe099172a6c56d2432c824ad (diff)
downloadohai-b04cd3de89f347f3533f72616238ed8be54a389a.tar.gz
Merge pull request #1242 from chef/rakefile
Use a more standardized Rakefile
-rw-r--r--.travis.yml3
-rw-r--r--Rakefile34
2 files changed, 27 insertions, 10 deletions
diff --git a/.travis.yml b/.travis.yml
index c8b4ecca..171aa74b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -26,6 +26,5 @@ matrix:
script:
- bundle exec chefstyle -v
- - bundle exec chefstyle
- - bundle exec rake spec
+ - bundle exec rake
- bundle exec ohai
diff --git a/Rakefile b/Rakefile
index eda2219f..83e36d8f 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,6 +1,4 @@
require "bundler/gem_tasks"
-require "date"
-require "ohai/version"
begin
require "rspec/core/rake_task"
@@ -11,14 +9,34 @@ begin
rescue LoadError
desc "rspec is not installed, this task is disabled"
task :spec do
- abort "rspec is not installed. `(sudo) gem install rspec` to run unit tests"
+ abort "rspec is not installed. bundle install first to make sure all dependencies are installed."
end
end
-task default: :spec
+begin
+ require "chefstyle"
+ require "rubocop/rake_task"
+ desc "Run Chefstyle tests"
+ RuboCop::RakeTask.new(:style) do |task|
+ task.options += ["--display-cop-names", "--no-color"]
+ end
+rescue LoadError
+ puts "chefstyle gem is not installed. bundle install first to make sure all dependencies are installed."
+end
-require "chefstyle"
-require "rubocop/rake_task"
-RuboCop::RakeTask.new(:style) do |task|
- task.options += ["--display-cop-names", "--no-color"]
+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 "ohai"
+ ARGV.clear
+ IRB.start
end
+
+task default: [:style, :spec]