Skip to content

Commit ea1339d

Browse files
committed
🎨 modernize Rakefile
Signed-off-by: Peter H. Boling <[email protected]>
1 parent 6d29520 commit ea1339d

File tree

1 file changed

+16
-29
lines changed

1 file changed

+16
-29
lines changed

Rakefile

Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,34 @@
1-
#!/usr/bin/env rake
2-
$LOAD_PATH << File.expand_path(__dir__)
3-
4-
require "aruba/platform"
5-
6-
require "bundler"
7-
Bundler.setup
1+
# frozen_string_literal: true
82

93
require 'bundler/gem_tasks'
10-
require "cucumber/rake/task"
11-
require "rspec/core/rake_task"
4+
require 'aruba/platform'
125
require 'rake/clean'
136

14-
# Work around a bug in `rake/clean` from `rake` versions older than 13. It's
15-
# failing when it calls `FileUtils::rm_r` because that method needs to receive
16-
# the `opts` parameter as parameters instead of as a `Hash`.
17-
module Rake
18-
module Cleaner
19-
module_function
20-
21-
def cleanup(file_name, **opts)
22-
begin
23-
opts = { verbose: Rake.application.options.trace }.merge(opts)
24-
rm_r file_name, **opts
25-
rescue StandardError => ex
26-
puts "Failed to remove #{file_name}: #{ex}" unless file_already_gone?(file_name)
27-
end
28-
end
29-
end
30-
end
31-
327
# Remove the `coverage` directory when the `:clobber` task is run.
338
CLOBBER.include('coverage')
349

10+
# Cucumber
11+
require 'cucumber/rake/task'
12+
3513
Cucumber::Rake::Task.new do |t|
3614
t.cucumber_opts = %w(--format progress)
3715
end
3816

39-
RSpec::Core::RakeTask.new('spec')
17+
# RSpec
18+
require 'rspec/core/rake_task'
19+
20+
RSpec::Core::RakeTask.new(:spec)
21+
22+
# RuboCop
23+
require 'rubocop/rake_task'
24+
25+
RuboCop::RakeTask.new
4026

4127
# Run the `clobber` task when running the entire test suite, because the
4228
# coverage information reported by `simplecov` can be skewed when a `coverage`
4329
# directory is already present.
4430
desc "Run the whole test suite."
4531
task test: [:clobber, :spec, :cucumber]
4632

47-
task default: :test
33+
# Default Task
34+
task default: :test

0 commit comments

Comments
 (0)