From 8b1e421e02948f60d10e850c55c585e3cd3ce91a Mon Sep 17 00:00:00 2001 From: Piotr Murach Date: Sat, 5 Jun 2021 14:45:29 +0200 Subject: [PATCH] Change rake tasks to improve formatting --- Rakefile | 12 ++++++------ tasks/console.rake | 4 ++-- tasks/spec.rake | 3 +-- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/Rakefile b/Rakefile index e170aa3..617f4ac 100644 --- a/Rakefile +++ b/Rakefile @@ -1,12 +1,12 @@ -# encoding: utf-8 +# frozen_string_literal: true require "bundler/gem_tasks" -FileList['tasks/**/*.rake'].each(&method(:import)) +FileList["tasks/**/*.rake"].each(&method(:import)) -mri = RUBY_ENGINE == 'ruby' -specs = ['spec'] -specs.unshift('spec:perf') if mri +mri = RUBY_ENGINE == "ruby" +specs = ["spec"] +specs.unshift("spec:perf") if mri -desc 'Run all specs' +desc "Run all specs" task ci: specs diff --git a/tasks/console.rake b/tasks/console.rake index 271bb15..d5b650c 100644 --- a/tasks/console.rake +++ b/tasks/console.rake @@ -4,8 +4,8 @@ desc "Load gem inside irb console" task :console do require "irb" require "irb/completion" - require File.join(__FILE__, "../../lib/finite_machine") + require_relative "../lib/finite_machine" ARGV.clear IRB.start end -task :c => :console +task c: :console diff --git a/tasks/spec.rake b/tasks/spec.rake index 5092544..3c7461e 100644 --- a/tasks/spec.rake +++ b/tasks/spec.rake @@ -24,11 +24,10 @@ begin task.pattern = "spec/performance{,/*/**}/*_spec.rb" end end - rescue LoadError %w[spec spec:unit spec:integration].each do |name| task name do - $stderr.puts "In order to run #{name}, do `gem install rspec`" + warn "In order to run #{name}, do `gem install rspec`" end end end