summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/dsl.rb3
-rw-r--r--lib/bundler/remote_specification.rb5
-rw-r--r--lib/bundler/rubygems_gem_installer.rb14
-rw-r--r--lib/bundler/source.rb2
4 files changed, 19 insertions, 5 deletions
diff --git a/lib/bundler/dsl.rb b/lib/bundler/dsl.rb
index b064c80d4c..428ccd4c2d 100644
--- a/lib/bundler/dsl.rb
+++ b/lib/bundler/dsl.rb
@@ -393,7 +393,8 @@ module Bundler
"as an option for #{command}, but it is invalid."
end
- message << " Valid options are: #{valid_keys.join(", ")}"
+ message << " Valid options are: #{valid_keys.join(", ")}."
+ message << " You may be able to resolve this by upgrading Bundler to the newest version."
raise InvalidOption, message
end
end
diff --git a/lib/bundler/remote_specification.rb b/lib/bundler/remote_specification.rb
index f45bf4a5ed..112c7f97fe 100644
--- a/lib/bundler/remote_specification.rb
+++ b/lib/bundler/remote_specification.rb
@@ -82,8 +82,9 @@ module Bundler
_remote_specification.send(method, *args, &blk)
end
- def respond_to_missing?(method, include_all)
- _remote_specification.respond_to?(method, include_all)
+ def respond_to?(method, include_all = false)
+ super || _remote_specification.respond_to?(method, include_all)
end
+ public :respond_to?
end
end
diff --git a/lib/bundler/rubygems_gem_installer.rb b/lib/bundler/rubygems_gem_installer.rb
index 0aa9fd91d6..28ad988b94 100644
--- a/lib/bundler/rubygems_gem_installer.rb
+++ b/lib/bundler/rubygems_gem_installer.rb
@@ -28,7 +28,7 @@ module Bundler
digest = Digest::SHA256.new
digest << io.read(16_384) until io.eof?
io.rewind
- digest.send(checksum_type(checksum))
+ send(checksum_type(checksum), digest)
end
unless digest == checksum
raise SecurityError,
@@ -48,5 +48,17 @@ module Bundler
else raise InstallError, "The given checksum for #{spec.full_name} (#{checksum.inspect}) is not a valid SHA256 hexdigest nor base64digest"
end
end
+
+ def hexdigest!(digest)
+ digest.hexdigest!
+ end
+
+ def base64digest!(digest)
+ if digest.respond_to?(:base64digest!)
+ digest.base64digest!
+ else
+ [digest.digest!].pack("m0")
+ end
+ end
end
end
diff --git a/lib/bundler/source.rb b/lib/bundler/source.rb
index b6f3a4311d..166c1d241c 100644
--- a/lib/bundler/source.rb
+++ b/lib/bundler/source.rb
@@ -14,7 +14,7 @@ module Bundler
def version_message(spec)
message = "#{spec.name} #{spec.version}"
- message += " (#{spec.platform})" if spec.platform != Gem::Platform::RUBY
+ message += " (#{spec.platform})" if spec.platform != Gem::Platform::RUBY && !spec.platform.nil?
if Bundler.locked_gems
locked_spec = Bundler.locked_gems.specs.find {|s| s.name == spec.name }