summaryrefslogtreecommitdiff
path: root/lib/rubygems/validator.rb
diff options
context:
space:
mode:
-rw-r--r--lib/rubygems/validator.rb27
1 files changed, 3 insertions, 24 deletions
@@ -19,29 +19,6 @@ class Gem::Validator
require 'find'
end
- ##
- # Given a gem file's contents, validates against its own MD5 checksum
- # gem_data:: [String] Contents of the gem file
-
- def verify_gem(gem_data)
- # TODO remove me? The code here only validate an MD5SUM that was
- # in some old formatted gems, but hasn't been for a long time.
- end
-
- ##
- # Given the path to a gem file, validates against its own MD5 checksum
- #
- # gem_path:: [String] Path to gem file
-
- def verify_gem_file(gem_path)
- File.open gem_path, Gem.binary_mode do |file|
- gem_data = file.read
- verify_gem gem_data
- end
- rescue Errno::ENOENT, Errno::EINVAL
- raise Gem::VerificationError, "missing gem file #{gem_path}"
- end
-
private
def find_files_for_gem(gem_directory)
@@ -105,7 +82,9 @@ class Gem::Validator
end
begin
- verify_gem_file(gem_path)
good, gone, unreadable = nil, nil, nil, nil