rubygems-update 3.1.6 → 3.2.0.rc.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CODE_OF_CONDUCT.md +55 -19
- data/CONTRIBUTING.md +1 -2
- data/History.txt +122 -14
- data/Manifest.txt +13 -25
- data/POLICIES.md +2 -9
- data/README.md +1 -1
- data/Rakefile +31 -33
- data/bin/update_rubygems +1 -1
- data/bundler/CHANGELOG.md +806 -741
- data/bundler/README.md +6 -8
- data/bundler/UPGRADING.md +16 -30
- data/bundler/bundler.gemspec +3 -3
- data/bundler/exe/bundle +3 -0
- data/bundler/lib/bundler.rb +15 -4
- data/bundler/lib/bundler/build_metadata.rb +2 -2
- data/bundler/lib/bundler/cli.rb +32 -11
- data/bundler/lib/bundler/cli/console.rb +1 -1
- data/bundler/lib/bundler/cli/gem.rb +83 -10
- data/bundler/lib/bundler/cli/info.rb +13 -3
- data/bundler/lib/bundler/cli/init.rb +1 -1
- data/bundler/lib/bundler/cli/install.rb +5 -14
- data/bundler/lib/bundler/cli/issue.rb +2 -2
- data/bundler/lib/bundler/cli/list.rb +11 -9
- data/bundler/lib/bundler/cli/outdated.rb +88 -65
- data/bundler/lib/bundler/cli/plugin.rb +10 -0
- data/bundler/lib/bundler/cli/pristine.rb +5 -0
- data/bundler/lib/bundler/definition.rb +32 -32
- data/bundler/lib/bundler/dependency.rb +0 -9
- data/bundler/lib/bundler/dsl.rb +1 -5
- data/bundler/lib/bundler/environment_preserver.rb +26 -2
- data/bundler/lib/bundler/errors.rb +1 -0
- data/bundler/lib/bundler/feature_flag.rb +0 -2
- data/bundler/lib/bundler/fetcher.rb +1 -0
- data/bundler/lib/bundler/friendly_errors.rb +4 -10
- data/bundler/lib/bundler/gem_helper.rb +17 -10
- data/bundler/lib/bundler/gem_version_promoter.rb +1 -1
- data/bundler/lib/bundler/injector.rb +14 -3
- data/bundler/lib/bundler/inline.rb +1 -1
- data/bundler/lib/bundler/installer.rb +29 -28
- data/bundler/lib/bundler/installer/gem_installer.rb +2 -2
- data/bundler/lib/bundler/installer/parallel_installer.rb +9 -9
- data/bundler/lib/bundler/lazy_specification.rb +16 -3
- data/bundler/lib/bundler/plugin.rb +26 -0
- data/bundler/lib/bundler/plugin/index.rb +9 -0
- data/bundler/lib/bundler/psyched_yaml.rb +0 -15
- data/bundler/lib/bundler/remote_specification.rb +4 -1
- data/bundler/lib/bundler/resolver.rb +31 -8
- data/bundler/lib/bundler/resolver/spec_group.rb +26 -5
- data/bundler/lib/bundler/rubygems_ext.rb +7 -8
- data/bundler/lib/bundler/rubygems_gem_installer.rb +1 -7
- data/bundler/lib/bundler/rubygems_integration.rb +3 -48
- data/bundler/lib/bundler/runtime.rb +2 -12
- data/bundler/lib/bundler/settings.rb +0 -3
- data/bundler/lib/bundler/shared_helpers.rb +1 -1
- data/bundler/lib/bundler/source/git.rb +4 -4
- data/bundler/lib/bundler/source/git/git_proxy.rb +53 -58
- data/bundler/lib/bundler/source/path.rb +5 -1
- data/bundler/lib/bundler/source/path/installer.rb +7 -9
- data/bundler/lib/bundler/source/rubygems.rb +11 -14
- data/bundler/lib/bundler/stub_specification.rb +16 -4
- data/bundler/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +57 -47
- data/bundler/lib/bundler/templates/newgem/Gemfile.tt +9 -1
- data/bundler/lib/bundler/templates/newgem/Rakefile.tt +19 -5
- data/bundler/lib/bundler/templates/newgem/bin/console.tt +2 -0
- data/bundler/lib/bundler/templates/newgem/circleci/config.yml.tt +13 -0
- data/bundler/lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt +2 -0
- data/bundler/lib/bundler/templates/newgem/github/workflows/main.yml.tt +18 -0
- data/bundler/lib/bundler/templates/newgem/gitlab-ci.yml.tt +9 -0
- data/bundler/lib/bundler/templates/newgem/lib/newgem.rb.tt +2 -0
- data/bundler/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +2 -0
- data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +6 -4
- data/bundler/lib/bundler/templates/newgem/rubocop.yml.tt +10 -0
- data/bundler/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +2 -0
- data/bundler/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +2 -0
- data/bundler/lib/bundler/templates/newgem/test/{newgem_test.rb.tt → minitest/newgem_test.rb.tt} +2 -0
- data/bundler/lib/bundler/templates/newgem/test/{test_helper.rb.tt → minitest/test_helper.rb.tt} +2 -0
- data/bundler/lib/bundler/templates/newgem/test/test-unit/newgem_test.rb.tt +15 -0
- data/bundler/lib/bundler/templates/newgem/test/test-unit/test_helper.rb.tt +6 -0
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +75 -189
- data/bundler/lib/bundler/vendor/thor/lib/thor.rb +0 -7
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +2 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/base.rb +9 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/bundler/lib/bundler/version.rb +1 -1
- data/bundler/man/bundle-add.1 +1 -1
- data/bundler/man/bundle-add.1.txt +15 -15
- data/bundler/man/bundle-binstubs.1 +1 -1
- data/bundler/man/bundle-binstubs.1.txt +10 -10
- data/bundler/man/bundle-cache.1 +1 -1
- data/bundler/man/bundle-cache.1.txt +15 -15
- data/bundler/man/bundle-check.1 +1 -1
- data/bundler/man/bundle-check.1.txt +8 -8
- data/bundler/man/bundle-clean.1 +1 -1
- data/bundler/man/bundle-clean.1.txt +6 -6
- data/bundler/man/bundle-config.1 +3 -9
- data/bundler/man/bundle-config.1.txt +271 -272
- data/bundler/man/bundle-config.ronn +5 -9
- data/bundler/man/bundle-doctor.1 +1 -1
- data/bundler/man/bundle-doctor.1.txt +9 -9
- data/bundler/man/bundle-exec.1 +1 -1
- data/bundler/man/bundle-exec.1.txt +84 -81
- data/bundler/man/bundle-gem.1 +25 -3
- data/bundler/man/bundle-gem.1.txt +65 -39
- data/bundler/man/bundle-gem.ronn +30 -7
- data/bundler/man/bundle-info.1 +1 -1
- data/bundler/man/bundle-info.1.txt +2 -2
- data/bundler/man/bundle-init.1 +1 -1
- data/bundler/man/bundle-init.1.txt +9 -9
- data/bundler/man/bundle-inject.1 +1 -1
- data/bundler/man/bundle-inject.1.txt +4 -4
- data/bundler/man/bundle-install.1 +1 -1
- data/bundler/man/bundle-install.1.txt +169 -169
- data/bundler/man/bundle-list.1 +7 -7
- data/bundler/man/bundle-list.1.txt +12 -11
- data/bundler/man/bundle-list.ronn +6 -6
- data/bundler/man/bundle-lock.1 +1 -1
- data/bundler/man/bundle-lock.1.txt +28 -28
- data/bundler/man/bundle-open.1 +1 -1
- data/bundler/man/bundle-open.1.txt +3 -3
- data/bundler/man/bundle-outdated.1 +1 -1
- data/bundler/man/bundle-outdated.1.txt +34 -34
- data/bundler/man/bundle-platform.1 +1 -1
- data/bundler/man/bundle-platform.1.txt +16 -16
- data/bundler/man/bundle-pristine.1 +1 -1
- data/bundler/man/bundle-pristine.1.txt +8 -8
- data/bundler/man/bundle-remove.1 +1 -1
- data/bundler/man/bundle-remove.1.txt +9 -9
- data/bundler/man/bundle-show.1 +1 -1
- data/bundler/man/bundle-show.1.txt +8 -8
- data/bundler/man/bundle-update.1 +1 -1
- data/bundler/man/bundle-update.1.txt +149 -148
- data/bundler/man/bundle-viz.1 +1 -1
- data/bundler/man/bundle-viz.1.txt +11 -11
- data/bundler/man/bundle.1 +1 -1
- data/bundler/man/bundle.1.txt +31 -31
- data/bundler/man/gemfile.5 +1 -1
- data/bundler/man/gemfile.5.txt +218 -216
- data/lib/rubygems.rb +68 -148
- data/lib/rubygems/available_set.rb +4 -4
- data/lib/rubygems/basic_specification.rb +11 -5
- data/lib/rubygems/bundler_version_finder.rb +14 -9
- data/lib/rubygems/command.rb +16 -14
- data/lib/rubygems/command_manager.rb +4 -3
- data/lib/rubygems/commands/cert_command.rb +1 -1
- data/lib/rubygems/commands/cleanup_command.rb +3 -3
- data/lib/rubygems/commands/contents_command.rb +4 -4
- data/lib/rubygems/commands/dependency_command.rb +6 -6
- data/lib/rubygems/commands/fetch_command.rb +2 -2
- data/lib/rubygems/commands/help_command.rb +1 -1
- data/lib/rubygems/commands/info_command.rb +9 -4
- data/lib/rubygems/commands/install_command.rb +3 -3
- data/lib/rubygems/commands/list_command.rb +9 -6
- data/lib/rubygems/commands/lock_command.rb +1 -1
- data/lib/rubygems/commands/open_command.rb +0 -2
- data/lib/rubygems/commands/pristine_command.rb +10 -2
- data/lib/rubygems/commands/push_command.rb +4 -42
- data/lib/rubygems/commands/query_command.rb +7 -352
- data/lib/rubygems/commands/search_command.rb +8 -6
- data/lib/rubygems/commands/setup_command.rb +128 -32
- data/lib/rubygems/commands/specification_command.rb +2 -2
- data/lib/rubygems/commands/stale_command.rb +1 -1
- data/lib/rubygems/commands/uninstall_command.rb +1 -1
- data/lib/rubygems/commands/unpack_command.rb +1 -1
- data/lib/rubygems/commands/update_command.rb +40 -10
- data/lib/rubygems/config_file.rb +11 -2
- data/lib/rubygems/core_ext/kernel_require.rb +2 -2
- data/lib/rubygems/defaults.rb +99 -5
- data/lib/rubygems/dependency.rb +2 -5
- data/lib/rubygems/dependency_installer.rb +1 -73
- data/lib/rubygems/dependency_list.rb +7 -7
- data/lib/rubygems/deprecate.rb +46 -1
- data/lib/rubygems/doctor.rb +4 -2
- data/lib/rubygems/errors.rb +3 -2
- data/lib/rubygems/exceptions.rb +2 -13
- data/lib/rubygems/ext.rb +6 -6
- data/lib/rubygems/ext/build_error.rb +2 -0
- data/lib/rubygems/ext/builder.rb +1 -1
- data/lib/rubygems/ext/cmake_builder.rb +1 -1
- data/lib/rubygems/ext/ext_conf_builder.rb +6 -7
- data/lib/rubygems/gem_runner.rb +3 -8
- data/lib/rubygems/gemcutter_utilities.rb +1 -1
- data/lib/rubygems/indexer.rb +1 -19
- data/lib/rubygems/install_update_options.rb +5 -5
- data/lib/rubygems/installer.rb +45 -42
- data/lib/rubygems/installer_test_case.rb +19 -2
- data/lib/rubygems/installer_uninstaller_utils.rb +24 -0
- data/lib/rubygems/local_remote_options.rb +1 -1
- data/lib/rubygems/name_tuple.rb +2 -4
- data/lib/rubygems/package.rb +8 -13
- data/lib/rubygems/package/old.rb +1 -1
- data/lib/rubygems/package/tar_header.rb +3 -3
- data/lib/rubygems/package/tar_reader.rb +0 -1
- data/lib/rubygems/package/tar_reader/entry.rb +0 -1
- data/lib/rubygems/package/tar_test_case.rb +1 -1
- data/lib/rubygems/package/tar_writer.rb +2 -6
- data/lib/rubygems/package_task.rb +1 -5
- data/lib/rubygems/path_support.rb +1 -1
- data/lib/rubygems/platform.rb +3 -3
- data/lib/rubygems/query_utils.rb +362 -0
- data/lib/rubygems/rdoc.rb +0 -12
- data/lib/rubygems/remote_fetcher.rb +5 -19
- data/lib/rubygems/request/connection_pools.rb +1 -1
- data/lib/rubygems/request_set.rb +5 -5
- data/lib/rubygems/request_set/gem_dependency_api.rb +1 -1
- data/lib/rubygems/request_set/lockfile.rb +8 -8
- data/lib/rubygems/request_set/lockfile/tokenizer.rb +1 -1
- data/lib/rubygems/requirement.rb +14 -15
- data/lib/rubygems/resolver.rb +7 -8
- data/lib/rubygems/resolver/api_set.rb +3 -3
- data/lib/rubygems/resolver/composed_set.rb +3 -3
- data/lib/rubygems/resolver/conflict.rb +1 -1
- data/lib/rubygems/resolver/index_set.rb +1 -1
- data/lib/rubygems/resolver/installer_set.rb +3 -3
- data/lib/rubygems/resolver/lock_set.rb +1 -1
- data/lib/rubygems/safe_yaml.rb +4 -4
- data/lib/rubygems/security.rb +25 -25
- data/lib/rubygems/security/policy.rb +3 -3
- data/lib/rubygems/security/signer.rb +4 -4
- data/lib/rubygems/security/trust_dir.rb +1 -1
- data/lib/rubygems/server.rb +8 -8
- data/lib/rubygems/source/git.rb +7 -6
- data/lib/rubygems/source/local.rb +2 -2
- data/lib/rubygems/source_list.rb +4 -5
- data/lib/rubygems/spec_fetcher.rb +18 -15
- data/lib/rubygems/specification.rb +79 -104
- data/lib/rubygems/specification_policy.rb +79 -27
- data/lib/rubygems/ssl_certs/{rubygems.org → index.rubygems.org}/GlobalSignRootCA.pem +0 -0
- data/lib/rubygems/ssl_certs/rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem +23 -0
- data/lib/rubygems/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem +25 -0
- data/lib/rubygems/test_case.rb +63 -83
- data/lib/rubygems/test_utilities.rb +6 -6
- data/lib/rubygems/uninstaller.rb +35 -14
- data/lib/rubygems/user_interaction.rb +1 -10
- data/lib/rubygems/util.rb +10 -2
- data/lib/rubygems/util/licenses.rb +4 -4
- data/lib/rubygems/validator.rb +1 -1
- data/lib/rubygems/version.rb +4 -4
- data/rubygems-update.gemspec +2 -2
- data/setup.rb +2 -7
- data/test/rubygems/specifications/bar-0.0.2.gemspec +0 -2
- data/test/rubygems/specifications/rubyforge-0.0.1.gemspec +0 -2
- data/test/rubygems/test_bundled_ca.rb +4 -12
- data/test/rubygems/test_deprecate.rb +43 -4
- data/test/rubygems/test_gem.rb +79 -74
- data/test/rubygems/test_gem_available_set.rb +3 -3
- data/test/rubygems/test_gem_bundler_version_finder.rb +19 -1
- data/test/rubygems/test_gem_command.rb +24 -3
- data/test/rubygems/test_gem_command_manager.rb +37 -4
- data/test/rubygems/test_gem_commands_build_command.rb +7 -2
- data/test/rubygems/test_gem_commands_cert_command.rb +2 -2
- data/test/rubygems/test_gem_commands_cleanup_command.rb +1 -1
- data/test/rubygems/test_gem_commands_contents_command.rb +48 -15
- data/test/rubygems/test_gem_commands_environment_command.rb +21 -21
- data/test/rubygems/test_gem_commands_generate_index_command.rb +1 -5
- data/test/rubygems/test_gem_commands_info_command.rb +6 -6
- data/test/rubygems/test_gem_commands_install_command.rb +31 -31
- data/test/rubygems/test_gem_commands_mirror.rb +1 -1
- data/test/rubygems/test_gem_commands_open_command.rb +4 -4
- data/test/rubygems/test_gem_commands_owner_command.rb +11 -3
- data/test/rubygems/test_gem_commands_pristine_command.rb +41 -8
- data/test/rubygems/test_gem_commands_push_command.rb +7 -2
- data/test/rubygems/test_gem_commands_query_command.rb +9 -5
- data/test/rubygems/test_gem_commands_setup_command.rb +160 -108
- data/test/rubygems/test_gem_commands_signin_command.rb +6 -4
- data/test/rubygems/test_gem_commands_signout_command.rb +0 -5
- data/test/rubygems/test_gem_commands_specification_command.rb +18 -18
- data/test/rubygems/test_gem_commands_uninstall_command.rb +1 -1
- data/test/rubygems/test_gem_commands_update_command.rb +68 -5
- data/test/rubygems/test_gem_commands_which_command.rb +3 -3
- data/test/rubygems/test_gem_commands_yank_command.rb +14 -6
- data/test/rubygems/test_gem_config_file.rb +7 -10
- data/test/rubygems/test_gem_dependency_installer.rb +52 -189
- data/test/rubygems/test_gem_dependency_list.rb +8 -8
- data/test/rubygems/test_gem_dependency_resolution_error.rb +1 -1
- data/test/rubygems/test_gem_doctor.rb +28 -0
- data/test/rubygems/test_gem_ext_builder.rb +14 -25
- data/test/rubygems/test_gem_ext_cmake_builder.rb +13 -12
- data/test/rubygems/test_gem_ext_configure_builder.rb +1 -9
- data/test/rubygems/test_gem_ext_ext_conf_builder.rb +0 -1
- data/test/rubygems/test_gem_ext_rake_builder.rb +9 -9
- data/test/rubygems/test_gem_gem_runner.rb +42 -0
- data/test/rubygems/test_gem_gemcutter_utilities.rb +5 -0
- data/test/rubygems/test_gem_indexer.rb +9 -13
- data/test/rubygems/test_gem_installer.rb +149 -45
- data/test/rubygems/test_gem_package.rb +13 -12
- data/test/rubygems/test_gem_package_tar_header.rb +19 -0
- data/test/rubygems/test_gem_package_tar_writer.rb +3 -3
- data/test/rubygems/test_gem_package_task.rb +46 -11
- data/test/rubygems/test_gem_remote_fetcher.rb +152 -190
- data/test/rubygems/test_gem_request.rb +11 -11
- data/test/rubygems/test_gem_request_set.rb +20 -20
- data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +3 -3
- data/test/rubygems/test_gem_request_set_lockfile_parser.rb +9 -9
- data/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb +118 -118
- data/test/rubygems/test_gem_requirement.rb +2 -2
- data/test/rubygems/test_gem_resolver.rb +6 -6
- data/test/rubygems/test_gem_resolver_api_set.rb +3 -3
- data/test/rubygems/test_gem_resolver_best_set.rb +2 -2
- data/test/rubygems/test_gem_resolver_index_set.rb +2 -2
- data/test/rubygems/test_gem_resolver_installer_set.rb +7 -7
- data/test/rubygems/test_gem_resolver_lock_set.rb +3 -3
- data/test/rubygems/test_gem_security.rb +20 -20
- data/test/rubygems/test_gem_security_policy.rb +5 -8
- data/test/rubygems/test_gem_security_signer.rb +8 -8
- data/test/rubygems/test_gem_security_trust_dir.rb +2 -2
- data/test/rubygems/test_gem_server.rb +10 -10
- data/test/rubygems/test_gem_source.rb +12 -14
- data/test/rubygems/test_gem_source_git.rb +12 -11
- data/test/rubygems/test_gem_source_installed.rb +7 -7
- data/test/rubygems/test_gem_source_local.rb +8 -8
- data/test/rubygems/test_gem_source_lock.rb +10 -10
- data/test/rubygems/test_gem_source_specific_file.rb +7 -7
- data/test/rubygems/test_gem_source_vendor.rb +7 -7
- data/test/rubygems/test_gem_spec_fetcher.rb +11 -2
- data/test/rubygems/test_gem_specification.rb +143 -113
- data/test/rubygems/test_gem_stream_ui.rb +3 -1
- data/test/rubygems/test_gem_text.rb +1 -1
- data/test/rubygems/test_gem_uninstaller.rb +134 -10
- data/test/rubygems/test_gem_util.rb +7 -5
- data/test/rubygems/test_gem_version.rb +1 -1
- data/test/rubygems/test_kernel.rb +10 -12
- data/test/rubygems/test_project_sanity.rb +8 -1
- data/test/rubygems/test_require.rb +141 -43
- metadata +32 -45
- data/.bundle/config +0 -2
- data/.rubocop.yml +0 -91
- data/Gemfile +0 -8
- data/Gemfile.lock +0 -43
- data/bundler/CODE_OF_CONDUCT.md +0 -136
- data/lib/rubygems/source_local.rb +0 -7
- data/lib/rubygems/source_specific_file.rb +0 -6
- data/lib/rubygems/ssl_certs/rubygems.org/GlobalSignRootCA_R3.pem +0 -21
- data/lib/ubygems.rb +0 -14
- data/tmp/.keep +0 -0
- data/util/CL2notes +0 -55
- data/util/bisect +0 -10
- data/util/ci.sh +0 -62
- data/util/cops/deprecations.rb +0 -52
- data/util/create_certs.rb +0 -171
- data/util/create_certs.sh +0 -27
- data/util/create_encrypted_key.rb +0 -16
- data/util/generate_spdx_license_list.rb +0 -63
- data/util/patch_with_prs.rb +0 -77
- data/util/rubocop +0 -8
- data/util/update_bundled_ca_certificates.rb +0 -137
- data/util/update_changelog.rb +0 -64
@@ -26,7 +26,7 @@ class TestGemCommandsOpenCommand < Gem::TestCase
|
|
26
26
|
|
27
27
|
gem 'foo', '1.0.0'
|
28
28
|
spec = gem 'foo', '1.0.1'
|
29
|
-
mock =
|
29
|
+
mock = Minitest::Mock.new
|
30
30
|
mock.expect(:call, true, [spec.full_gem_path])
|
31
31
|
|
32
32
|
Dir.stub(:chdir, mock) do
|
@@ -51,7 +51,7 @@ class TestGemCommandsOpenCommand < Gem::TestCase
|
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
|
-
assert_match %r
|
54
|
+
assert_match %r{Unable to find gem 'foo'}, @ui.output
|
55
55
|
assert_equal "", @ui.error
|
56
56
|
end
|
57
57
|
|
@@ -64,7 +64,7 @@ class TestGemCommandsOpenCommand < Gem::TestCase
|
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
67
|
-
assert_match %r
|
67
|
+
assert_match %r{Unable to find gem 'foo'}, @ui.output
|
68
68
|
assert_equal "", @ui.error
|
69
69
|
end
|
70
70
|
|
@@ -93,7 +93,7 @@ class TestGemCommandsOpenCommand < Gem::TestCase
|
|
93
93
|
end
|
94
94
|
end
|
95
95
|
|
96
|
-
assert_match %r
|
96
|
+
assert_match %r{'foo' is a default gem and can't be opened\.} , @ui.output
|
97
97
|
assert_equal "", @ui.error
|
98
98
|
end
|
99
99
|
|
@@ -7,6 +7,8 @@ class TestGemCommandsOwnerCommand < Gem::TestCase
|
|
7
7
|
def setup
|
8
8
|
super
|
9
9
|
|
10
|
+
credential_setup
|
11
|
+
|
10
12
|
ENV["RUBYGEMS_HOST"] = nil
|
11
13
|
@stub_ui = Gem::MockGemUi.new
|
12
14
|
@stub_fetcher = Gem::FakeFetcher.new
|
@@ -17,6 +19,12 @@ class TestGemCommandsOwnerCommand < Gem::TestCase
|
|
17
19
|
@cmd = Gem::Commands::OwnerCommand.new
|
18
20
|
end
|
19
21
|
|
22
|
+
def teardown
|
23
|
+
credential_teardown
|
24
|
+
|
25
|
+
super
|
26
|
+
end
|
27
|
+
|
20
28
|
def test_show_owners
|
21
29
|
response = <<EOF
|
22
30
|
---
|
@@ -119,7 +127,7 @@ EOF
|
|
119
127
|
end
|
120
128
|
Gem.configuration.load_api_keys
|
121
129
|
|
122
|
-
@cmd.handle_options %w
|
130
|
+
@cmd.handle_options %w[-k other]
|
123
131
|
@cmd.show_owners('freewill')
|
124
132
|
|
125
133
|
assert_equal '701229f217cdf23b1344c7b4b54ca97', @stub_fetcher.last_request['Authorization']
|
@@ -177,7 +185,7 @@ EOF
|
|
177
185
|
end
|
178
186
|
Gem.configuration.load_api_keys
|
179
187
|
|
180
|
-
@cmd.handle_options %w
|
188
|
+
@cmd.handle_options %w[-k other]
|
181
189
|
@cmd.add_owners('freewill', ['user-new1@example.com'])
|
182
190
|
|
183
191
|
assert_equal '701229f217cdf23b1344c7b4b54ca97', @stub_fetcher.last_request['Authorization']
|
@@ -217,7 +225,7 @@ EOF
|
|
217
225
|
end
|
218
226
|
Gem.configuration.load_api_keys
|
219
227
|
|
220
|
-
@cmd.handle_options %w
|
228
|
+
@cmd.handle_options %w[-k other]
|
221
229
|
@cmd.remove_owners('freewill', ['user-remove1@example.com'])
|
222
230
|
|
223
231
|
assert_equal '701229f217cdf23b1344c7b4b54ca97', @stub_fetcher.last_request['Authorization']
|
@@ -160,11 +160,9 @@ class TestGemCommandsPristineCommand < Gem::TestCase
|
|
160
160
|
|
161
161
|
ruby_exec = sprintf Gem.default_exec_format, 'ruby'
|
162
162
|
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
assert_match %r%\A#!\s*/usr/bin/env #{ruby_exec}%, File.read(gem_exec)
|
167
|
-
end
|
163
|
+
bin_env = win_platform? ? "" : %w[/usr/bin/env /bin/env].find {|f| File.executable?(f) } + " "
|
164
|
+
|
165
|
+
assert_match %r{\A#!\s*#{bin_env}#{ruby_exec}}, File.read(gem_exec)
|
168
166
|
end
|
169
167
|
|
170
168
|
def test_execute_extensions_explicit
|
@@ -215,7 +213,6 @@ class TestGemCommandsPristineCommand < Gem::TestCase
|
|
215
213
|
io.write "# extconf.rb\nrequire 'mkmf'; create_makefile 'a'"
|
216
214
|
end
|
217
215
|
|
218
|
-
util_build_gem a
|
219
216
|
install_gem a
|
220
217
|
|
221
218
|
@cmd.options[:args] = %w[a]
|
@@ -249,7 +246,7 @@ class TestGemCommandsPristineCommand < Gem::TestCase
|
|
249
246
|
RUBY
|
250
247
|
end
|
251
248
|
|
252
|
-
build_args = %w
|
249
|
+
build_args = %w[--with-awesome=true --sweet]
|
253
250
|
|
254
251
|
install_gem a, :build_args => build_args
|
255
252
|
|
@@ -458,7 +455,7 @@ class TestGemCommandsPristineCommand < Gem::TestCase
|
|
458
455
|
end
|
459
456
|
end
|
460
457
|
|
461
|
-
assert_match %r
|
458
|
+
assert_match %r{at least one gem name}, e.message
|
462
459
|
end
|
463
460
|
|
464
461
|
def test_execute_only_executables
|
@@ -491,6 +488,42 @@ class TestGemCommandsPristineCommand < Gem::TestCase
|
|
491
488
|
refute File.exist? gem_lib
|
492
489
|
end
|
493
490
|
|
491
|
+
def test_execute_only_plugins
|
492
|
+
a = util_spec 'a' do |s|
|
493
|
+
s.executables = %w[foo]
|
494
|
+
s.files = %w[bin/foo lib/a.rb lib/rubygems_plugin.rb]
|
495
|
+
end
|
496
|
+
write_file File.join(@tempdir, 'lib', 'a.rb') do |fp|
|
497
|
+
fp.puts "puts __FILE__"
|
498
|
+
end
|
499
|
+
write_file File.join(@tempdir, 'lib', 'rubygems_plugin.rb') do |fp|
|
500
|
+
fp.puts "puts __FILE__"
|
501
|
+
end
|
502
|
+
write_file File.join(@tempdir, 'bin', 'foo') do |fp|
|
503
|
+
fp.puts "#!/usr/bin/ruby"
|
504
|
+
end
|
505
|
+
|
506
|
+
install_gem a
|
507
|
+
|
508
|
+
gem_lib = File.join @gemhome, 'gems', a.full_name, 'lib', 'a.rb'
|
509
|
+
gem_plugin = File.join @gemhome, 'plugins', 'a_plugin.rb'
|
510
|
+
gem_exec = File.join @gemhome, 'bin', 'foo'
|
511
|
+
|
512
|
+
FileUtils.rm gem_exec
|
513
|
+
FileUtils.rm gem_plugin
|
514
|
+
FileUtils.rm gem_lib
|
515
|
+
|
516
|
+
@cmd.handle_options %w[--all --only-plugins]
|
517
|
+
|
518
|
+
use_ui @ui do
|
519
|
+
@cmd.execute
|
520
|
+
end
|
521
|
+
|
522
|
+
refute File.exist? gem_exec
|
523
|
+
assert File.exist? gem_plugin
|
524
|
+
refute File.exist? gem_lib
|
525
|
+
end
|
526
|
+
|
494
527
|
def test_execute_bindir
|
495
528
|
a = util_spec 'a' do |s|
|
496
529
|
s.name = "test_gem"
|
@@ -6,6 +6,9 @@ class TestGemCommandsPushCommand < Gem::TestCase
|
|
6
6
|
|
7
7
|
def setup
|
8
8
|
super
|
9
|
+
|
10
|
+
credential_setup
|
11
|
+
|
9
12
|
ENV["RUBYGEMS_HOST"] = nil
|
10
13
|
Gem.host = Gem::DEFAULT_HOST
|
11
14
|
Gem.configuration.disable_default_gem_server = false
|
@@ -37,6 +40,8 @@ class TestGemCommandsPushCommand < Gem::TestCase
|
|
37
40
|
end
|
38
41
|
|
39
42
|
def teardown
|
43
|
+
credential_teardown
|
44
|
+
|
40
45
|
super
|
41
46
|
|
42
47
|
singleton_gem_class.class_eval do
|
@@ -246,7 +251,7 @@ class TestGemCommandsPushCommand < Gem::TestCase
|
|
246
251
|
spec.metadata['allowed_push_host'] = "https://privategemserver.example"
|
247
252
|
end
|
248
253
|
|
249
|
-
response = %
|
254
|
+
response = %(ERROR: "#{@host}" is not allowed by the gemspec, which only allows "https://privategemserver.example")
|
250
255
|
|
251
256
|
assert_raises Gem::MockGemUi::TermError do
|
252
257
|
send_battery
|
@@ -355,7 +360,7 @@ class TestGemCommandsPushCommand < Gem::TestCase
|
|
355
360
|
end
|
356
361
|
Gem.configuration.load_api_keys
|
357
362
|
|
358
|
-
@cmd.handle_options %w
|
363
|
+
@cmd.handle_options %w[-k other]
|
359
364
|
@cmd.instance_variable_set :@host, @host
|
360
365
|
@cmd.send_gem(@path)
|
361
366
|
|
@@ -580,8 +580,8 @@ pl (1 i386-linux)
|
|
580
580
|
@cmd.execute
|
581
581
|
end
|
582
582
|
|
583
|
-
assert_match %r
|
584
|
-
assert_match %r
|
583
|
+
assert_match %r{^a }, @stub_ui.output
|
584
|
+
assert_match %r{^pl }, @stub_ui.output
|
585
585
|
assert_equal '', @stub_ui.error
|
586
586
|
end
|
587
587
|
|
@@ -593,8 +593,8 @@ pl (1 i386-linux)
|
|
593
593
|
@cmd.send :show_gems, /a/i
|
594
594
|
end
|
595
595
|
|
596
|
-
assert_match %r
|
597
|
-
refute_match %r
|
596
|
+
assert_match %r{^a }, @stub_ui.output
|
597
|
+
refute_match %r{^pl }, @stub_ui.output
|
598
598
|
assert_empty @stub_ui.error
|
599
599
|
end
|
600
600
|
|
@@ -644,7 +644,7 @@ a (2 universal-darwin, 1 ruby x86-linux)
|
|
644
644
|
end
|
645
645
|
|
646
646
|
def test_execute_show_default_gems
|
647
|
-
spec_fetcher {
|
647
|
+
spec_fetcher {|fetcher| fetcher.spec 'a', 2 }
|
648
648
|
|
649
649
|
a1 = new_default_spec 'a', 1
|
650
650
|
install_default_specs a1
|
@@ -844,6 +844,10 @@ othergem (1.2.3)
|
|
844
844
|
assert_equal expected, @stub_ui.output
|
845
845
|
end
|
846
846
|
|
847
|
+
def test_depprecated
|
848
|
+
assert @cmd.deprecated?
|
849
|
+
end
|
850
|
+
|
847
851
|
private
|
848
852
|
|
849
853
|
def add_gems_to_fetcher
|
@@ -1,4 +1,3 @@
|
|
1
|
-
# coding: UTF-8
|
2
1
|
# frozen_string_literal: true
|
3
2
|
|
4
3
|
require 'rubygems/test_case'
|
@@ -20,41 +19,23 @@ class TestGemCommandsSetupCommand < Gem::TestCase
|
|
20
19
|
@cmd = Gem::Commands::SetupCommand.new
|
21
20
|
@cmd.options[:prefix] = @install_dir
|
22
21
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
end
|
41
|
-
|
42
|
-
FileUtils.mkdir_p 'bundler/exe'
|
43
|
-
FileUtils.mkdir_p 'bundler/lib/bundler'
|
44
|
-
|
45
|
-
File.open 'bundler/exe/bundle', 'w' do |io|
|
46
|
-
io.puts '# bundle'
|
47
|
-
end
|
48
|
-
|
49
|
-
File.open 'bundler/lib/bundler.rb', 'w' do |io|
|
50
|
-
io.puts '# bundler.rb'
|
51
|
-
end
|
52
|
-
|
53
|
-
File.open 'bundler/lib/bundler/b.rb', 'w' do |io|
|
54
|
-
io.puts '# b.rb'
|
55
|
-
end
|
56
|
-
|
57
|
-
FileUtils.mkdir_p 'default/gems'
|
22
|
+
filelist = %w[
|
23
|
+
bin/gem
|
24
|
+
lib/rubygems.rb
|
25
|
+
lib/rubygems/test_case.rb
|
26
|
+
lib/rubygems/ssl_certs/rubygems.org/foo.pem
|
27
|
+
bundler/exe/bundle
|
28
|
+
bundler/lib/bundler.rb
|
29
|
+
bundler/lib/bundler/b.rb
|
30
|
+
bundler/lib/bundler/templates/.circleci/config.yml
|
31
|
+
bundler/lib/bundler/templates/.travis.yml
|
32
|
+
bundler/man/bundle-b.1
|
33
|
+
bundler/man/bundle-b.1.txt
|
34
|
+
bundler/man/gemfile.5
|
35
|
+
bundler/man/gemfile.5.txt
|
36
|
+
]
|
37
|
+
|
38
|
+
create_dummy_files(filelist)
|
58
39
|
|
59
40
|
gemspec = Gem::Specification.new
|
60
41
|
gemspec.author = "Us"
|
@@ -63,7 +44,7 @@ class TestGemCommandsSetupCommand < Gem::TestCase
|
|
63
44
|
gemspec.bindir = "exe"
|
64
45
|
gemspec.executables = ["bundle"]
|
65
46
|
|
66
|
-
File.open 'bundler/bundler.gemspec',
|
47
|
+
File.open 'bundler/bundler.gemspec', 'w' do |io|
|
67
48
|
io.puts gemspec.to_ruby
|
68
49
|
end
|
69
50
|
|
@@ -72,30 +53,13 @@ class TestGemCommandsSetupCommand < Gem::TestCase
|
|
72
53
|
io.puts gemspec.to_ruby
|
73
54
|
end
|
74
55
|
|
75
|
-
|
56
|
+
spec_fetcher do |fetcher|
|
57
|
+
fetcher.download "bundler", "1.15.4"
|
76
58
|
|
77
|
-
|
78
|
-
io.puts "# bundler-#{BUNDLER_VERS}"
|
79
|
-
end
|
59
|
+
fetcher.gem "bundler", BUNDLER_VERS
|
80
60
|
|
81
|
-
|
82
|
-
io.puts '# bundler-audit'
|
83
|
-
end
|
84
|
-
|
85
|
-
FileUtils.mkdir_p 'default/gems/bundler-1.15.4'
|
86
|
-
FileUtils.mkdir_p 'default/gems/bundler-audit-1.0.0'
|
87
|
-
end
|
88
|
-
|
89
|
-
def gem_install(name)
|
90
|
-
gem = util_spec name do |s|
|
91
|
-
s.executables = [name]
|
92
|
-
s.files = %W[bin/#{name}]
|
93
|
-
end
|
94
|
-
write_file File.join @tempdir, 'bin', name do |f|
|
95
|
-
f.puts '#!/usr/bin/ruby'
|
61
|
+
fetcher.gem "bundler-audit", "1.0.0"
|
96
62
|
end
|
97
|
-
install_gem gem
|
98
|
-
File.join @gemhome, 'bin', name
|
99
63
|
end
|
100
64
|
|
101
65
|
def test_execute_regenerate_binstubs
|
@@ -123,7 +87,46 @@ class TestGemCommandsSetupCommand < Gem::TestCase
|
|
123
87
|
assert_equal "I changed it!\n", File.read(gem_bin_path)
|
124
88
|
end
|
125
89
|
|
90
|
+
def test_execute_regenerate_plugins
|
91
|
+
gem_plugin_path = gem_install_with_plugin 'a'
|
92
|
+
write_file gem_plugin_path do |io|
|
93
|
+
io.puts 'I changed it!'
|
94
|
+
end
|
95
|
+
|
96
|
+
@cmd.options[:document] = []
|
97
|
+
@cmd.execute
|
98
|
+
|
99
|
+
assert_match %r{\Arequire}, File.read(gem_plugin_path)
|
100
|
+
end
|
101
|
+
|
102
|
+
def test_execute_no_regenerate_plugins
|
103
|
+
gem_plugin_path = gem_install_with_plugin 'a'
|
104
|
+
write_file gem_plugin_path do |io|
|
105
|
+
io.puts 'I changed it!'
|
106
|
+
end
|
107
|
+
|
108
|
+
@cmd.options[:document] = []
|
109
|
+
@cmd.options[:regenerate_plugins] = false
|
110
|
+
@cmd.execute
|
111
|
+
|
112
|
+
assert_equal "I changed it!\n", File.read(gem_plugin_path)
|
113
|
+
end
|
114
|
+
|
115
|
+
def test_execute_regenerate_plugins_creates_plugins_dir_if_not_there
|
116
|
+
gem_plugin_path = gem_install_with_plugin 'a'
|
117
|
+
|
118
|
+
# Simulate gem installed with an older rubygems without a plugins layout
|
119
|
+
FileUtils.rm_rf Gem.plugindir
|
120
|
+
|
121
|
+
@cmd.options[:document] = []
|
122
|
+
@cmd.execute
|
123
|
+
|
124
|
+
assert_match %r{\Arequire}, File.read(gem_plugin_path)
|
125
|
+
end
|
126
|
+
|
126
127
|
def test_execute_informs_about_installed_executables
|
128
|
+
@cmd.options[:document] = []
|
129
|
+
|
127
130
|
use_ui @ui do
|
128
131
|
@cmd.execute
|
129
132
|
end
|
@@ -147,15 +150,10 @@ class TestGemCommandsSetupCommand < Gem::TestCase
|
|
147
150
|
|
148
151
|
ruby_exec = sprintf Gem.default_exec_format, 'ruby'
|
149
152
|
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
else
|
155
|
-
assert_match %r%\A#!/usr/bin/env #{ruby_exec}%, File.read(default_gem_bin_path)
|
156
|
-
assert_match %r%\A#!/usr/bin/env #{ruby_exec}%, File.read(default_bundle_bin_path)
|
157
|
-
assert_match %r%\A#!/usr/bin/env #{ruby_exec}%, File.read(gem_bin_path)
|
158
|
-
end
|
153
|
+
bin_env = win_platform? ? "" : %w[/usr/bin/env /bin/env].find {|f| File.executable?(f) } + " "
|
154
|
+
assert_match %r{\A#!\s*#{bin_env}#{ruby_exec}}, File.read(default_gem_bin_path)
|
155
|
+
assert_match %r{\A#!\s*#{bin_env}#{ruby_exec}}, File.read(default_bundle_bin_path)
|
156
|
+
assert_match %r{\A#!\s*#{bin_env}#{ruby_exec}}, File.read(gem_bin_path)
|
159
157
|
end
|
160
158
|
|
161
159
|
def test_pem_files_in
|
@@ -168,6 +166,16 @@ class TestGemCommandsSetupCommand < Gem::TestCase
|
|
168
166
|
@cmd.rb_files_in('lib').sort
|
169
167
|
end
|
170
168
|
|
169
|
+
def test_bundler_man1_files_in
|
170
|
+
assert_equal %w[bundle-b.1 bundle-b.1.txt],
|
171
|
+
@cmd.bundler_man1_files_in('bundler/man').sort
|
172
|
+
end
|
173
|
+
|
174
|
+
def test_bundler_man5_files_in
|
175
|
+
assert_equal %w[gemfile.5 gemfile.5.txt],
|
176
|
+
@cmd.bundler_man5_files_in('bundler/man').sort
|
177
|
+
end
|
178
|
+
|
171
179
|
def test_install_lib
|
172
180
|
@cmd.extend FileUtils
|
173
181
|
|
@@ -179,6 +187,22 @@ class TestGemCommandsSetupCommand < Gem::TestCase
|
|
179
187
|
|
180
188
|
assert_path_exists File.join(dir, 'bundler.rb')
|
181
189
|
assert_path_exists File.join(dir, 'bundler/b.rb')
|
190
|
+
|
191
|
+
assert_path_exists File.join(dir, 'bundler/templates/.circleci/config.yml')
|
192
|
+
assert_path_exists File.join(dir, 'bundler/templates/.travis.yml')
|
193
|
+
end
|
194
|
+
end
|
195
|
+
|
196
|
+
def test_install_man
|
197
|
+
@cmd.extend FileUtils
|
198
|
+
|
199
|
+
Dir.mktmpdir 'man' do |dir|
|
200
|
+
@cmd.install_man dir
|
201
|
+
|
202
|
+
assert_path_exists File.join("#{dir}/man1", 'bundle-b.1')
|
203
|
+
assert_path_exists File.join("#{dir}/man1", 'bundle-b.1.txt')
|
204
|
+
assert_path_exists File.join("#{dir}/man5", 'gemfile.5')
|
205
|
+
assert_path_exists File.join("#{dir}/man5", 'gemfile.5.txt')
|
182
206
|
end
|
183
207
|
end
|
184
208
|
|
@@ -207,21 +231,14 @@ class TestGemCommandsSetupCommand < Gem::TestCase
|
|
207
231
|
assert_path_exists File.join(default_dir, "bundler-#{BUNDLER_VERS}.gemspec")
|
208
232
|
|
209
233
|
# expect to not remove bundler-* gemspecs.
|
210
|
-
assert_path_exists File.join(Gem.
|
234
|
+
assert_path_exists File.join(Gem.dir, "specifications", "bundler-audit-1.0.0.gemspec")
|
211
235
|
|
212
236
|
# expect to remove normal gem that was same version. because it's promoted default gems.
|
213
|
-
refute_path_exists File.join(Gem.
|
237
|
+
refute_path_exists File.join(Gem.dir, "specifications", "bundler-#{BUNDLER_VERS}.gemspec")
|
214
238
|
|
215
|
-
#
|
216
|
-
assert_path_exists "
|
217
|
-
|
218
|
-
# expect to not remove other versions of bundler on `site_ruby`
|
219
|
-
assert_path_exists 'default/gems/bundler-1.15.4'
|
220
|
-
|
221
|
-
# TODO: We need to assert to remove same version of bundler on gem_dir directory(It's not site_ruby dir)
|
222
|
-
|
223
|
-
# expect to not remove bundler-* directory.
|
224
|
-
assert_path_exists 'default/gems/bundler-audit-1.0.0'
|
239
|
+
assert_path_exists "#{Gem.dir}/gems/bundler-#{BUNDLER_VERS}"
|
240
|
+
assert_path_exists "#{Gem.dir}/gems/bundler-1.15.4"
|
241
|
+
assert_path_exists "#{Gem.dir}/gems/bundler-audit-1.0.0"
|
225
242
|
end
|
226
243
|
|
227
244
|
def test_install_default_bundler_gem_with_force_flag
|
@@ -260,52 +277,53 @@ class TestGemCommandsSetupCommand < Gem::TestCase
|
|
260
277
|
lib_rubygems = File.join lib, 'rubygems'
|
261
278
|
lib_bundler = File.join lib, 'bundler'
|
262
279
|
lib_rubygems_defaults = File.join lib_rubygems, 'defaults'
|
280
|
+
lib_bundler_templates = File.join lib_bundler, 'templates'
|
263
281
|
|
264
282
|
securerandom_rb = File.join lib, 'securerandom.rb'
|
265
283
|
|
266
284
|
engine_defaults_rb = File.join lib_rubygems_defaults, 'jruby.rb'
|
267
285
|
os_defaults_rb = File.join lib_rubygems_defaults, 'operating_system.rb'
|
268
286
|
|
287
|
+
old_gauntlet_rubygems_rb = File.join lib, 'gauntlet_rubygems.rb'
|
288
|
+
|
269
289
|
old_builder_rb = File.join lib_rubygems, 'builder.rb'
|
270
290
|
old_format_rb = File.join lib_rubygems, 'format.rb'
|
271
291
|
old_bundler_c_rb = File.join lib_bundler, 'c.rb'
|
292
|
+
old_bundler_ci = File.join lib_bundler_templates, '.lecacy_ci', 'config.yml'
|
272
293
|
|
273
|
-
|
274
|
-
|
294
|
+
files_that_go = [old_gauntlet_rubygems_rb, old_builder_rb, old_format_rb, old_bundler_c_rb, old_bundler_ci]
|
295
|
+
files_that_stay = [securerandom_rb, engine_defaults_rb, os_defaults_rb]
|
275
296
|
|
276
|
-
|
277
|
-
io.puts '# securerandom.rb'
|
278
|
-
end
|
297
|
+
create_dummy_files(files_that_go + files_that_stay)
|
279
298
|
|
280
|
-
|
281
|
-
io.puts '# builder.rb'
|
282
|
-
end
|
299
|
+
@cmd.remove_old_lib_files lib
|
283
300
|
|
284
|
-
|
285
|
-
io.puts '# format.rb'
|
286
|
-
end
|
301
|
+
files_that_go.each {|file| refute_path_exists file }
|
287
302
|
|
288
|
-
|
289
|
-
|
290
|
-
end
|
303
|
+
files_that_stay.each {|file| assert_path_exists file }
|
304
|
+
end
|
291
305
|
|
292
|
-
|
293
|
-
|
294
|
-
end
|
306
|
+
def test_remove_old_man_files
|
307
|
+
man = File.join @install_dir, 'man'
|
295
308
|
|
296
|
-
File.
|
297
|
-
|
298
|
-
|
309
|
+
ruby_1 = File.join man, 'man1', 'ruby.1'
|
310
|
+
bundle_b_1 = File.join man, 'man1', 'bundle-b.1'
|
311
|
+
bundle_b_1_txt = File.join man, 'man1', 'bundle-b.1.txt'
|
312
|
+
bundle_old_b_1 = File.join man, 'man1', 'bundle-old_b.1'
|
313
|
+
bundle_old_b_1_txt = File.join man, 'man1', 'bundle-old_b.1.txt'
|
314
|
+
gemfile_5 = File.join man, 'man5', 'gemfile.5'
|
315
|
+
gemfile_5_txt = File.join man, 'man5', 'gemfile.5.txt'
|
299
316
|
|
300
|
-
|
317
|
+
files_that_go = [bundle_old_b_1, bundle_old_b_1_txt]
|
318
|
+
files_that_stay = [ruby_1, bundle_b_1, bundle_b_1_txt, gemfile_5, gemfile_5_txt]
|
301
319
|
|
302
|
-
|
303
|
-
refute_path_exists old_format_rb
|
304
|
-
refute_path_exists old_bundler_c_rb
|
320
|
+
create_dummy_files(files_that_go + files_that_stay)
|
305
321
|
|
306
|
-
|
307
|
-
|
308
|
-
|
322
|
+
@cmd.remove_old_man_files man
|
323
|
+
|
324
|
+
files_that_go.each {|file| refute_path_exists file }
|
325
|
+
|
326
|
+
files_that_stay.each {|file| assert_path_exists file }
|
309
327
|
end
|
310
328
|
|
311
329
|
def test_show_release_notes
|
@@ -315,7 +333,7 @@ class TestGemCommandsSetupCommand < Gem::TestCase
|
|
315
333
|
@cmd.options[:previous_version] = Gem::Version.new '2.0.2'
|
316
334
|
|
317
335
|
File.open 'History.txt', 'w' do |io|
|
318
|
-
io.puts <<-
|
336
|
+
io.puts <<-HISTORY_TXT
|
319
337
|
# coding: UTF-8
|
320
338
|
|
321
339
|
=== #{Gem::VERSION} / 2013-03-26
|
@@ -333,7 +351,7 @@ class TestGemCommandsSetupCommand < Gem::TestCase
|
|
333
351
|
|
334
352
|
* Bug fixes:
|
335
353
|
* Yet more bugs fixed
|
336
|
-
|
354
|
+
HISTORY_TXT
|
337
355
|
end
|
338
356
|
|
339
357
|
use_ui @ui do
|
@@ -359,6 +377,40 @@ class TestGemCommandsSetupCommand < Gem::TestCase
|
|
359
377
|
|
360
378
|
private
|
361
379
|
|
380
|
+
def create_dummy_files(list)
|
381
|
+
list.each do |file|
|
382
|
+
FileUtils.mkdir_p File.dirname(file)
|
383
|
+
|
384
|
+
File.open file, 'w' do |io|
|
385
|
+
io.puts "# #{File.basename(file)}"
|
386
|
+
end
|
387
|
+
end
|
388
|
+
end
|
389
|
+
|
390
|
+
def gem_install(name)
|
391
|
+
gem = util_spec name do |s|
|
392
|
+
s.executables = [name]
|
393
|
+
s.files = %W[bin/#{name}]
|
394
|
+
end
|
395
|
+
write_file File.join @tempdir, 'bin', name do |f|
|
396
|
+
f.puts '#!/usr/bin/ruby'
|
397
|
+
end
|
398
|
+
install_gem gem
|
399
|
+
File.join @gemhome, 'bin', name
|
400
|
+
end
|
401
|
+
|
402
|
+
def gem_install_with_plugin(name)
|
403
|
+
gem = util_spec name do |s|
|
404
|
+
s.files = %W[lib/rubygems_plugin.rb]
|
405
|
+
end
|
406
|
+
write_file File.join @tempdir, 'lib', 'rubygems_plugin.rb' do |f|
|
407
|
+
f.puts "require '#{gem.plugins.first}'"
|
408
|
+
end
|
409
|
+
install_gem gem
|
410
|
+
|
411
|
+
File.join Gem.plugindir, "#{name}_plugin.rb"
|
412
|
+
end
|
413
|
+
|
362
414
|
def default_gem_bin_path
|
363
415
|
gem_exec = sprintf Gem.default_exec_format, 'gem'
|
364
416
|
File.join @install_dir, 'bin', gem_exec
|