ruby-changes:11183
From: nobu <ko1@a...>
Date: Fri, 6 Mar 2009 13:25:34 +0900 (JST)
Subject: [ruby-changes:11183] Ruby:r22789 (trunk): * lib/rubygems/digest/digest_adapter.rb: removed.
nobu 2009-03-06 13:25:25 +0900 (Fri, 06 Mar 2009) New Revision: 22789 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=22789 Log: * lib/rubygems/digest/digest_adapter.rb: removed. Removed files: trunk/lib/rubygems/digest/digest_adapter.rb Modified files: trunk/lib/rubygems/digest/md5.rb trunk/lib/rubygems/digest/sha1.rb trunk/lib/rubygems/digest/sha2.rb Index: lib/rubygems/digest/digest_adapter.rb =================================================================== --- lib/rubygems/digest/digest_adapter.rb (revision 22788) +++ lib/rubygems/digest/digest_adapter.rb (revision 22789) @@ -1,39 +0,0 @@ -#-- -# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others. -# All rights reserved. -# See LICENSE.txt for permissions. -#++ - -module Gem - - # There is an incompatibility between the way Ruby 1.8.5 and 1.8.6 - # handles digests. This DigestAdapter will take a pre-1.8.6 digest - # and adapt it to the 1.8.6 API. - # - # Note that only the digest and hexdigest methods are adapted, - # since these are the only functions used by Gems. - # - class DigestAdapter - - # Initialize a digest adapter. - def initialize(digest_class) - @digest_class = digest_class - end - - # Return a new digester. Since we are only implementing the stateless - # methods, we will return ourself as the instance. - def new - self - end - - # Return the digest of +string+ as a hex string. - def hexdigest(string) - @digest_class.new(string).hexdigest - end - - # Return the digest of +string+ as a binary string. - def digest(string) - @digest_class.new(string).digest - end - end -end Index: lib/rubygems/digest/sha2.rb =================================================================== --- lib/rubygems/digest/sha2.rb (revision 22788) +++ lib/rubygems/digest/sha2.rb (revision 22789) @@ -7,10 +7,5 @@ require 'digest/sha2' module Gem - if RUBY_VERSION >= '1.8.6' - SHA256 = Digest::SHA256 - else - require 'rubygems/digest/digest_adapter' - SHA256 = DigestAdapter.new(Digest::SHA256) - end + SHA256 = Digest::SHA256 end Index: lib/rubygems/digest/md5.rb =================================================================== --- lib/rubygems/digest/md5.rb (revision 22788) +++ lib/rubygems/digest/md5.rb (revision 22789) @@ -8,14 +8,6 @@ # :stopdoc: module Gem - if RUBY_VERSION >= '1.8.6' - MD5 = Digest::MD5 - else - require 'rubygems/digest/digest_adapter' - MD5 = DigestAdapter.new(Digest::MD5) - def MD5.md5(string) - self.hexdigest(string) - end - end + MD5 = Digest::MD5 end # :startdoc: Index: lib/rubygems/digest/sha1.rb =================================================================== --- lib/rubygems/digest/sha1.rb (revision 22788) +++ lib/rubygems/digest/sha1.rb (revision 22789) @@ -7,10 +7,5 @@ require 'digest/sha1' module Gem - if RUBY_VERSION >= '1.8.6' - SHA1 = Digest::SHA1 - else - require 'rubygems/digest/digest_adapter' - SHA1 = DigestAdapter.new(Digest::SHA1) - end + SHA1 = Digest::SHA1 end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/