lib/rubygems/security/trust_dir.rb in rubygems-update-2.1.11 vs lib/rubygems/security/trust_dir.rb in rubygems-update-2.2.0.rc.1

- old
+ new

@@ -1,19 +1,33 @@ +## +# The TrustDir manages the trusted certificates for gem signature +# verification. + class Gem::Security::TrustDir + ## + # Default permissions for the trust directory and its contents + DEFAULT_PERMISSIONS = { :trust_dir => 0700, :trusted_cert => 0600, } + ## + # The directory where trusted certificates will be stored. + + attr_reader :dir + + ## + # Creates a new TrustDir using +dir+ where the directory and file + # permissions will be checked according to +permissions+ + def initialize dir, permissions = DEFAULT_PERMISSIONS @dir = dir @permissions = permissions @digester = Gem::Security::DIGEST_ALGORITHM end - - attr_reader :dir ## # Returns the path to the trusted +certificate+ def cert_path certificate