summaryrefslogtreecommitdiff
path: root/Rakefile
diff options
context:
space:
mode:
authorAustin Ziegler <austin@zieglers.ca>2022-07-05 15:43:30 -0400
committerGitHub <noreply@github.com>2022-07-05 15:43:30 -0400
commitcab33a91e2894558b962b4b2236a213c6d63c54e (patch)
treefc14bc4c8a44e20026e1252a8cd435907d412ee1 /Rakefile
parent3062997fbbe19cb6099a65a5dbcd0aba7b9b17c7 (diff)
parent0270cb87e09dd444ad6822a777bb7999fd6f6e85 (diff)
downloaddiff-lcs-main.tar.gz
Merge pull request #81 from halostatue/switch-to-standardrb-formattingHEADmain
Switch to standardrb formatting
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile60
1 files changed, 33 insertions, 27 deletions
diff --git a/Rakefile b/Rakefile
index fd7ee31..8179e81 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,9 +1,9 @@
# frozen_string_literal: true
-require 'rubygems'
-require 'rspec'
-require 'rspec/core/rake_task'
-require 'hoe'
+require "rubygems"
+require "rspec"
+require "rspec/core/rake_task"
+require "hoe"
# This is required until https://github.com/seattlerb/hoe/issues/112 is fixed
class Hoe
@@ -45,66 +45,71 @@ Hoe.plugin :doofus
Hoe.plugin :gemspec2
Hoe.plugin :git
-if RUBY_VERSION < '1.9'
- class Array #:nodoc:
+if RUBY_VERSION < "1.9"
+ class Array # :nodoc:
def to_h
Hash[*flatten(1)]
end
end
- class Gem::Specification #:nodoc:
- def metadata=(*); end
+ class Gem::Specification # :nodoc:
+ def metadata=(*)
+ end
- def default_value(*); end
+ def default_value(*)
+ end
end
- class Object #:nodoc:
+ class Object # :nodoc:
def caller_locations(*)
[]
end
end
end
-_spec = Hoe.spec 'diff-lcs' do
- developer('Austin Ziegler', 'halostatue@gmail.com')
+_spec = Hoe.spec "diff-lcs" do
+ developer("Austin Ziegler", "halostatue@gmail.com")
- require_ruby_version '>= 1.8'
+ require_ruby_version ">= 1.8"
- self.history_file = 'History.md'
- self.readme_file = 'README.rdoc'
- self.licenses = ['MIT', 'Artistic-2.0', 'GPL-2.0+']
+ self.history_file = "History.md"
+ self.readme_file = "README.rdoc"
+ self.licenses = ["MIT", "Artistic-2.0", "GPL-2.0+"]
- extra_dev_deps << ['hoe-doofus', '~> 1.0']
- extra_dev_deps << ['hoe-gemspec2', '~> 1.1']
- extra_dev_deps << ['hoe-git', '~> 1.6']
- extra_dev_deps << ['hoe-rubygems', '~> 1.0']
- extra_dev_deps << ['rspec', '>= 2.0', '< 4']
- extra_dev_deps << ['rake', '>= 10.0', '< 14']
- extra_dev_deps << ['rdoc', '>= 6.3.1', '< 7']
+ extra_dev_deps << ["hoe-doofus", "~> 1.0"]
+ extra_dev_deps << ["hoe-gemspec2", "~> 1.1"]
+ extra_dev_deps << ["hoe-git", "~> 1.6"]
+ extra_dev_deps << ["hoe-rubygems", "~> 1.0"]
+ extra_dev_deps << ["rspec", ">= 2.0", "< 4"]
+ extra_dev_deps << ["rake", ">= 10.0", "< 14"]
+ extra_dev_deps << ["rdoc", ">= 6.3.1", "< 7"]
end
desc "Run all specifications"
RSpec::Core::RakeTask.new(:spec) do |t|
- rspec_dirs = %w(spec lib).join(":")
+ rspec_dirs = %w[spec lib].join(":")
t.rspec_opts = ["-I#{rspec_dirs}"]
end
Rake::Task["spec"].actions.uniq! { |a| a.source_location }
+# standard:disable Style/HashSyntax
task :default => :spec unless Rake::Task["default"].prereqs.include?("spec")
task :test => :spec unless Rake::Task["test"].prereqs.include?("spec")
+# standard:enable Style/HashSyntax
-if RUBY_VERSION >= '2.0' && RUBY_ENGINE == 'ruby'
+if RUBY_VERSION >= "2.0" && RUBY_ENGINE == "ruby"
namespace :spec do
desc "Runs test coverage. Only works Ruby 2.0+ and assumes 'simplecov' is installed."
task :coverage do
- ENV['COVERAGE'] = 'yes'
- Rake::Task['spec'].execute
+ ENV["COVERAGE"] = "yes"
+ Rake::Task["spec"].execute
end
end
end
task :ruby18 do
+ # standard:disable Layout/HeredocIndentation
puts <<-MESSAGE
You are starting a barebones Ruby 1.8 docker environment. You will need to
do the following:
@@ -117,5 +122,6 @@ do the following:
Don't forget to restore your Gemfile.lock after testing.
MESSAGE
+ # standard:enable Layout/HeredocIndentation
sh "docker run -it --rm -v #{Dir.pwd}:/root/diff-lcs bellbind/docker-ruby18-rails2 bash -l"
end