From 4a941c090e875d18ee0f8653a5910aa576c5e60f Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Thu, 12 May 2022 16:51:29 +0200 Subject: [PATCH] dynamically add rubocop to default tasks --- vagrant/Rakefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vagrant/Rakefile b/vagrant/Rakefile index 67009795f..61425af1c 100644 --- a/vagrant/Rakefile +++ b/vagrant/Rakefile @@ -8,11 +8,15 @@ Rake::TestTask.new do |t| t.verbose = true end +default_tasks = %i[test] + begin require 'rubocop/rake_task' RuboCop::RakeTask.new + # insert 0, because Ruby 2.0 doesn't know Array.prepend + default_tasks.insert(0, 'rubocop') rescue LoadError puts 'Rubocop not loaded' end -task :default => %i[rubocop test] +task :default => default_tasks