Skip to content

Commit c3532cb

Browse files
committed
Add rubocop task; make default run spec & rubocop
1 parent 6bc5693 commit c3532cb

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

Rakefile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,19 @@ begin
77
require 'rspec/core/rake_task'
88
RSpec::Core::RakeTask.new(:spec)
99
rescue LoadError => e
10-
warn "Error loading task: #{e.message}"
10+
warn "Error loading rspec task: #{e.message}"
1111
exit 1
1212
end
1313

14-
task default: [:spec]
14+
begin
15+
require 'rubocop/rake_task'
16+
RuboCop::RakeTask.new(:rubocop)
17+
rescue LoadError => e
18+
warn "Error loading rubocop task: #{e.message}"
19+
exit 1
20+
end
21+
22+
task default: [:spec, :rubocop]
1523

1624
def shell(*args)
1725
puts "running: #{args.join(' ')}"
@@ -34,7 +42,7 @@ task permissions: [:clean] do
3442
shell("find . -type d -exec chmod 755 {} \\;")
3543
shell("find bin -type f -exec chmod 755 {} \\; 2>/dev/null")
3644
shell("find exe -type f -exec chmod 755 {} \\; 2>/dev/null")
37-
shell("pwd -P && mkdir pkg && chmod -R g+r,o+r pkg")
45+
shell("pwd -P && mkdir pkg && chmod -R g+r,g+x,o+r,o+x pkg")
3846
end
3947

4048
desc 'Builds the gem into the pkg/ folder'

0 commit comments

Comments
 (0)