Rakefile in ballast-2.2.3 vs Rakefile in ballast-2.2.4
- old
+ new
@@ -7,32 +7,38 @@
require "rspec/core/rake_task"
# Compatibility layer for Rake 11.0
Rake.application.class.send(:alias_method, :last_comment, :last_description) unless Rake.application.respond_to?(:last_comment)
-RSpec::Core::RakeTask.new("spec") do |t|
- t.ruby_opts = ENV.fetch("RUBY_OPTS", "").to_s
- t.rspec_opts = ENV.fetch("RSPEC_OPTS", "").to_s
+RSpec::Core::RakeTask.new("spec")
+
+RSpec::Core::RakeTask.new("spec:coverage") do
+ ENV["COVERAGE"] = "true"
end
-RSpec::Core::RakeTask.new("spec:coverage") do |t|
- t.ruby_opts = ENV.fetch("RUBY_OPTS", "").to_s + " -r./spec/coverage_helper"
- t.rspec_opts = ENV.fetch("RSPEC_OPTS", "").to_s
+RSpec::Core::RakeTask.new("spec:ci") do
+ ENV["COVERAGE"] = "true"
+ ENV["NO_COLOR"] = "true"
end
-desc "Generate the documentation"
+desc "Performs linting of the code using rubocop"
+task "lint" do
+ Kernel.exec("rubocop -ED lib")
+end
+
+desc "Generates the documentation"
task :docs do
system("yardoc") || raise("Failed Execution of: yardoc")
end
-
-desc "Get the current release version"
+
+desc "Gets the current release version"
task :version, :with_name do |_, args|
gem = Bundler::GemHelper.instance.gemspec
puts [args[:with_name] == "true" ? gem.name : nil, gem.version].compact.join("-")
end
-desc "Prepare the release"
-task prerelease: ["spec:coverage", "docs"] do
+desc "Prepares the release"
+task :prerelease => ["spec:coverage", "docs"] do
["git add -A", "git commit -am \"Version #{Bundler::GemHelper.instance.gemspec.version}\""].each do |cmd|
system(cmd) || raise("Failed Execution of: #{cmd}")
end
end