summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2019-06-03 17:14:58 -0700
committerTim Smith <tsmith@chef.io>2019-06-06 18:12:44 -0700
commit390b371ddef39052d4bc1d2604a8c757460de298 (patch)
tree394387a9de1ea3173bfb370affdf84eec979a1de
parent30c1eb1ef1c2a68c0a0883afbee66b4e811edabe (diff)
downloadmixlib-shellout-390b371ddef39052d4bc1d2604a8c757460de298.tar.gz
Add our standard Rakefile / Gemfile
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--.expeditor/config.yml2
-rw-r--r--Gemfile16
-rw-r--r--Rakefile23
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]