Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Commit

Permalink
Make rubocop and haml_lint tasks optional
Browse files Browse the repository at this point in the history
This gems are not usually installed in production and
this will lead to an error when running rake.
  • Loading branch information
ZeroPointEnergy committed Oct 30, 2018
1 parent c00a52c commit 6adb699
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,16 @@ rescue LoadError
STDERR.puts "Warning: Rails rake tasks currently unavailable because we can't find the 'rails' gem"
end

require 'rubocop/rake_task'
RuboCop::RakeTask.new
begin
require 'rubocop/rake_task'
RuboCop::RakeTask.new
rescue LoadError
end

require 'haml_lint/rake_task'
HamlLint::RakeTask.new
begin
require 'haml_lint/rake_task'
HamlLint::RakeTask.new
rescue LoadError
end

task :default => [:spec, :rubocop, :haml_lint]

0 comments on commit 6adb699

Please sign in to comment.