diff options
36 files changed, 62 insertions, 62 deletions
@@ -903,7 +903,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]} # Glob pattern for require-able path suffixes. def self.suffix_pattern - @suffix_pattern ||= "{#{suffixes.join(',')}}" end ## @@ -290,7 +290,7 @@ class Gem::BasicSpecification def lib_dirs_glob dirs = if self.raw_require_paths if self.raw_require_paths.size > 1 - "{#{self.raw_require_paths.join(',')}}" else self.raw_require_paths.first end @@ -227,7 +227,7 @@ class Gem::Command if args.size > 1 raise Gem::CommandLineError, - "Too many gem names (#{args.join(', ')}); please specify only one" end args.first @@ -200,7 +200,7 @@ class Gem::CommandManager if possibilities.size > 1 raise Gem::CommandLineError, - "Ambiguous command #{cmd_name} matches [#{possibilities.join(', ')}]" elsif possibilities.empty? raise Gem::UnknownCommandError.new(cmd_name) end @@ -89,7 +89,7 @@ If no gems are named all gems in GEM_HOME are cleaned. verbose do skipped = @default_gems.map {|spec| spec.full_name } - "Skipped default gems: #{skipped.join ', '}" end end @@ -91,7 +91,7 @@ prefix or only the files that are requireable. def files_in_gem(spec) gem_path = spec.full_gem_path - extra = "/{#{spec.require_paths.join ','}}" if options[:lib_only] glob = "#{gem_path}#{extra}/**/*" prefix_re = /#{Regexp.escape(gem_path)}\// @@ -327,7 +327,7 @@ platform. summary_width = 80 - margin_width - desc_width wrap_indent = " " * (margin_width + desc_width) - format = "#{' ' * margin_width}%-#{desc_width}s%s" @command_manager.command_names.each do |cmd_name| command = @command_manager[cmd_name] @@ -366,7 +366,7 @@ platform. command = @command_manager[possibilities.first] command.invoke("--help") elsif possibilities.size > 1 - alert_warning "Ambiguous command #{command_name} (#{possibilities.join(', ')})" else alert_warning "Unknown command #{command_name}. Try: gem help commands" end @@ -78,7 +78,7 @@ permission to. say "Owners for gem: #{name}" owners.each do |owner| - say "- #{owner['email'] || owner['handle'] || owner['id']}" end end end @@ -133,7 +133,7 @@ prefix and suffix. If ruby was installed as `ruby18`, gem will be installed as `gem18`. By default, this RubyGems will install gem as: - #{Gem.default_exec_format % 'gem'} EOF end @@ -33,7 +33,7 @@ longer using. end gem_to_atime.sort_by {|_, atime| atime }.each do |name, atime| - say "#{name} at #{atime.strftime '%c'}" end end end @@ -127,10 +127,10 @@ command to remove old versions. if updated.empty? say "Nothing to update" else - say "Gems updated: #{updated_names.join(' ')}" end - say "Gems already up-to-date: #{up_to_date_names.join(' ')}" unless up_to_date_names.empty? - say "Gems not currently installed: #{not_installed_names.join(' ')}" unless not_installed_names.empty? end def fetch_remote_gems(spec) # :nodoc: @@ -38,7 +38,7 @@ module Kernel if gem_name.kind_of? Gem::Dependency unless Gem::Deprecate.skip - warn "#{Gem.location_of_caller.join ':'}:Warning: Kernel.gem no longer "\ "accepts a Gem::Dependency object, please pass the name "\ "and requirements directly" end @@ -126,7 +126,7 @@ module Kernel if names.size > 1 RUBYGEMS_ACTIVATION_MONITOR.exit - raise Gem::LoadError, "#{path} found in multiple gems: #{names.join ', '}" end # Ok, now find a gem that has no conflicts, starting @@ -32,7 +32,7 @@ class Gem::Doctor Gem::REPOSITORY_SUBDIRECTORIES.sort - REPOSITORY_EXTENSION_MAP.map {|(k,_)| k }.sort - raise "Update REPOSITORY_EXTENSION_MAP, missing: #{missing.join ', '}" unless missing.empty? ## @@ -60,7 +60,7 @@ module Gem def build_message names = specs.map(&:full_name) - "Could not find '#{name}' (#{requirement}) - did find: [#{names.join ','}]\n" end end @@ -255,7 +255,7 @@ class Gem::UnsatisfiableDependencyError < Gem::DependencyError def initialize(dep, platform_mismatch=nil) if platform_mismatch && !platform_mismatch.empty? plats = platform_mismatch.map {|x| x.platform.to_s }.sort.uniq - super "Unable to resolve dependency: No match for '#{dep}' on this platform. Found: #{plats.join(', ')}" else if dep.explicit? super "Unable to resolve dependency: user requested '#{dep}'" @@ -189,7 +189,7 @@ EOF if @build_args.empty? say "Building native extensions. This could take a while..." else - say "Building native extensions with: '#{@build_args.join ' '}'" say "This could take a while..." end @@ -211,7 +211,7 @@ module Gem::GemcutterUtilities say clean_text(response.body) end when Net::HTTPPermanentRedirect, Net::HTTPRedirection then - message = "The request has redirected permanently to #{response['location']}. Please check your defined push host URL." message = "#{error_prefix}: #{message}" if error_prefix say clean_text(message) @@ -141,7 +141,7 @@ module Gem::InstallUpdateOptions end unless v unless v - message = v ? v : "(tried #{Gem::GEM_DEP_FILES.join ', '})" raise Gem::OptionParser::InvalidArgument, "cannot find gem dependencies file #{message}" @@ -807,7 +807,7 @@ TEXT rb_topdir = RbConfig::TOPDIR || File.dirname(rb_config["bindir"]) # get ruby executable file name from RbConfig - ruby_exe = "#{rb_config['RUBY_INSTALL_NAME']}#{rb_config['EXEEXT']}" ruby_exe = "ruby.exe" if ruby_exe.empty? if File.exist?(File.join bindir, ruby_exe) @@ -692,7 +692,7 @@ EOM end if (duplicates = @files.group_by {|f| f }.select {|_k,v| v.size > 1 }.map(&:first)) && duplicates.any? - raise Gem::Security::Exception, "duplicate files in the package: (#{duplicates.map(&:inspect).join(', ')})" end end @@ -263,7 +263,7 @@ module Gem::QueryUtils end end - entry << " (#{list.join ', '})" end def make_entry(entry_tuples, platforms) @@ -282,7 +282,7 @@ module Gem::QueryUtils end def spec_authors(entry, spec) - authors = "Author#{spec.authors.length > 1 ? 's' : ''}: ".dup authors << spec.authors.join(", ") entry << format_text(authors, 68, 4) end @@ -296,7 +296,7 @@ module Gem::QueryUtils def spec_license(entry, spec) return if spec.license.nil? || spec.license.empty? - licenses = "License#{spec.licenses.length > 1 ? 's' : ''}: ".dup licenses << spec.licenses.join(", ") entry << "\n" << format_text(licenses, 68, 4) end @@ -327,7 +327,7 @@ module Gem::QueryUtils if platforms.length == 1 title = platforms.values.length == 1 ? "Platform" : "Platforms" - entry << " #{title}: #{platforms.values.sort.join(', ')}\n" else entry << " Platforms:\n" @@ -163,7 +163,7 @@ class Gem::Requirement "#{op} #{version}" end.uniq - " (#{list.join ', '})" end ## @@ -28,7 +28,7 @@ module Gem::SecurityOption policy = Gem::Security::Policies[value] unless policy valid = Gem::Security::Policies.keys.sort - raise Gem::OptionParser::InvalidArgument, "#{value} (#{valid.join ', '} are valid)" end policy end @@ -2348,7 +2348,7 @@ class Gem::Specification < Gem::BasicSpecification when Array then "[" + obj.map {|x| ruby_code x }.join(", ") + "]" when Hash then seg = obj.keys.sort.map {|k| "#{k.to_s.dump} => #{obj[k].to_s.dump}" } - "{ #{seg.join(', ')} }" when Gem::Version then obj.to_s.dump when DateLike then obj.strftime("%Y-%m-%d").dump when Time then obj.strftime("%Y-%m-%d").dump @@ -213,7 +213,7 @@ duplicate dependency on #{dep}, (#{prev.requirement}) use: end " if #{dep.name} is semantically versioned, use:\n" \ - " add_#{dep.type}_dependency '#{dep.name}', '~> #{base.join '.'}'#{bugfix}" end warning_messages << ["open-ended dependency on #{dep} is not recommended", recommendation].join("\n") + "\n" @@ -253,7 +253,7 @@ duplicate dependency on #{dep}, (#{prev.requirement}) use: @specification.instance_variable_get("@#{attrname}").nil? end return if nil_attributes.empty? - error "#{nil_attributes.join ', '} must not be nil" end def validate_rubygems_version @@ -374,7 +374,7 @@ duplicate dependency on #{dep}, (#{prev.requirement}) use: license value '#{license}' is invalid. Use a license identifier from http://spdx.org/licenses or '#{Gem::Licenses::NONSTANDARD}' for a nonstandard license. WARNING - message += "Did you mean #{suggestions.map {|s| "'#{s}'" }.join(', ')}?\n" unless suggestions.nil? warning(message) end end @@ -201,7 +201,7 @@ class Gem::Uninstaller remove = if @force_executables.nil? ask_yes_no("Remove executables:\n" + - "\t#{executables.join ', '}\n\n" + "in addition to the gem?", true) else @@ -334,7 +334,7 @@ class Gem::TestCase < Test::Unit::TestCase ruby end - @git = ENV["GIT"] || "git#{RbConfig::CONFIG['EXEEXT']}" Gem.ensure_gem_subdirectories @gemhome Gem.ensure_default_gem_subdirectories @gemhome @@ -1256,7 +1256,7 @@ Also, a list: ruby = ENV["RUBY"] return ruby if ruby ruby = "ruby" - rubyexe = "#{ruby}#{RbConfig::CONFIG['EXEEXT']}" 3.times do if File.exist?(ruby) && File.executable?(ruby) && !File.directory?(ruby) @@ -1331,8 +1331,8 @@ Also, a list: end end - @@good_rake = "#{rubybin} #{escape_path(__dir__, 'good_rake.rb')}" - @@bad_rake = "#{rubybin} #{escape_path(__dir__, 'bad_rake.rb')}" ## # Construct a new Gem::Dependency. @@ -664,7 +664,7 @@ class TestGem < Gem::TestCase gemdir = File.join @tempdir, "a/b/c/gemdir" FileUtils.rm_rf File.join(@tempdir, "a") rescue nil refute File.exist?(File.join(@tempdir, "a")), - "manually remove #{File.join @tempdir, 'a'}, tests are broken" Gem.use_paths gemdir Gem.ensure_gem_subdirectories gemdir @@ -128,9 +128,9 @@ Added '/CN=alternate/DC=example' output.shift assert_equal "Please repeat the passphrase for your Private Key: ", output.shift - assert_equal "Certificate: #{File.join @tempdir, 'gem-public_cert.pem'}", output.shift - assert_equal "Private Key: #{File.join @tempdir, 'gem-private_key.pem'}", output.shift assert_equal "Don't forget to move the key file to somewhere private!", @@ -160,9 +160,9 @@ Added '/CN=alternate/DC=example' output.shift assert_equal "Please repeat the passphrase for your Private Key: ", output.shift - assert_equal "Certificate: #{File.join @tempdir, 'gem-public_cert.pem'}", output.shift - assert_equal "Private Key: #{File.join @tempdir, 'gem-private_key.pem'}", output.shift assert_equal "Don't forget to move the key file to somewhere private!", @@ -220,9 +220,9 @@ Added '/CN=alternate/DC=example' output.shift assert_equal "Please repeat the passphrase for your Private Key: ", output.shift - assert_equal "Certificate: #{File.join @tempdir, 'gem-public_cert.pem'}", output.shift - assert_equal "Private Key: #{File.join @tempdir, 'gem-private_key.pem'}", output.shift assert_equal "Don't forget to move the key file to somewhere private!", @@ -283,7 +283,7 @@ Added '/CN=alternate/DC=example' output = @ui.output.split "\n" - assert_equal "Certificate: #{File.join @tempdir, 'gem-public_cert.pem'}", output.shift assert_empty output @@ -305,7 +305,7 @@ Added '/CN=alternate/DC=example' output = @ui.output.split "\n" - assert_equal "Certificate: #{File.join @tempdir, 'gem-public_cert.pem'}", output.shift assert_empty output @@ -326,7 +326,7 @@ Added '/CN=alternate/DC=example' output = @ui.output.split "\n" - assert_equal "Certificate: #{File.join @tempdir, 'gem-public_cert.pem'}", output.shift assert_empty output @@ -105,7 +105,7 @@ class TestGemCommandsPushCommand < Gem::TestCase end @response = "Successfully registered gem: freewill (1.0.0)" - @fetcher.data["#{@spec.metadata['allowed_push_host']}/api/v1/gems"] = HTTPResponseFactory.create(body: @response, code: 200, msg: "OK") @fetcher.data["#{Gem.host}/api/v1/gems"] = ["fail", 500, "Internal Server Error"] @@ -210,7 +210,7 @@ class TestGemCommandsSigninCommand < Gem::TestCase # Set the expected response for the Web-API supplied ENV["RUBYGEMS_HOST"] = host - data_key = "#{ENV['RUBYGEMS_HOST']}/api/v1/api_key" fetcher.data[data_key] = HTTPResponseFactory.create(body: api_key, code: 200, msg: "OK") use_ui key_name_ui do @@ -241,9 +241,9 @@ class TestGemCommandsSigninCommand < Gem::TestCase # Set the expected response for the Web-API supplied ENV["RUBYGEMS_HOST"] = host || Gem::DEFAULT_HOST - data_key = "#{ENV['RUBYGEMS_HOST']}/api/v1/api_key" fetcher.data[data_key] = response - profile = "#{ENV['RUBYGEMS_HOST']}/api/v1/profile/me.yaml" fetcher.data[profile] = profile_response Gem::RemoteFetcher.fetcher = fetcher @@ -36,7 +36,7 @@ class TestGemExtCargoBuilder < Gem::TestCase end output = output.join "\n" - bundle = File.join(@dest_path, "rust_ruby_example.#{RbConfig::CONFIG['DLEXT']}") assert_match(/Finished/, output) assert_match(/release/, output) @@ -62,7 +62,7 @@ class TestGemExtCargoBuilder < Gem::TestCase end output = output.join "\n" - bundle = File.join(@dest_path, "rust_ruby_example.#{RbConfig::CONFIG['DLEXT']}") assert_ffi_handle bundle, "hello_from_rubygems" assert_ffi_handle bundle, "hello_from_rubygems_version" @@ -1977,7 +1977,7 @@ gem 'other', version bin_env = get_bin_env - assert_equal("#!#{bin_env} #{RbConfig::CONFIG['ruby_install_name']}", shebang) end @@ -268,10 +268,10 @@ class TestGemPackageTarWriter < Gem::Package::TarTestCase def test_split_name assert_equal ["b" * 100, "a" * 155], - @tar_writer.split_name("#{'a' * 155}/#{'b' * 100}") - assert_equal ["#{'qwer/' * 19}bla", "a" * 151], - @tar_writer.split_name("#{'a' * 151}/#{'qwer/' * 19}bla") names = [ ([""] + ["123456789"] * 9 + ["1234567890"]).join("/"), # 101 bytes (several pieces) (["123456789"] * 9 + ["1234567890"] + [""]).join("/"), # 101 bytes (several pieces) @@ -208,7 +208,7 @@ class TestGemRequest < Gem::TestCase end auth_header = conn.payload["Authorization"] - assert_equal "Basic #{Base64.encode64('user:pass')}".strip, auth_header assert_includes @ui.output, "GET https://user:[email protected]/specs.#{Gem.marshal_version}" end @@ -225,7 +225,7 @@ class TestGemRequest < Gem::TestCase end auth_header = conn.payload["Authorization"] - assert_equal "Basic #{Base64.encode64('user:{DEScede}pass')}".strip, auth_header assert_includes @ui.output, "GET https://user:[email protected]/specs.#{Gem.marshal_version}" end @@ -242,7 +242,7 @@ class TestGemRequest < Gem::TestCase end auth_header = conn.payload["Authorization"] - assert_equal "Basic #{Base64.encode64('{DEScede}pass:x-oauth-basic')}".strip, auth_header assert_includes @ui.output, "GET https://REDACTED:[email protected]/specs.#{Gem.marshal_version}" end |