util/rubocop -A --only Layout/ParameterAlignment
This commit is contained in:
parent
0373615948
commit
b304cf324a
@ -17,8 +17,7 @@ class Gem::Commands::QueryCommand < Gem::Command
|
|||||||
alert_warning message unless Gem::Deprecate.skip
|
alert_warning message unless Gem::Deprecate.skip
|
||||||
end
|
end
|
||||||
|
|
||||||
def initialize(name = "query",
|
def initialize(name = "query", summary = "Query gem information in local or remote repositories")
|
||||||
summary = "Query gem information in local or remote repositories")
|
|
||||||
super name, summary,
|
super name, summary,
|
||||||
:domain => :local, :details => false, :versions => true,
|
:domain => :local, :details => false, :versions => true,
|
||||||
:installed => nil, :version => Gem::Requirement.default
|
:installed => nil, :version => Gem::Requirement.default
|
||||||
|
@ -397,8 +397,7 @@ module Gem::Security
|
|||||||
#
|
#
|
||||||
# The +extensions+ restrict the key to the indicated uses.
|
# The +extensions+ restrict the key to the indicated uses.
|
||||||
|
|
||||||
def self.create_cert(subject, key, age = ONE_YEAR, extensions = EXTENSIONS,
|
def self.create_cert(subject, key, age = ONE_YEAR, extensions = EXTENSIONS, serial = 1)
|
||||||
serial = 1)
|
|
||||||
cert = OpenSSL::X509::Certificate.new
|
cert = OpenSSL::X509::Certificate.new
|
||||||
|
|
||||||
cert.public_key = get_public_key(key)
|
cert.public_key = get_public_key(key)
|
||||||
@ -449,8 +448,7 @@ module Gem::Security
|
|||||||
# Creates a self-signed certificate with an issuer and subject of +subject+
|
# Creates a self-signed certificate with an issuer and subject of +subject+
|
||||||
# and the given +extensions+ for the +key+.
|
# and the given +extensions+ for the +key+.
|
||||||
|
|
||||||
def self.create_cert_self_signed(subject, key, age = ONE_YEAR,
|
def self.create_cert_self_signed(subject, key, age = ONE_YEAR, extensions = EXTENSIONS, serial = 1)
|
||||||
extensions = EXTENSIONS, serial = 1)
|
|
||||||
certificate = create_cert subject, key, age, extensions
|
certificate = create_cert subject, key, age, extensions
|
||||||
|
|
||||||
sign certificate, key, certificate, age, extensions, serial
|
sign certificate, key, certificate, age, extensions, serial
|
||||||
@ -506,8 +504,7 @@ module Gem::Security
|
|||||||
#--
|
#--
|
||||||
# TODO increment serial
|
# TODO increment serial
|
||||||
|
|
||||||
def self.re_sign(expired_certificate, private_key, age = ONE_YEAR,
|
def self.re_sign(expired_certificate, private_key, age = ONE_YEAR, extensions = EXTENSIONS)
|
||||||
extensions = EXTENSIONS)
|
|
||||||
raise Gem::Security::Exception,
|
raise Gem::Security::Exception,
|
||||||
"incorrect signing key for re-signing " +
|
"incorrect signing key for re-signing " +
|
||||||
expired_certificate.subject.to_s unless
|
expired_certificate.subject.to_s unless
|
||||||
@ -543,8 +540,7 @@ module Gem::Security
|
|||||||
#
|
#
|
||||||
# Returns the newly signed certificate.
|
# Returns the newly signed certificate.
|
||||||
|
|
||||||
def self.sign(certificate, signing_key, signing_cert,
|
def self.sign(certificate, signing_key, signing_cert, age = ONE_YEAR, extensions = EXTENSIONS, serial = 1)
|
||||||
age = ONE_YEAR, extensions = EXTENSIONS, serial = 1)
|
|
||||||
signee_subject = certificate.subject
|
signee_subject = certificate.subject
|
||||||
signee_key = certificate.public_key
|
signee_key = certificate.public_key
|
||||||
|
|
||||||
|
@ -205,8 +205,7 @@ class Gem::Security::Policy
|
|||||||
#
|
#
|
||||||
# If +key+ is given it is used to validate the signing certificate.
|
# If +key+ is given it is used to validate the signing certificate.
|
||||||
|
|
||||||
def verify(chain, key = nil, digests = {}, signatures = {},
|
def verify(chain, key = nil, digests = {}, signatures = {}, full_name = "(unknown)")
|
||||||
full_name = "(unknown)")
|
|
||||||
if signatures.empty?
|
if signatures.empty?
|
||||||
if @only_signed
|
if @only_signed
|
||||||
raise Gem::Security::Exception,
|
raise Gem::Security::Exception,
|
||||||
|
@ -73,8 +73,7 @@ class Gem::Source::Local < Gem::Source
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def find_gem(gem_name, version = Gem::Requirement.default, # :nodoc:
|
def find_gem(gem_name, version = Gem::Requirement.default, prerelease = false) # :nodoc:
|
||||||
prerelease = false)
|
|
||||||
load_specs :complete
|
load_specs :complete
|
||||||
|
|
||||||
found = []
|
found = []
|
||||||
|
@ -424,8 +424,7 @@ class Gem::StreamUI
|
|||||||
# +size+ items. Shows the given +initial_message+ when progress starts
|
# +size+ items. Shows the given +initial_message+ when progress starts
|
||||||
# and the +terminal_message+ when it is complete.
|
# and the +terminal_message+ when it is complete.
|
||||||
|
|
||||||
def initialize(out_stream, size, initial_message,
|
def initialize(out_stream, size, initial_message, terminal_message = "complete")
|
||||||
terminal_message = "complete")
|
|
||||||
@out = out_stream
|
@out = out_stream
|
||||||
@total = size
|
@total = size
|
||||||
@count = 0
|
@count = 0
|
||||||
@ -467,8 +466,7 @@ class Gem::StreamUI
|
|||||||
# +size+ items. Shows the given +initial_message+ when progress starts
|
# +size+ items. Shows the given +initial_message+ when progress starts
|
||||||
# and the +terminal_message+ when it is complete.
|
# and the +terminal_message+ when it is complete.
|
||||||
|
|
||||||
def initialize(out_stream, size, initial_message,
|
def initialize(out_stream, size, initial_message, terminal_message = "complete")
|
||||||
terminal_message = "complete")
|
|
||||||
@out = out_stream
|
@out = out_stream
|
||||||
@total = size
|
@total = size
|
||||||
@count = 0
|
@count = 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user