ruby-win32/lib/ruby/site_ruby/1.8/rubygems/validator.rb
def verify_gem(gem_data)
      raise VerificationError, 'empty gem file' if gem_data.size == 0

      unless gem_data =~ /MD5SUM/ then
        return # Don't worry about it...this sucks.  Need to fix MD5 stuff for
               # new format
               # FIXME
      end

      sum_data = gem_data.gsub(/MD5SUM = "([a-z0-9]+)"/,
                               "MD5SUM = \"#{"F" * 32}\"")

      unless Gem::MD5.hexdigest(sum_data) == $1.to_s then
        raise VerificationError, 'invalid checksum for gem file'
      end
    end
##
# Given a gem file's contents, validates against its own MD5 checksum
# gem_data:: [String] Contents of the gem file
Given a gem file's contents, validates against its own MD5 checksum
gem_data:: [String] Contents of the gem file
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)
      raise VerificationError, 'empty gem file' if gem_data.size == 0
      unless gem_data =~ /MD5SUM/ then
        return 
      end
      sum_data = gem_data.gsub(/MD5SUM = "([a-z0-9]+)"/,
                               "MD5SUM = \"#{"F" * 32}\"")
      unless Gem::MD5.hexdigest(sum_data) == $1.to_s then
        raise VerificationError, 'invalid checksum for gem file'
      end
    end
def verify_gem ( gem_data ) raise VerificationError , 'empty gem file' if gem_data . size == 0 unless gem_data =~ / MD5SUM / then return end sum_data = gem_data . gsub ( / MD5SUM = "([a-z0-9]+)" / , "MD5SUM = \"#{"F" * 32}\"" ) unless Gem :: MD5 . hexdigest ( sum_data ) == $1 . to_s then raise VerificationError , 'invalid checksum for gem file' end end
Given a gem file's contents, validates against its own MD5 checksum
gem_data:: [String] Contents of the gem file
Given a gem file ' s contents validates against its own MD5 checksum gem_data :: [ String ] Contents of the gem file
# Don't worry about it...this sucks.  Need to fix MD5 stuff for # new format # FIXME
gem_data