diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-02-24 06:11:01 +0100 |
---|---|---|
committer | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-03-20 14:22:34 +0100 |
commit | ef70be132706c56fda4f346c77d5a96e176d6b9b (patch) | |
tree | 1246e62686dadc5306ad1f95bab4e14e7cf00523 /bin | |
parent | 4cf283fe747d78cf127fae76621bfe8469d7482c (diff) | |
download | bundler-ef70be132706c56fda4f346c77d5a96e176d6b9b.tar.gz |
Make `bin/rspec` activate only `rspec`
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/rspec | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -6,10 +6,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| - gem dep.name, dep.requirement +rspec = bundler_spec.development_dependencies.find do |dep| + dep.name == "rspec" end -Gem.finish_resolve if Gem.respond_to?(:finish_resolve) +rspec_requirement = rspec.requirement.to_s -load Gem.bin_path("rspec-core", "rspec") +begin + gem "rspec", rspec_requirement + Gem.finish_resolve if Gem.respond_to?(:finish_resolve) + + load Gem.bin_path("rspec-core", "rspec") +rescue Gem::LoadError + warn "We couln't activate rspec (#{rspec_requirement}). Try `gem install rspec:'#{rspec_requirement}'`" +end |