summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2017-06-23 19:39:49 -0500
committerSamuel Giddins <segiddins@segiddins.me>2017-06-23 23:29:09 -0500
commita415012239b05bef85e2cb1dc04606e9ced58360 (patch)
tree2c36ae0f18c64c5a8395abfe4d2f017579da7b24
parent0f336c7d311f2471e7191db05ddc0f9c278829a5 (diff)
downloadbundler-a415012239b05bef85e2cb1dc04606e9ced58360.tar.gz
Fix plugin installation when the plugin depends upon Bundler
-rw-r--r--lib/bundler/dsl.rb2
-rw-r--r--lib/bundler/source/metadata.rb6
-rw-r--r--spec/plugins/source/example_spec.rb2
3 files changed, 7 insertions, 3 deletions
diff --git a/lib/bundler/dsl.rb b/lib/bundler/dsl.rb
index 5435512810..b91e4034a7 100644
--- a/lib/bundler/dsl.rb
+++ b/lib/bundler/dsl.rb
@@ -134,7 +134,7 @@ module Bundler
if options.key?("type")
options["type"] = options["type"].to_s
unless Plugin.source?(options["type"])
- raise "No sources available for #{options["type"]}"
+ raise InvalidOption, "No plugin sources available for #{options["type"]}"
end
unless block_given?
diff --git a/lib/bundler/source/metadata.rb b/lib/bundler/source/metadata.rb
index 63d16365c5..e35a52e597 100644
--- a/lib/bundler/source/metadata.rb
+++ b/lib/bundler/source/metadata.rb
@@ -33,7 +33,7 @@ module Bundler
{}
end
- def install(spec, opts)
+ def install(spec, _opts = {})
Bundler.ui.info "Using #{version_message(spec)}"
nil
end
@@ -50,6 +50,10 @@ module Bundler
def hash
self.class.hash
end
+
+ def version_message(spec)
+ "#{spec.name} #{spec.version}"
+ end
end
end
end
diff --git a/spec/plugins/source/example_spec.rb b/spec/plugins/source/example_spec.rb
index 69e33e4077..28fdd6c03f 100644
--- a/spec/plugins/source/example_spec.rb
+++ b/spec/plugins/source/example_spec.rb
@@ -172,7 +172,7 @@ RSpec.describe "real source plugins" do
end
it "installs" do
- bundle "install"
+ bundle! "install"
expect(the_bundle).to include_gems("a-path-gem 1.0")
end