diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-06-09 21:38:59 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-06-09 21:38:59 +0000 |
commit | 31c94ffeb5f09d09ac2c86fc9e6614e38251a43d (patch) | |
tree | 10e44506238c7af3d7c9d822111996731726e38d /lib/rubygems/gem_openssl.rb | |
parent | a6afbaeb3be396c0fdea3b9077d9256c59edcfca (diff) |
Update to RubyGems 1.3.4 r2223
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/gem_openssl.rb')
-rw-r--r-- | lib/rubygems/gem_openssl.rb | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/rubygems/gem_openssl.rb b/lib/rubygems/gem_openssl.rb index 1456f2d7ce..bdaad8050a 100644 --- a/lib/rubygems/gem_openssl.rb +++ b/lib/rubygems/gem_openssl.rb @@ -4,23 +4,30 @@ # See LICENSE.txt for permissions. #++ +#-- # Some system might not have OpenSSL installed, therefore the core # library file openssl might not be available. We localize testing # for the presence of OpenSSL in this file. +#++ module Gem class << self + ## # Is SSL (used by the signing commands) available on this # platform? + def ssl_available? - require 'rubygems/gem_openssl' @ssl_available end - # Set the value of the ssl_available flag. + ## + # Is SSL available? + attr_writer :ssl_available + ## # Ensure that SSL is available. Throw an exception if it is not. + def ensure_ssl_available unless ssl_available? fail Gem::Exception, "SSL is not installed on this system" @@ -61,6 +68,8 @@ rescue LoadError, StandardError Gem.ssl_available = false end +# :stopdoc: + module Gem::SSL # We make our own versions of the constants here. This allows us @@ -70,7 +79,7 @@ module Gem::SSL # These constants are only used during load time. At runtime, any # method that makes a direct reference to SSL software must be # protected with a Gem.ensure_ssl_available call. - # + if Gem.ssl_available? then PKEY_RSA = OpenSSL::PKey::RSA DIGEST_SHA1 = OpenSSL::Digest::SHA1 @@ -81,3 +90,5 @@ module Gem::SSL end +# :startdoc: + |