From 664d105f910eb964e76b0dc10abaffaa739e0973 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Sat, 9 Feb 2019 09:39:34 +0100 Subject: Clean up first `bin/rake spec:deps` output Currently the first time you run `bin/rake spec:deps` on a fresh installation, you get the following output: ``` Could not find 'automatiek' (~> 0.1.0) among 17 total gem(s) Checked in 'GEM_PATH=/usr/local/rvm/gems/ruby-2.3.7:/usr/local/rvm/gems/ruby-2.3.7@global', execute `gem env` for more information (Gem::MissingSpecError) Could not find 'mustache' (= 0.99.6) among 17 total gem(s) Checked in 'GEM_PATH=/usr/local/rvm/gems/ruby-2.3.7:/usr/local/rvm/gems/ruby-2.3.7@global', execute `gem env` for more information (Gem::MissingSpecError) Could not find 'rake' (~> 12.0) - did find: [rake-10.4.2] Checked in 'GEM_PATH=/usr/local/rvm/gems/ruby-2.3.7:/usr/local/rvm/gems/ruby-2.3.7@global', execute `gem env` for more information (Gem::MissingSpecVersionError) Could not find 'rdiscount' (~> 2.2) among 17 total gem(s) Checked in 'GEM_PATH=/usr/local/rvm/gems/ruby-2.3.7:/usr/local/rvm/gems/ruby-2.3.7@global', execute `gem env` for more information (Gem::MissingSpecError) Could not find 'ronn' (~> 0.7.3) among 17 total gem(s) Checked in 'GEM_PATH=/usr/local/rvm/gems/ruby-2.3.7:/usr/local/rvm/gems/ruby-2.3.7@global', execute `gem env` for more information (Gem::MissingSpecError) Could not find 'rspec' (~> 3.6) among 17 total gem(s) Checked in 'GEM_PATH=/usr/local/rvm/gems/ruby-2.3.7:/usr/local/rvm/gems/ruby-2.3.7@global', execute `gem env` for more information (Gem::MissingSpecError) Could not find 'rubocop' (= 0.50.0) among 17 total gem(s) Checked in 'GEM_PATH=/usr/local/rvm/gems/ruby-2.3.7:/usr/local/rvm/gems/ruby-2.3.7@global', execute `gem env` for more information (Gem::MissingSpecError) ``` Nothing has gone wrong but the user might think the opposite. So, avoid printing these errors. --- bin/rake | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'bin/rake') diff --git a/bin/rake b/bin/rake index ebb192fd50..7cce4cfa1e 100755 --- a/bin/rake +++ b/bin/rake @@ -5,15 +5,17 @@ load File.expand_path("../with_rubygems", __FILE__) if ENV["RGV"] require "rubygems" -bundler_spec = Gem::Specification.load(File.expand_path("../../bundler.gemspec", __FILE__)) -bundler_spec.dependencies.each do |dep| - begin - gem dep.name, dep.requirement - rescue Gem::LoadError => e - $stderr.puts "#{e.message} (#{e.class})" +unless ARGV[0] == "spec:deps" + bundler_spec = Gem::Specification.load(File.expand_path("../../bundler.gemspec", __FILE__)) + bundler_spec.dependencies.each do |dep| + begin + gem dep.name, dep.requirement + rescue Gem::LoadError => e + $stderr.puts "#{e.message} (#{e.class})" + end end -end -Gem.finish_resolve if Gem.respond_to?(:finish_resolve) + Gem.finish_resolve if Gem.respond_to?(:finish_resolve) +end load Gem.bin_path("rake", "rake") -- cgit v1.2.1