summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-08-12 22:54:28 +0200
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-09-15 15:29:32 +0200
commitb492f83b95fb87f2b4e87c54b6e84f909e7e99a0 (patch)
tree9e1fe06ccf23b96391c98973b16e2f86a8bdf333
parent0dfa6a4234faa9de0337262037a4c7139380f4ee (diff)
downloadbundler-b492f83b95fb87f2b4e87c54b6e84f909e7e99a0.tar.gz
Refactor activation errors
-rwxr-xr-xbin/parallel_rspec6
-rwxr-xr-xbin/rake6
-rwxr-xr-xbin/ronn6
-rwxr-xr-xbin/rspec6
-rwxr-xr-xbin/rubocop6
-rw-r--r--spec/support/rubygems_ext.rb2
6 files changed, 7 insertions, 25 deletions
diff --git a/bin/parallel_rspec b/bin/parallel_rspec
index 26402aee7c..9783533198 100755
--- a/bin/parallel_rspec
+++ b/bin/parallel_rspec
@@ -5,8 +5,4 @@ load File.expand_path("../with_rubygems", __FILE__) if ENV["RGV"]
require_relative "../spec/support/rubygems_ext"
-begin
- Spec::Rubygems.gem_load("parallel_tests", "parallel_rspec")
-rescue Gem::LoadError => e
- warn "We couln't activate parallel_tests (#{e.requirement}). Run `gem install parallel_tests:'#{e.requirement}'`"
-end
+Spec::Rubygems.gem_load("parallel_tests", "parallel_rspec")
diff --git a/bin/rake b/bin/rake
index f9a28e88c2..2fb69d19f3 100755
--- a/bin/rake
+++ b/bin/rake
@@ -5,8 +5,4 @@ load File.expand_path("../with_rubygems", __FILE__) if ENV["RGV"]
require_relative "../spec/support/rubygems_ext"
-begin
- Spec::Rubygems.gem_load("rake", "rake")
-rescue Gem::LoadError => e
- warn "We couln't activate rake (#{e.requirement}). Run `gem install rake:'#{e.requirement}'`"
-end
+Spec::Rubygems.gem_load("rake", "rake")
diff --git a/bin/ronn b/bin/ronn
index 4501d03af3..e47fb518a4 100755
--- a/bin/ronn
+++ b/bin/ronn
@@ -5,8 +5,4 @@ load File.expand_path("../with_rubygems", __FILE__) if ENV["RGV"]
require_relative "../spec/support/rubygems_ext"
-begin
- Spec::Rubygems.gem_load("ronn", "ronn")
-rescue Gem::LoadError => e
- warn "We couln't activate ronn (#{e.requirement}). Run `gem install ronn:'#{e.requirement}'`"
-end
+Spec::Rubygems.gem_load("ronn", "ronn")
diff --git a/bin/rspec b/bin/rspec
index 7d6c53cda4..4c139156f9 100755
--- a/bin/rspec
+++ b/bin/rspec
@@ -5,8 +5,4 @@ load File.expand_path("../with_rubygems", __FILE__) if ENV["RGV"]
require_relative "../spec/support/rubygems_ext"
-begin
- Spec::Rubygems.gem_load("rspec-core", "rspec")
-rescue Gem::LoadError => e
- warn "We couln't activate rspec (#{e.requirement}). Run `gem install rspec:'#{e.requirement}'`"
-end
+Spec::Rubygems.gem_load("rspec-core", "rspec")
diff --git a/bin/rubocop b/bin/rubocop
index f700d073ca..818aaf7a9d 100755
--- a/bin/rubocop
+++ b/bin/rubocop
@@ -5,8 +5,4 @@ load File.expand_path("../with_rubygems", __FILE__) if ENV["RGV"]
require_relative "../spec/support/rubygems_ext"
-begin
- Spec::Rubygems.gem_load("rubocop", "rubocop")
-rescue Gem::LoadError => e
- warn "We couln't activate rubocop (#{e.requirement}). Run `gem install rubocop:'#{e.requirement}'`"
-end
+Spec::Rubygems.gem_load("rubocop", "rubocop")
diff --git a/spec/support/rubygems_ext.rb b/spec/support/rubygems_ext.rb
index aa1ab768b2..6472b46652 100644
--- a/spec/support/rubygems_ext.rb
+++ b/spec/support/rubygems_ext.rb
@@ -43,6 +43,8 @@ module Spec
def gem_load(gem_name, bin_container)
gem_activate(gem_name)
load Gem.bin_path(gem_name, bin_container)
+ rescue Gem::LoadError => e
+ warn "We couln't activate #{gem_name} (#{e.requirement}). Run `gem install #{gem_name}:'#{e.requirement}'`"
end
def gem_require(gem_name)