ruby-changes:26173
From: drbrain <ko1@a...>
Date: Thu, 6 Dec 2012 14:28:20 +0900 (JST)
Subject: [ruby-changes:26173] drbrain:r38230 (trunk): * lib/rubygems/command_manager.rb: Removed string concatenation
drbrain 2012-12-06 14:26:46 +0900 (Thu, 06 Dec 2012) New Revision: 38230 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=38230 Log: * lib/rubygems/command_manager.rb: Removed string concatenation syntax. [Bug #6265] * lib/rubygems/commands/install_command.rb: ditto * lib/rubygems/commands/uninstall_command.rb: ditto * lib/rubygems/indexer.rb: ditto * lib/rubygems/security/policy.rb: ditto * lib/rubygems/security.rb: ditto * lib/rubygems/uninstaller.rb: ditto * test/rubygems/test_gem_commands_cert_command.rb: ditto * test/rubygems/test_gem_package.rb: ditto * test/rubygems/test_gem_security.rb: ditto * test/rubygems/test_gem_security_policy.rb: ditto Modified files: trunk/ChangeLog trunk/lib/rubygems/command_manager.rb trunk/lib/rubygems/commands/install_command.rb trunk/lib/rubygems/commands/uninstall_command.rb trunk/lib/rubygems/indexer.rb trunk/lib/rubygems/security/policy.rb trunk/lib/rubygems/security.rb trunk/lib/rubygems/uninstaller.rb trunk/test/rubygems/test_gem_commands_cert_command.rb trunk/test/rubygems/test_gem_package.rb trunk/test/rubygems/test_gem_security.rb trunk/test/rubygems/test_gem_security_policy.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 38229) +++ ChangeLog (revision 38230) @@ -1,3 +1,18 @@ +Thu Dec 6 14:26:22 2012 Eric Hodel <drbrain@s...> + + * lib/rubygems/command_manager.rb: Removed string concatenation + syntax. [Bug #6265] + * lib/rubygems/commands/install_command.rb: ditto + * lib/rubygems/commands/uninstall_command.rb: ditto + * lib/rubygems/indexer.rb: ditto + * lib/rubygems/security/policy.rb: ditto + * lib/rubygems/security.rb: ditto + * lib/rubygems/uninstaller.rb: ditto + * test/rubygems/test_gem_commands_cert_command.rb: ditto + * test/rubygems/test_gem_package.rb: ditto + * test/rubygems/test_gem_security.rb: ditto + * test/rubygems/test_gem_security_policy.rb: ditto + Thu Dec 6 14:10:08 2012 Eric Hodel <drbrain@s...> * lib/rubygems/package.rb: Set rubygems_version before validation. Index: lib/rubygems/indexer.rb =================================================================== --- lib/rubygems/indexer.rb (revision 38229) +++ lib/rubygems/indexer.rb (revision 38230) @@ -54,8 +54,8 @@ require 'zlib' unless defined?(Builder::XChar) then - raise "Gem::Indexer requires that the XML Builder library be installed:" \ - "\n\tgem install builder" + raise "Gem::Indexer requires that the XML Builder library be installed:" + + "\n\tgem install builder" end options = { :build_modern => true }.merge options Index: lib/rubygems/commands/install_command.rb =================================================================== --- lib/rubygems/commands/install_command.rb (revision 38229) +++ lib/rubygems/commands/install_command.rb (revision 38230) @@ -48,7 +48,7 @@ end def defaults_str # :nodoc: - "--both --version '#{Gem::Requirement.default}' --document --no-force\n" \ + "--both --version '#{Gem::Requirement.default}' --document --no-force\n" + "--install-dir #{Gem.dir}" end Index: lib/rubygems/commands/uninstall_command.rb =================================================================== --- lib/rubygems/commands/uninstall_command.rb (revision 38229) +++ lib/rubygems/commands/uninstall_command.rb (revision 38230) @@ -76,8 +76,8 @@ end def defaults_str # :nodoc: - "--version '#{Gem::Requirement.default}' --no-force " \ - "--install-dir #{Gem.dir}\n" \ + "--version '#{Gem::Requirement.default}' --no-force " + + "--install-dir #{Gem.dir}\n" + "--user-install" end @@ -101,7 +101,7 @@ Gem::Uninstaller.new(gem_name, options).uninstall rescue Gem::GemNotInHomeException => e spec = e.spec - alert("In order to remove #{spec.name}, please execute:\n" \ + alert("In order to remove #{spec.name}, please execute:\n" + "\tgem uninstall #{spec.name} --install-dir=#{spec.installation_path}") end end Index: lib/rubygems/uninstaller.rb =================================================================== --- lib/rubygems/uninstaller.rb (revision 38229) +++ lib/rubygems/uninstaller.rb (revision 38230) @@ -178,8 +178,8 @@ executables = executables.map { |exec| formatted_program_filename exec } remove = if @force_executables.nil? then - ask_yes_no("Remove executables:\n" \ - "\t#{executables.join ', '}\n\n" \ + ask_yes_no("Remove executables:\n" + + "\t#{executables.join ', '}\n\n" + "in addition to the gem?", true) else Index: lib/rubygems/security/policy.rb =================================================================== --- lib/rubygems/security/policy.rb (revision 38229) +++ lib/rubygems/security/policy.rb (revision 38230) @@ -112,7 +112,7 @@ root = chain.first raise Gem::Security::Exception, - "root certificate #{root.subject} is not self-signed " \ + "root certificate #{root.subject} is not self-signed " + "(issuer #{root.issuer})" if root.issuer.to_s != root.subject.to_s # HACK to_s is for ruby 1.8 @@ -144,7 +144,7 @@ cert_dgst = digester.digest pkey_str raise Gem::Security::Exception, - "trusted root certificate #{root.subject} checksum " \ + "trusted root certificate #{root.subject} checksum " + "does not match signing root certificate checksum" unless save_dgst == cert_dgst @@ -152,7 +152,7 @@ end def inspect # :nodoc: - "[Policy: %s - data: %p signer: %p chain: %p root: %p " \ + "[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, Index: lib/rubygems/security.rb =================================================================== --- lib/rubygems/security.rb (revision 38229) +++ lib/rubygems/security.rb (revision 38230) @@ -463,7 +463,7 @@ def self.re_sign expired_certificate, private_key, age = ONE_YEAR, extensions = EXTENSIONS raise Gem::Security::Exception, - "incorrect signing key for re-signing " \ + "incorrect signing key for re-signing " + "#{expired_certificate.subject}" unless expired_certificate.public_key.to_pem == private_key.public_key.to_pem @@ -473,7 +473,7 @@ issuer = alt_name_or_x509_entry expired_certificate, :issuer raise Gem::Security::Exception, - "#{subject} is not self-signed, contact #{issuer} " \ + "#{subject} is not self-signed, contact #{issuer} " + "to obtain a valid certificate" end Index: lib/rubygems/command_manager.rb =================================================================== --- lib/rubygems/command_manager.rb (revision 38229) +++ lib/rubygems/command_manager.rb (revision 38230) @@ -176,8 +176,7 @@ if possibilities.size > 1 then raise Gem::CommandLineError, - "Ambiguous command #{cmd_name} " \ - "matches [#{possibilities.join(', ')}]" + "Ambiguous command #{cmd_name} matches [#{possibilities.join(', ')}]" elsif possibilities.empty? then raise Gem::CommandLineError, "Unknown command #{cmd_name}" end Index: test/rubygems/test_gem_security_policy.rb =================================================================== --- test/rubygems/test_gem_security_policy.rb (revision 38229) +++ test/rubygems/test_gem_security_policy.rb (revision 38230) @@ -91,8 +91,8 @@ @chain.check_chain chain, Time.now end - assert_equal "invalid signing chain: " \ - "certificate #{INVALIDCHILD_CERT.subject} " \ + assert_equal "invalid signing chain: " + + "certificate #{INVALIDCHILD_CERT.subject} " + "was not issued by #{CHILD_CERT.subject}", e.message end @@ -105,7 +105,7 @@ @low.check_cert EXPIRED_CERT, nil, Time.now end - assert_equal "certificate #{EXPIRED_CERT.subject} " \ + assert_equal "certificate #{EXPIRED_CERT.subject} " + "not valid after #{EXPIRED_CERT.not_after}", e.message end @@ -115,7 +115,7 @@ @low.check_cert FUTURE_CERT, nil, Time.now end - assert_equal "certificate #{FUTURE_CERT.subject} " \ + assert_equal "certificate #{FUTURE_CERT.subject} " + "not valid before #{FUTURE_CERT.not_before}", e.message end @@ -125,7 +125,7 @@ @low.check_cert INVALID_ISSUER_CERT, PUBLIC_CERT, Time.now end - assert_equal "certificate #{INVALID_ISSUER_CERT.subject} " \ + assert_equal "certificate #{INVALID_ISSUER_CERT.subject} " + "was not issued by #{PUBLIC_CERT.subject}", e.message end @@ -143,7 +143,7 @@ @almost_no.check_key(PUBLIC_CERT, ALTERNATE_KEY) end - assert_equal "certificate #{PUBLIC_CERT.subject} " \ + assert_equal "certificate #{PUBLIC_CERT.subject} " + "does not match the signing key", e.message end @@ -160,7 +160,7 @@ @chain.check_root chain, Time.now end - assert_equal "certificate #{INVALID_SIGNER_CERT.subject} " \ + assert_equal "certificate #{INVALID_SIGNER_CERT.subject} " + "was not issued by #{INVALID_SIGNER_CERT.issuer}", e.message end @@ -172,7 +172,7 @@ @chain.check_root chain, Time.now end - assert_equal "root certificate #{INVALID_ISSUER_CERT.subject} " \ + assert_equal "root certificate #{INVALID_ISSUER_CERT.subject} " + "is not self-signed (issuer #{INVALID_ISSUER_CERT.issuer})", e.message end @@ -196,7 +196,7 @@ @high.check_trust [WRONG_KEY_CERT], @sha1, @trust_dir end - assert_equal "trusted root certificate #{PUBLIC_CERT.subject} checksum " \ + assert_equal "trusted root certificate #{PUBLIC_CERT.subject} checksum " + "does not match signing root certificate checksum", e.message end @@ -213,7 +213,7 @@ @high.check_trust [PUBLIC_CERT, CHILD_CERT], @sha1, @trust_dir end - assert_equal "root cert #{PUBLIC_CERT.subject} is not trusted " \ + assert_equal "root cert #{PUBLIC_CERT.subject} is not trusted " + "(root of signing cert #{CHILD_CERT.subject})", e.message end Index: test/rubygems/test_gem_package.rb =================================================================== --- test/rubygems/test_gem_package.rb (revision 38229) +++ test/rubygems/test_gem_package.rb (revision 38230) @@ -302,7 +302,7 @@ package.extract_tar_gz tgz_io, @destination end - assert_equal("installing into parent path /absolute.rb of " \ + assert_equal("installing into parent path /absolute.rb of " + "#{@destination} is not allowed", e.message) end @@ -325,7 +325,7 @@ package.install_location '/absolute.rb', @destination end - assert_equal("installing into parent path /absolute.rb of " \ + assert_equal("installing into parent path /absolute.rb of " + "#{@destination} is not allowed", e.message) end @@ -338,7 +338,7 @@ parent = File.expand_path File.join @destination, "../relative.rb" - assert_equal("installing into parent path #{parent} of " \ + assert_equal("installing into parent path #{parent} of " + "#{@destination} is not allowed", e.message) end Index: test/rubygems/test_gem_security.rb =================================================================== --- test/rubygems/test_gem_security.rb (revision 38229) +++ test/rubygems/test_gem_security.rb (revision 38230) @@ -129,7 +129,7 @@ Gem::Security.re_sign CHILD_CERT, CHILD_KEY end - assert_equal "#{ALTERNATE_CERT.subject} is not self-signed, contact " \ + assert_equal "#{ALTERNATE_CERT.subject} is not self-signed, contact " + "#{ALTERNATE_CERT.issuer} to obtain a valid certificate", e.message end @@ -139,7 +139,7 @@ Gem::Security.re_sign ALTERNATE_CERT, PRIVATE_KEY end - assert_equal "incorrect signing key for re-signing " \ + assert_equal "incorrect signing key for re-signing " + "#{ALTERNATE_CERT.subject}", e.message end Index: test/rubygems/test_gem_commands_cert_command.rb =================================================================== --- test/rubygems/test_gem_commands_cert_command.rb (revision 38229) +++ test/rubygems/test_gem_commands_cert_command.rb (revision 38230) @@ -441,8 +441,7 @@ @cmd.handle_options %W[--certificate #{nonexistent}] end - assert_equal "invalid argument: " \ - "--certificate #{nonexistent}: does not exist", + assert_equal "invalid argument: --certificate #{nonexistent}: does not exist", e.message bad = File.join @tempdir, 'bad' @@ -452,7 +451,7 @@ @cmd.handle_options %W[--certificate #{bad}] end - assert_equal "invalid argument: " \ + assert_equal "invalid argument: " + "--certificate #{bad}: invalid X509 certificate", e.message end @@ -463,7 +462,7 @@ @cmd.handle_options %W[--private-key #{nonexistent}] end - assert_equal "invalid argument: " \ + assert_equal "invalid argument: " + "--private-key #{nonexistent}: does not exist", e.message @@ -481,7 +480,7 @@ @cmd.handle_options %W[--private-key #{PUBLIC_KEY_FILE}] end - assert_equal "invalid argument: " \ + assert_equal "invalid argument: " + "--private-key #{PUBLIC_KEY_FILE}: private key not found", e.message end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/