summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-10-29 10:52:26 -0700
committerTim Smith <tsmith@chef.io>2018-10-29 10:52:26 -0700
commit26bc400af6b491c78c4d775b10314074f0925513 (patch)
tree19506ede5cebee27df6d734cc5e4858142c05e26
parent6d3558796fe67c4d83cb8664a3acbaa261a15b8a (diff)
downloadohai-26bc400af6b491c78c4d775b10314074f0925513.tar.gz
Use the new rakefile / gemfile
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--Gemfile13
-rw-r--r--Rakefile39
2 files changed, 36 insertions, 16 deletions
diff --git a/Gemfile b/Gemfile
index 5f0ce7a0..2116d8c0 100644
--- a/Gemfile
+++ b/Gemfile
@@ -17,6 +17,19 @@ group :ci do
gem "rspec_junit_formatter"
end
+group :docs do
+ gem "yard"
+ gem "redcarpet"
+ gem "github-markup"
+end
+
+group :debug do
+ gem "pry"
+ gem "pry-byebug"
+ gem "pry-stack_explorer"
+ gem "rb-readline"
+end
+
instance_eval(ENV["GEMFILE_MOD"]) if ENV["GEMFILE_MOD"]
# If you want to load debugging tools into the bundle exec sandbox,
diff --git a/Rakefile b/Rakefile
index 58c0d419..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,25 +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
-
-require "chefstyle"
-require "rubocop/rake_task"
-RuboCop::RakeTask.new(:style) do |task|
- task.options += ["--display-cop-names", "--no-color"]
+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
begin
- require "github_changelog_generator/task"
-
- GitHubChangelogGenerator::RakeTask.new :changelog do |config|
- config.future_release = Ohai::VERSION
- config.max_issues = 0
- config.add_issues_wo_labels = false
- end
+ 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]