From 390b371ddef39052d4bc1d2604a8c757460de298 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Mon, 3 Jun 2019 17:14:58 -0700 Subject: Add our standard Rakefile / Gemfile Signed-off-by: Tim Smith --- .expeditor/config.yml | 2 -- Gemfile | 16 ++++++++++++++-- Rakefile | 23 +++++++++++++++-------- 3 files changed, 29 insertions(+), 12 deletions(-) diff --git a/.expeditor/config.yml b/.expeditor/config.yml index 75e5e3c..7032e6c 100644 --- a/.expeditor/config.yml +++ b/.expeditor/config.yml @@ -12,8 +12,6 @@ rubygems: github: # This deletes the GitHub PR branch after successfully merged into the release branch delete_branch_on_merge: true - # The tag format to use (e.g. v1.0.0) - version_tag_format: "v{{version}}" # allow bumping the minor release via label minor_bump_labels: - "Expeditor: Bump Version Minor" diff --git a/Gemfile b/Gemfile index 5aaba73..1e5f5f3 100644 --- a/Gemfile +++ b/Gemfile @@ -2,16 +2,28 @@ source "https://rubygems.org" gemspec name: "mixlib-shellout" -group(:test) do +group :docs do + gem "yard" + gem "redcarpet" + gem "github-markup" +end + +group :test do gem "chefstyle", git: "https://github.com/chef/chefstyle.git", branch: "master" gem "rspec_junit_formatter" gem "rspec", "~> 3.0" gem "rake" end -group(:development) do +group :development 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, +# add these additional dependencies into Gemfile.local +eval_gemfile(__FILE__ + ".local") if File.exist?(__FILE__ + ".local") diff --git a/Rakefile b/Rakefile index 40ab182..82d0d13 100644 --- a/Rakefile +++ b/Rakefile @@ -1,23 +1,28 @@ -require "bundler" -require "rspec/core/rake_task" +require "bundler/gem_tasks" Bundler::GemHelper.install_tasks name: "mixlib-shellout" -task default: [:spec, :style] - -desc "Run specs" -RSpec::Core::RakeTask.new(:spec) do |spec| - spec.pattern = "spec/**/*_spec.rb" +begin + require "rspec/core/rake_task" + RSpec::Core::RakeTask.new do |t| + t.pattern = "spec/**/*_spec.rb" + end +rescue LoadError + desc "rspec is not installed, this task is disabled" + task :spec do + abort "rspec is not installed. bundle install first to make sure all dependencies are installed." + end end 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/rubocop is not available. bundle install first to make sure all dependencies are installed." + puts "chefstyle gem is not installed. bundle install first to make sure all dependencies are installed." end begin @@ -34,3 +39,5 @@ task :console do ARGV.clear IRB.start end + +task default: [:spec, :style] -- cgit v1.2.1