From 6adb699aeb2323b961e9453047c35d9b80916f1e Mon Sep 17 00:00:00 2001 From: Andreas Zuber Date: Tue, 30 Oct 2018 14:29:29 +0100 Subject: [PATCH] Make rubocop and haml_lint tasks optional This gems are not usually installed in production and this will lead to an error when running rake. --- Rakefile | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Rakefile b/Rakefile index a0ef765eb..a0b6aa2fe 100644 --- a/Rakefile +++ b/Rakefile @@ -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]