summaryrefslogtreecommitdiff
path: root/lib/bundler/endpoint_specification.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bundler/endpoint_specification.rb')
-rw-r--r--lib/bundler/endpoint_specification.rb19
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/bundler/endpoint_specification.rb b/lib/bundler/endpoint_specification.rb
index 863544b1f9..201818cc33 100644
--- a/lib/bundler/endpoint_specification.rb
+++ b/lib/bundler/endpoint_specification.rb
@@ -92,9 +92,20 @@ module Bundler
end
end
+ # needed for `bundle fund`
+ def metadata
+ if @remote_specification
+ @remote_specification.metadata
+ elsif _local_specification
+ _local_specification.metadata
+ else
+ super
+ end
+ end
+
def _local_specification
return unless @loaded_from && File.exist?(local_specification_path)
- eval(File.read(local_specification_path)).tap do |spec|
+ eval(File.read(local_specification_path), nil, local_specification_path).tap do |spec|
spec.loaded_from = @loaded_from
end
end
@@ -125,7 +136,11 @@ module Bundler
next unless v
case k.to_s
when "checksum"
- @checksum = v.last
+ begin
+ @checksum = Checksum.from_api(v.last, @spec_fetcher.uri)
+ rescue ArgumentError => e
+ raise ArgumentError, "Invalid checksum for #{full_name}: #{e.message}"
+ end
when "rubygems"
@required_rubygems_version = Gem::Requirement.new(v)
when "ruby"