Skip to content

Commit

Permalink
Add Gem::Security::Policy#inspect
Browse files Browse the repository at this point in the history
  • Loading branch information
drbrain committed Jan 16, 2012
1 parent 5da9c59 commit 1c725e6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/rubygems/security/policy.rb
Expand Up @@ -105,7 +105,7 @@ def check_trust chain, digester, trust_dir

# get digest algorithm, calculate checksum of root.subject
path = Gem::Security.trusted_cert_path(root, :trust_dir => trust_dir,
:digester => digester)
:digester => digester)

# check to make sure trusted path exists
unless File.exist? path
Expand Down Expand Up @@ -133,6 +133,14 @@ def check_trust chain, digester, trust_dir
true
end

def inspect # :nodoc:
"[Policy: %s - data: %p signer: %p chain: %p root: %p " \
"signed-only: %p trusted-only: %p]" % [
@name, @verify_chain, @verify_data, @verify_root, @verify_signer,
@only_signed, @only_trusted,
]
end

##
# Verify that the gem data with the given signature and signing chain
# matched this security policy at the specified time.
Expand Down

0 comments on commit 1c725e6

Please sign in to comment.