ruby-changes:53688
From: hsbt <ko1@a...>
Date: Wed, 21 Nov 2018 19:21:06 +0900 (JST)
Subject: [ruby-changes:53688] hsbt:r65904 (trunk): Merge master branch from rubygems/rubygems upstream.
hsbt 2018-11-21 19:20:47 +0900 (Wed, 21 Nov 2018) New Revision: 65904 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65904 Log: Merge master branch from rubygems/rubygems upstream. * Enable Style/MethodDefParentheses in Rubocop https://github.com/rubygems/rubygems/pull/2478 * Enable Style/MultilineIfThen in Rubocop https://github.com/rubygems/rubygems/pull/2479 * Fix required_ruby_version with prereleases and improve error message https://github.com/rubygems/rubygems/pull/2344 * Fix bundler rubygems binstub not properly looking for bundler https://github.com/rubygems/rubygems/pull/2426 Modified files: trunk/lib/rubygems/available_set.rb trunk/lib/rubygems/basic_specification.rb trunk/lib/rubygems/bundler_version_finder.rb trunk/lib/rubygems/command.rb trunk/lib/rubygems/command_manager.rb trunk/lib/rubygems/commands/build_command.rb trunk/lib/rubygems/commands/cert_command.rb trunk/lib/rubygems/commands/check_command.rb trunk/lib/rubygems/commands/cleanup_command.rb trunk/lib/rubygems/commands/contents_command.rb trunk/lib/rubygems/commands/dependency_command.rb trunk/lib/rubygems/commands/environment_command.rb trunk/lib/rubygems/commands/fetch_command.rb trunk/lib/rubygems/commands/generate_index_command.rb trunk/lib/rubygems/commands/help_command.rb trunk/lib/rubygems/commands/install_command.rb trunk/lib/rubygems/commands/list_command.rb trunk/lib/rubygems/commands/lock_command.rb trunk/lib/rubygems/commands/open_command.rb trunk/lib/rubygems/commands/owner_command.rb trunk/lib/rubygems/commands/pristine_command.rb trunk/lib/rubygems/commands/push_command.rb trunk/lib/rubygems/commands/query_command.rb trunk/lib/rubygems/commands/rdoc_command.rb trunk/lib/rubygems/commands/search_command.rb trunk/lib/rubygems/commands/server_command.rb trunk/lib/rubygems/commands/setup_command.rb trunk/lib/rubygems/commands/signin_command.rb trunk/lib/rubygems/commands/signout_command.rb trunk/lib/rubygems/commands/sources_command.rb trunk/lib/rubygems/commands/specification_command.rb trunk/lib/rubygems/commands/uninstall_command.rb trunk/lib/rubygems/commands/unpack_command.rb trunk/lib/rubygems/commands/update_command.rb trunk/lib/rubygems/commands/which_command.rb trunk/lib/rubygems/commands/yank_command.rb trunk/lib/rubygems/config_file.rb trunk/lib/rubygems/core_ext/kernel_require.rb trunk/lib/rubygems/defaults.rb trunk/lib/rubygems/dependency.rb trunk/lib/rubygems/dependency_installer.rb trunk/lib/rubygems/dependency_list.rb trunk/lib/rubygems/deprecate.rb trunk/lib/rubygems/doctor.rb trunk/lib/rubygems/errors.rb trunk/lib/rubygems/exceptions.rb trunk/lib/rubygems/ext/build_error.rb trunk/lib/rubygems/ext/builder.rb trunk/lib/rubygems/ext/cmake_builder.rb trunk/lib/rubygems/ext/configure_builder.rb trunk/lib/rubygems/ext/ext_conf_builder.rb trunk/lib/rubygems/ext/rake_builder.rb trunk/lib/rubygems/ext.rb trunk/lib/rubygems/gem_runner.rb trunk/lib/rubygems/gemcutter_utilities.rb trunk/lib/rubygems/indexer.rb trunk/lib/rubygems/install_default_message.rb trunk/lib/rubygems/install_message.rb trunk/lib/rubygems/install_update_options.rb trunk/lib/rubygems/installer.rb trunk/lib/rubygems/installer_test_case.rb trunk/lib/rubygems/local_remote_options.rb trunk/lib/rubygems/mock_gem_ui.rb trunk/lib/rubygems/name_tuple.rb trunk/lib/rubygems/package/digest_io.rb trunk/lib/rubygems/package/file_source.rb trunk/lib/rubygems/package/io_source.rb trunk/lib/rubygems/package/old.rb trunk/lib/rubygems/package/source.rb trunk/lib/rubygems/package/tar_header.rb trunk/lib/rubygems/package/tar_reader/entry.rb trunk/lib/rubygems/package/tar_reader.rb trunk/lib/rubygems/package/tar_test_case.rb trunk/lib/rubygems/package/tar_writer.rb trunk/lib/rubygems/package.rb trunk/lib/rubygems/package_task.rb trunk/lib/rubygems/path_support.rb trunk/lib/rubygems/platform.rb trunk/lib/rubygems/psych_tree.rb trunk/lib/rubygems/remote_fetcher.rb trunk/lib/rubygems/request/connection_pools.rb trunk/lib/rubygems/request/http_pool.rb trunk/lib/rubygems/request/https_pool.rb trunk/lib/rubygems/request.rb trunk/lib/rubygems/request_set/gem_dependency_api.rb trunk/lib/rubygems/request_set/lockfile/parser.rb trunk/lib/rubygems/request_set/lockfile/tokenizer.rb trunk/lib/rubygems/request_set/lockfile.rb trunk/lib/rubygems/request_set.rb trunk/lib/rubygems/requirement.rb trunk/lib/rubygems/resolver/activation_request.rb trunk/lib/rubygems/resolver/api_set.rb trunk/lib/rubygems/resolver/api_specification.rb trunk/lib/rubygems/resolver/best_set.rb trunk/lib/rubygems/resolver/composed_set.rb trunk/lib/rubygems/resolver/conflict.rb trunk/lib/rubygems/resolver/current_set.rb trunk/lib/rubygems/resolver/dependency_request.rb trunk/lib/rubygems/resolver/git_set.rb trunk/lib/rubygems/resolver/git_specification.rb trunk/lib/rubygems/resolver/index_set.rb trunk/lib/rubygems/resolver/index_specification.rb trunk/lib/rubygems/resolver/installed_specification.rb trunk/lib/rubygems/resolver/installer_set.rb trunk/lib/rubygems/resolver/local_specification.rb trunk/lib/rubygems/resolver/lock_set.rb trunk/lib/rubygems/resolver/lock_specification.rb trunk/lib/rubygems/resolver/requirement_list.rb trunk/lib/rubygems/resolver/set.rb trunk/lib/rubygems/resolver/source_set.rb trunk/lib/rubygems/resolver/spec_specification.rb trunk/lib/rubygems/resolver/specification.rb trunk/lib/rubygems/resolver/vendor_set.rb trunk/lib/rubygems/resolver/vendor_specification.rb trunk/lib/rubygems/resolver.rb trunk/lib/rubygems/safe_yaml.rb trunk/lib/rubygems/security/policies.rb trunk/lib/rubygems/security/policy.rb trunk/lib/rubygems/security/signer.rb trunk/lib/rubygems/security/trust_dir.rb trunk/lib/rubygems/security.rb trunk/lib/rubygems/server.rb trunk/lib/rubygems/source/git.rb trunk/lib/rubygems/source/installed.rb trunk/lib/rubygems/source/local.rb trunk/lib/rubygems/source/lock.rb trunk/lib/rubygems/source/specific_file.rb trunk/lib/rubygems/source/vendor.rb trunk/lib/rubygems/source.rb trunk/lib/rubygems/source_list.rb trunk/lib/rubygems/source_local.rb trunk/lib/rubygems/spec_fetcher.rb trunk/lib/rubygems/specification.rb trunk/lib/rubygems/specification_policy.rb trunk/lib/rubygems/stub_specification.rb trunk/lib/rubygems/test_case.rb trunk/lib/rubygems/test_utilities.rb trunk/lib/rubygems/text.rb trunk/lib/rubygems/uninstaller.rb trunk/lib/rubygems/uri_formatter.rb trunk/lib/rubygems/user_interaction.rb trunk/lib/rubygems/util/list.rb trunk/lib/rubygems/util.rb trunk/lib/rubygems/validator.rb trunk/lib/rubygems/version.rb trunk/lib/rubygems/version_option.rb trunk/lib/rubygems.rb trunk/test/rubygems/rubygems_plugin.rb trunk/test/rubygems/test_gem.rb trunk/test/rubygems/test_gem_command.rb trunk/test/rubygems/test_gem_command_manager.rb trunk/test/rubygems/test_gem_commands_build_command.rb trunk/test/rubygems/test_gem_commands_cert_command.rb trunk/test/rubygems/test_gem_commands_check_command.rb trunk/test/rubygems/test_gem_commands_cleanup_command.rb trunk/test/rubygems/test_gem_commands_contents_command.rb trunk/test/rubygems/test_gem_commands_dependency_command.rb trunk/test/rubygems/test_gem_commands_fetch_command.rb trunk/test/rubygems/test_gem_commands_generate_index_command.rb trunk/test/rubygems/test_gem_commands_help_command.rb trunk/test/rubygems/test_gem_commands_lock_command.rb trunk/test/rubygems/test_gem_commands_outdated_command.rb trunk/test/rubygems/test_gem_commands_owner_command.rb trunk/test/rubygems/test_gem_commands_search_command.rb trunk/test/rubygems/test_gem_commands_server_command.rb trunk/test/rubygems/test_gem_commands_setup_command.rb trunk/test/rubygems/test_gem_commands_signin_command.rb trunk/test/rubygems/test_gem_commands_sources_command.rb trunk/test/rubygems/test_gem_commands_specification_command.rb trunk/test/rubygems/test_gem_commands_uninstall_command.rb trunk/test/rubygems/test_gem_commands_unpack_command.rb trunk/test/rubygems/test_gem_commands_which_command.rb trunk/test/rubygems/test_gem_commands_yank_command.rb trunk/test/rubygems/test_gem_config_file.rb trunk/test/rubygems/test_gem_dependency.rb trunk/test/rubygems/test_gem_dependency_installer.rb trunk/test/rubygems/test_gem_dependency_list.rb trunk/test/rubygems/test_gem_dependency_resolution_error.rb trunk/test/rubygems/test_gem_doctor.rb trunk/test/rubygems/test_gem_ext_ext_conf_builder.rb trunk/test/rubygems/test_gem_ext_rake_builder.rb trunk/test/rubygems/test_gem_gem_runner.rb trunk/test/rubygems/test_gem_gemcutter_utilities.rb trunk/test/rubygems/test_gem_impossible_dependencies_error.rb trunk/test/rubygems/test_gem_indexer.rb trunk/test/rubygems/test_gem_installer.rb trunk/test/rubygems/test_gem_local_remote_options.rb trunk/test/rubygems/test_gem_name_tuple.rb trunk/test/rubygems/test_gem_package.rb trunk/test/rubygems/test_gem_package_old.rb trunk/test/rubygems/test_gem_package_tar_header.rb trunk/test/rubygems/test_gem_package_tar_reader.rb trunk/test/rubygems/test_gem_package_tar_writer.rb trunk/test/rubygems/test_gem_package_task.rb trunk/test/rubygems/test_gem_platform.rb trunk/test/rubygems/test_gem_rdoc.rb trunk/test/rubygems/test_gem_remote_fetcher.rb trunk/test/rubygems/test_gem_request.rb trunk/test/rubygems/test_gem_request_connection_pools.rb trunk/test/rubygems/test_gem_request_set_gem_dependency_api.rb trunk/test/rubygems/test_gem_request_set_lockfile.rb trunk/test/rubygems/test_gem_request_set_lockfile_parser.rb trunk/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb trunk/test/rubygems/test_gem_requirement.rb trunk/test/rubygems/test_gem_resolver.rb trunk/test/rubygems/test_gem_resolver_activation_request.rb trunk/test/rubygems/test_gem_resolver_api_set.rb trunk/test/rubygems/test_gem_resolver_api_specification.rb trunk/test/rubygems/test_gem_resolver_best_set.rb trunk/test/rubygems/test_gem_resolver_composed_set.rb trunk/test/rubygems/test_gem_resolver_conflict.rb trunk/test/rubygems/test_gem_resolver_dependency_request.rb trunk/test/rubygems/test_gem_resolver_git_set.rb trunk/test/rubygems/test_gem_resolver_git_specification.rb trunk/test/rubygems/test_gem_resolver_index_set.rb trunk/test/rubygems/test_gem_resolver_index_specification.rb trunk/test/rubygems/test_gem_resolver_installed_specification.rb trunk/test/rubygems/test_gem_resolver_installer_set.rb trunk/test/rubygems/test_gem_resolver_local_specification.rb trunk/test/rubygems/test_gem_resolver_lock_set.rb trunk/test/rubygems/test_gem_resolver_lock_specification.rb trunk/test/rubygems/test_gem_resolver_requirement_list.rb trunk/test/rubygems/test_gem_resolver_specification.rb trunk/test/rubygems/test_gem_resolver_vendor_set.rb trunk/test/rubygems/test_gem_resolver_vendor_specification.rb trunk/test/rubygems/test_gem_security.rb trunk/test/rubygems/test_gem_security_policy.rb trunk/test/rubygems/test_gem_security_signer.rb trunk/test/rubygems/test_gem_security_trust_dir.rb trunk/test/rubygems/test_gem_source.rb trunk/test/rubygems/test_gem_source_fetch_problem.rb trunk/test/rubygems/test_gem_source_git.rb trunk/test/rubygems/test_gem_source_installed.rb trunk/test/rubygems/test_gem_source_lock.rb trunk/test/rubygems/test_gem_source_vendor.rb trunk/test/rubygems/test_gem_spec_fetcher.rb trunk/test/rubygems/test_gem_specification.rb trunk/test/rubygems/test_gem_stream_ui.rb trunk/test/rubygems/test_gem_stub_specification.rb trunk/test/rubygems/test_gem_unsatisfiable_dependency_error.rb trunk/test/rubygems/test_gem_uri_formatter.rb trunk/test/rubygems/test_gem_util.rb trunk/test/rubygems/test_gem_validator.rb trunk/test/rubygems/test_gem_version.rb trunk/test/rubygems/test_gem_version_option.rb trunk/test/rubygems/test_remote_fetch_error.rb trunk/test/rubygems/test_require.rb Index: test/rubygems/test_gem_name_tuple.rb =================================================================== --- test/rubygems/test_gem_name_tuple.rb (revision 65903) +++ test/rubygems/test_gem_name_tuple.rb (revision 65904) @@ -42,4 +42,3 @@ class TestGemNameTuple < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_name_tuple.rb#L42 end end - Index: test/rubygems/test_gem_commands_generate_index_command.rb =================================================================== --- test/rubygems/test_gem_commands_generate_index_command.rb (revision 65903) +++ test/rubygems/test_gem_commands_generate_index_command.rb (revision 65904) @@ -48,4 +48,3 @@ class TestGemCommandsGenerateIndexComman https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_generate_index_command.rb#L48 end end if ''.respond_to? :to_xs - Index: test/rubygems/test_gem_commands_signin_command.rb =================================================================== --- test/rubygems/test_gem_commands_signin_command.rb (revision 65903) +++ test/rubygems/test_gem_commands_signin_command.rb (revision 65904) @@ -74,7 +74,7 @@ class TestGemCommandsSigninCommand < Gem https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_signin_command.rb#L74 # Utility method to capture IO/UI within the block passed - def util_capture ui_stub = nil, host = nil, api_key = nil + def util_capture(ui_stub = nil, host = nil, api_key = nil) api_key ||= 'a5fdbb6ba150cbb83aad2bb2fede64cf040453903' response = [api_key, 200, 'OK'] email = 'you@e...' Index: test/rubygems/test_gem_command_manager.rb =================================================================== --- test/rubygems/test_gem_command_manager.rb (revision 65903) +++ test/rubygems/test_gem_command_manager.rb (revision 65904) @@ -267,4 +267,3 @@ class TestGemCommandManager < Gem::TestC https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_command_manager.rb#L267 end end - Index: test/rubygems/test_gem_dependency_resolution_error.rb =================================================================== --- test/rubygems/test_gem_dependency_resolution_error.rb (revision 65903) +++ test/rubygems/test_gem_dependency_resolution_error.rb (revision 65904) @@ -26,4 +26,3 @@ class TestGemDependencyResolutionError < https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_dependency_resolution_error.rb#L26 end end - Index: test/rubygems/test_gem_resolver_local_specification.rb =================================================================== --- test/rubygems/test_gem_resolver_local_specification.rb (revision 65903) +++ test/rubygems/test_gem_resolver_local_specification.rb (revision 65904) @@ -43,4 +43,3 @@ class TestGemResolverLocalSpecification https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_resolver_local_specification.rb#L43 end end - Index: test/rubygems/test_gem_commands_which_command.rb =================================================================== --- test/rubygems/test_gem_commands_which_command.rb (revision 65903) +++ test/rubygems/test_gem_commands_which_command.rb (revision 65904) @@ -84,4 +84,3 @@ class TestGemCommandsWhichCommand < Gem: https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_which_command.rb#L84 end end - Index: test/rubygems/test_gem_request_connection_pools.rb =================================================================== --- test/rubygems/test_gem_request_connection_pools.rb (revision 65903) +++ test/rubygems/test_gem_request_connection_pools.rb (revision 65904) @@ -5,7 +5,7 @@ require 'timeout' https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_request_connection_pools.rb#L5 class TestGemRequestConnectionPool < Gem::TestCase class FakeHttp - def initialize *args + def initialize(*args) end def start Index: test/rubygems/test_gem_impossible_dependencies_error.rb =================================================================== --- test/rubygems/test_gem_impossible_dependencies_error.rb (revision 65903) +++ test/rubygems/test_gem_impossible_dependencies_error.rb (revision 65904) @@ -59,4 +59,3 @@ rye-0.9.8 requires net-ssh (>= 2.0.13) b https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_impossible_dependencies_error.rb#L59 end end - Index: test/rubygems/test_gem_ext_ext_conf_builder.rb =================================================================== --- test/rubygems/test_gem_ext_ext_conf_builder.rb (revision 65903) +++ test/rubygems/test_gem_ext_ext_conf_builder.rb (revision 65904) @@ -35,7 +35,7 @@ class TestGemExtExtConfBuilder < Gem::Te https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_ext_ext_conf_builder.rb#L35 end assert_match(/^current directory:/, output[0]) - assert_match(/^#{Regexp.quote(Gem.ruby.shellescape)}.* extconf.rb/, output[1]) + assert_match(/^#{Gem.ruby}.* extconf.rb/, output[1]) assert_equal "creating Makefile\n", output[2] assert_match(/^current directory:/, output[3]) assert_contains_make_command 'clean', output[4] @@ -109,7 +109,7 @@ class TestGemExtExtConfBuilder < Gem::Te https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_ext_ext_conf_builder.rb#L109 assert_equal 'extconf failed, exit code 1', error.message - assert_match(/^#{Regexp.quote(Gem.ruby.shellescape)}.* extconf.rb/, output[1]) + assert_match(/^#{Gem.ruby}.* extconf.rb/, output[1]) assert_match(File.join(@dest_path, 'mkmf.log'), output[4]) assert_includes(output, "To see why this extension failed to compile, please check the mkmf.log which can be found here:\n") @@ -216,14 +216,14 @@ end https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_ext_ext_conf_builder.rb#L216 assert_equal 'Makefile not found', error.message end - def configure_args args = nil + def configure_args(args = nil) configure_args = RbConfig::CONFIG['configure_args'] RbConfig::CONFIG['configure_args'] = args if args yield ensure - if configure_args then + if configure_args RbConfig::CONFIG['configure_args'] = configure_args else RbConfig::CONFIG.delete 'configure_args' Index: test/rubygems/test_gem_commands_check_command.rb =================================================================== --- test/rubygems/test_gem_commands_check_command.rb (revision 65903) +++ test/rubygems/test_gem_commands_check_command.rb (revision 65904) @@ -10,7 +10,7 @@ class TestGemCommandsCheckCommand < Gem: https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_check_command.rb#L10 @cmd = Gem::Commands::CheckCommand.new end - def gem name + def gem(name) spec = quick_gem name do |gem| gem.files = %W[lib/#{name}.rb Rakefile] end Index: test/rubygems/test_gem_installer.rb =================================================================== --- test/rubygems/test_gem_installer.rb (revision 65903) +++ test/rubygems/test_gem_installer.rb (revision 65904) @@ -56,7 +56,7 @@ version = \">= 0.a\" https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_installer.rb#L56 if ARGV.first str = ARGV.first str = str.dup.force_encoding("BINARY") - if str =~ /\\A_(.*)_\\z/ and Gem::Version.correct?($1) then + if str =~ /\\A_(.*)_\\z/ and Gem::Version.correct?($1) version = $1 ARGV.shift end @@ -121,7 +121,7 @@ end https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_installer.rb#L121 ensure Object.const_set :RUBY_FRAMEWORK_VERSION, orig_RUBY_FRAMEWORK_VERSION if orig_RUBY_FRAMEWORK_VERSION - if orig_bindir then + if orig_bindir RbConfig::CONFIG['bindir'] = orig_bindir else RbConfig::CONFIG.delete 'bindir' @@ -250,7 +250,7 @@ gem 'other', version https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_installer.rb#L250 expected = @installer.bin_dir - if Gem.win_platform? then + if Gem.win_platform? expected = expected.downcase.gsub(File::SEPARATOR, File::ALT_SEPARATOR) end @@ -488,7 +488,7 @@ gem 'other', version https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_installer.rb#L488 real_exec = File.join @spec.gem_dir, 'bin', 'executable' # fake --no-wrappers for previous install - unless Gem.win_platform? then + unless Gem.win_platform? FileUtils.mkdir_p File.dirname(installed_exec) FileUtils.ln_s real_exec, installed_exec end @@ -692,7 +692,7 @@ gem 'other', version https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_installer.rb#L692 @installer.generate_bin - default_shebang = Gem.ruby.shellescape + default_shebang = Gem.ruby shebang_line = open("#{@gemhome}/bin/executable") { |f| f.readlines.first } assert_match(/\A#!/, shebang_line) assert_match(/#{default_shebang}/, shebang_line) @@ -965,7 +965,7 @@ gem 'other', version https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_installer.rb#L965 def test_install_force use_ui @ui do - installer = Gem::Installer.at old_ruby_required, :force => true + installer = Gem::Installer.at old_ruby_required('= 1.4.6'), :force => true installer.install end @@ -1380,16 +1380,32 @@ gem 'other', version https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_installer.rb#L1380 def test_pre_install_checks_ruby_version use_ui @ui do - installer = Gem::Installer.at old_ruby_required + installer = Gem::Installer.at old_ruby_required('= 1.4.6') e = assert_raises Gem::RuntimeRequirementNotMetError do installer.pre_install_checks end - rv = Gem.ruby_api_version + rv = Gem.ruby_version assert_equal "old_ruby_required requires Ruby version = 1.4.6. The current ruby version is #{rv}.", e.message end end + def test_pre_install_checks_ruby_version_with_prereleases + util_set_RUBY_VERSION '2.6.0', -1, '63539', 'ruby 2.6.0preview2 (2018-05-31 trunk 63539) [x86_64-linux]' + + installer = Gem::Installer.at old_ruby_required('>= 2.6.0.preview2') + assert installer.pre_install_checks + + installer = Gem::Installer.at old_ruby_required('> 2.6.0.preview2') + e = assert_raises Gem::RuntimeRequirementNotMetError do + assert installer.pre_install_checks + end + assert_equal "old_ruby_required requires Ruby version > 2.6.0.preview2. The current ruby version is 2.6.0.preview2.", + e.message + ensure + util_restore_RUBY_VERSION + end + def test_pre_install_checks_wrong_rubygems_version spec = util_spec 'old_rubygems_required', '1' do |s| s.required_rubygems_version = '< 0' @@ -1415,7 +1431,7 @@ gem 'other', version https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_installer.rb#L1431 def spec.full_name # so the spec is buildable "malicious-1" end - def spec.validate packaging, strict; end + def spec.validate(packaging, strict); end util_build_gem spec @@ -1720,9 +1736,9 @@ gem 'other', version https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_installer.rb#L1736 assert_equal ['bin/executable'], default_spec.files end - def old_ruby_required + def old_ruby_required(requirement) spec = util_spec 'old_ruby_required', '1' do |s| - s.required_ruby_version = '= 1.4.6' + s.required_ruby_version = requirement end util_build_gem spec @@ -1737,7 +1753,7 @@ gem 'other', version https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_installer.rb#L1753 @installer = util_installer @spec, @gemhome end - def util_conflict_executable wrappers + def util_conflict_executable(wrappers) conflict = quick_gem 'conflict' do |spec| util_make_exec spec end Index: test/rubygems/test_gem_requirement.rb =================================================================== --- test/rubygems/test_gem_requirement.rb (revision 65903) +++ test/rubygems/test_gem_requirement.rb (revision 65904) @@ -387,26 +387,26 @@ class TestGemRequirement < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_requirement.rb#L387 # Assert that two requirements are equal. Handles Gem::Requirements, # strings, arrays, numbers, and versions. - def assert_requirement_equal expected, actual + def assert_requirement_equal(expected, actual) assert_equal req(expected), req(actual) end # Assert that +version+ satisfies +requirement+. - def assert_satisfied_by version, requirement + def assert_satisfied_by(version, requirement) assert req(requirement).satisfied_by?(v(version)), "#{requirement} is satisfied by #{version}" end # Refute the assumption that two requirements are equal. - def refute_requirement_equal unexpected, actual + def refute_requirement_equal(unexpected, actual) refute_equal req(unexpected), req(actual) end # Refute the assumption that +version+ satisfies +requirement+. - def refute_satisfied_by version, requirement + def refute_satisfied_by(version, requirement) refute req(requirement).satisfied_by?(v(version)), "#{requirement} is not satisfied by #{version}" end Index: test/rubygems/test_gem_resolver_index_set.rb =================================================================== --- test/rubygems/test_gem_resolver_index_set.rb (revision 65903) +++ test/rubygems/test_gem_resolver_index_set.rb (revision 65904) @@ -87,4 +87,3 @@ class TestGemResolverIndexSet < Gem::Tes https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_resolver_index_set.rb#L87 end end - Index: test/rubygems/test_gem_ext_rake_builder.rb =================================================================== --- test/rubygems/test_gem_ext_rake_builder.rb (revision 65903) +++ test/rubygems/test_gem_ext_rake_builder.rb (revision 65904) @@ -25,8 +25,8 @@ class TestGemExtRakeBuilder < Gem::TestC https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_ext_rake_builder.rb#L25 output = output.join "\n" refute_match %r%^rake failed:%, output - assert_match %r%^#{Regexp.escape @@ruby.shellescape} mkrf_conf\.rb%, output - assert_match %r%^#{Regexp.escape rake.shellsplit.shelljoin} RUBYARCHDIR\\=#{Regexp.escape @dest_path.shellescape} RUBYLIBDIR\\=#{Regexp.escape @dest_path.shellescape}%, output + assert_match %r%^#{Regexp.escape @@ruby} mkrf_conf\.rb%, output + assert_match %r%^#{Regexp.escape rake} RUBYARCHDIR\\=#{Regexp.escape @dest_path} RUBYLIBDIR\\=#{Regexp.escape @dest_path}%, output end end @@ -46,8 +46,8 @@ class TestGemExtRakeBuilder < Gem::TestC https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_ext_rake_builder.rb#L46 output = output.join "\n" refute_match %r%^rake failed:%, output - assert_match %r%^#{Regexp.escape @@ruby.shellescape} mkrf_conf\.rb%, output - assert_match %r%^#{Regexp.escape rake.shellsplit.shelljoin} RUBYARCHDIR\\=#{Regexp.escape @dest_path.shellescape} RUBYLIBDIR\\=#{Regexp.escape @dest_path.shellescape}%, output + assert_match %r%^#{Regexp.escape @@ruby} mkrf_conf\.rb%, output + assert_match %r%^#{Regexp.escape rake} RUBYARCHDIR\\=#{Regexp.escape @dest_path} RUBYLIBDIR\\=#{Regexp.escape @dest_path}%, output end end @@ -62,7 +62,7 @@ class TestGemExtRakeBuilder < Gem::TestC https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_ext_rake_builder.rb#L62 output = output.join "\n" refute_match %r%^rake failed:%, output - assert_match %r%^#{Regexp.escape rake.shellsplit.shelljoin} RUBYARCHDIR\\=#{Regexp.escape @dest_path.shellescape} RUBYLIBDIR\\=#{Regexp.escape @dest_path.shellescape} test1 test2%, output + assert_match %r%^#{Regexp.escape rake} RUBYARCHDIR\\=#{Regexp.escape @dest_path} RUBYLIBDIR\\=#{Regexp.escape @dest_path} test1 test2%, output end end Index: test/rubygems/test_gem_request_set_lockfile.rb =================================================================== --- test/rubygems/test_gem_request_set_lockfile.rb (revision 65903) +++ test/rubygems/test_gem_request_set_lockfile.rb (revision 65904) @@ -21,14 +21,13 @@ class TestGemRequestSetLockfile < Gem::T https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_request_set_lockfile.rb#L21 @set.instance_variable_set :@vendor_set, @vendor_set @gem_deps_file = 'gem.deps.rb' - end def lockfile Gem::RequestSet::Lockfile.build @set, @gem_deps_file end - def write_lockfile lockfile + def write_lockfile(lockfile) @lock_file = File.expand_path "#{@gem_deps_file}.lock" File.open @lock_file, 'w' do |io| Index: test/rubygems/test_gem_package_task.rb =================================================================== --- test/rubygems/test_gem_package_task.rb (revision 65903) +++ test/rubygems/test_gem_package_task.rb (revision 65904) @@ -81,4 +81,3 @@ class TestGemPackageTask < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_package_task.rb#L81 end end if defined?(Rake::PackageTask) - Index: test/rubygems/test_gem_command.rb =================================================================== --- test/rubygems/test_gem_command.rb (revision 65903) +++ test/rubygems/test_gem_command.rb (revision 65904) @@ -251,4 +251,3 @@ ERROR: Possible alternatives: non_exist https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_command.rb#L251 end end - Index: test/rubygems/test_gem_resolver_conflict.rb =================================================================== --- test/rubygems/test_gem_resolver_conflict.rb (revision 65903) +++ test/rubygems/test_gem_resolver_conflict.rb (revision 65904) @@ -85,4 +85,3 @@ class TestGemResolverConflict < Gem::Tes https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_resolver_conflict.rb#L85 end end - Index: test/rubygems/test_gem_platform.rb =================================================================== --- test/rubygems/test_gem_platform.rb (revision 65903) +++ test/rubygems/test_gem_platform.rb (revision 65904) @@ -117,7 +117,7 @@ class TestGemPlatform < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_platform.rb#L117 assert_equal expected, platform.to_a, 'i386-mswin32 VC6' ensure - if orig_RUBY_SO_NAME then + if orig_RUBY_SO_NAME RbConfig::CONFIG['RUBY_SO_NAME'] = orig_RUBY_SO_NAME else RbConfig::CONFIG.delete 'RUBY_SO_NAME' @@ -145,7 +145,7 @@ class TestGemPlatform < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_platform.rb#L145 end def test_to_s - if win_platform? then + if win_platform? assert_equal 'x86-mswin32-60', Gem::Platform.local.to_s else assert_equal 'x86-darwin-8', Gem::Platform.local.to_s @@ -297,12 +297,11 @@ class TestGemPlatform < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_platform.rb#L297 assert_local_match 'sparc-solaris2.8-mq5.3' end - def assert_local_match name + def assert_local_match(name) assert_match Gem::Platform.local, name end - def refute_local_match name + def refute_local_match(name) refute_match Gem::Platform.local, name end end - Index: test/rubygems/test_gem_validator.rb =================================================================== --- test/rubygems/test_gem_validator.rb (revision 65903) +++ test/rubygems/test_gem_validator.rb (revision 65904) @@ -43,4 +43,3 @@ class TestGemValidator < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_validator.rb#L43 end end - Index: test/rubygems/test_remote_fetch_error.rb =================================================================== --- test/rubygems/test_remote_fetch_error.rb (revision 65903) +++ test/rubygems/test_remote_fetch_error.rb (revision 65904) @@ -18,4 +18,3 @@ class TestRemoteFetchErr (... truncated) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/