rubygems-update 3.3.18 → 3.3.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +65 -0
- data/Manifest.txt +11 -0
- data/bin/gem +2 -2
- data/bin/update_rubygems +4 -4
- data/bundler/CHANGELOG.md +100 -0
- data/bundler/UPGRADING.md +11 -4
- data/bundler/bundler.gemspec +6 -8
- data/bundler/lib/bundler/build_metadata.rb +2 -2
- data/bundler/lib/bundler/cli/common.rb +1 -0
- data/bundler/lib/bundler/cli/install.rb +5 -2
- data/bundler/lib/bundler/cli/outdated.rb +12 -3
- data/bundler/lib/bundler/cli/platform.rb +1 -1
- data/bundler/lib/bundler/cli.rb +7 -4
- data/bundler/lib/bundler/current_ruby.rb +14 -5
- data/bundler/lib/bundler/definition.rb +102 -31
- data/bundler/lib/bundler/dependency.rb +18 -85
- data/bundler/lib/bundler/dsl.rb +2 -2
- data/bundler/lib/bundler/endpoint_specification.rb +2 -13
- data/bundler/lib/bundler/feature_flag.rb +0 -1
- data/bundler/lib/bundler/fetcher.rb +6 -6
- data/bundler/lib/bundler/gem_helpers.rb +7 -1
- data/bundler/lib/bundler/gem_version_promoter.rb +8 -18
- data/bundler/lib/bundler/index.rb +10 -12
- data/bundler/lib/bundler/injector.rb +2 -1
- data/bundler/lib/bundler/inline.rb +1 -1
- data/bundler/lib/bundler/installer/standalone.rb +1 -1
- data/bundler/lib/bundler/installer.rb +14 -12
- data/bundler/lib/bundler/lazy_specification.rb +30 -23
- data/bundler/lib/bundler/lockfile_generator.rb +1 -1
- data/bundler/lib/bundler/man/bundle-add.1 +6 -2
- data/bundler/lib/bundler/man/bundle-add.1.ronn +4 -1
- data/bundler/lib/bundler/man/bundle-binstubs.1 +1 -1
- data/bundler/lib/bundler/man/bundle-cache.1 +7 -1
- data/bundler/lib/bundler/man/bundle-cache.1.ronn +7 -0
- data/bundler/lib/bundler/man/bundle-check.1 +1 -1
- data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
- data/bundler/lib/bundler/man/bundle-config.1 +25 -6
- data/bundler/lib/bundler/man/bundle-config.1.ronn +16 -6
- data/bundler/lib/bundler/man/bundle-console.1 +53 -0
- data/bundler/lib/bundler/man/bundle-console.1.ronn +44 -0
- data/bundler/lib/bundler/man/bundle-doctor.1 +1 -1
- data/bundler/lib/bundler/man/bundle-exec.1 +2 -2
- data/bundler/lib/bundler/man/bundle-exec.1.ronn +1 -1
- data/bundler/lib/bundler/man/bundle-gem.1 +1 -1
- data/bundler/lib/bundler/man/bundle-help.1 +13 -0
- data/bundler/lib/bundler/man/bundle-help.1.ronn +12 -0
- data/bundler/lib/bundler/man/bundle-info.1 +1 -1
- data/bundler/lib/bundler/man/bundle-init.1 +1 -1
- data/bundler/lib/bundler/man/bundle-inject.1 +5 -2
- data/bundler/lib/bundler/man/bundle-inject.1.ronn +3 -1
- data/bundler/lib/bundler/man/bundle-install.1 +5 -1
- data/bundler/lib/bundler/man/bundle-install.1.ronn +6 -0
- data/bundler/lib/bundler/man/bundle-list.1 +1 -1
- data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
- data/bundler/lib/bundler/man/bundle-open.1 +1 -1
- data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
- data/bundler/lib/bundler/man/bundle-platform.1 +16 -6
- data/bundler/lib/bundler/man/bundle-platform.1.ronn +14 -7
- data/bundler/lib/bundler/man/bundle-plugin.1 +81 -0
- data/bundler/lib/bundler/man/bundle-plugin.1.ronn +59 -0
- data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
- data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
- data/bundler/lib/bundler/man/bundle-show.1 +1 -1
- data/bundler/lib/bundler/man/bundle-update.1 +1 -1
- data/bundler/lib/bundler/man/bundle-version.1 +35 -0
- data/bundler/lib/bundler/man/bundle-version.1.ronn +24 -0
- data/bundler/lib/bundler/man/bundle-viz.1 +4 -1
- data/bundler/lib/bundler/man/bundle-viz.1.ronn +2 -0
- data/bundler/lib/bundler/man/bundle.1 +15 -10
- data/bundler/lib/bundler/man/bundle.1.ronn +12 -7
- data/bundler/lib/bundler/man/gemfile.5 +23 -47
- data/bundler/lib/bundler/man/gemfile.5.ronn +32 -43
- data/bundler/lib/bundler/man/index.txt +4 -0
- data/bundler/lib/bundler/match_metadata.rb +13 -0
- data/bundler/lib/bundler/match_remote_metadata.rb +29 -0
- data/bundler/lib/bundler/plugin.rb +2 -0
- data/bundler/lib/bundler/remote_specification.rb +6 -11
- data/bundler/lib/bundler/resolver/base.rb +50 -0
- data/bundler/lib/bundler/resolver/spec_group.rb +11 -8
- data/bundler/lib/bundler/resolver.rb +95 -90
- data/bundler/lib/bundler/ruby_dsl.rb +1 -1
- data/bundler/lib/bundler/ruby_version.rb +5 -5
- data/bundler/lib/bundler/rubygems_ext.rb +52 -1
- data/bundler/lib/bundler/rubygems_gem_installer.rb +19 -12
- data/bundler/lib/bundler/settings.rb +1 -1
- data/bundler/lib/bundler/source/metadata.rb +1 -1
- data/bundler/lib/bundler/source_list.rb +4 -0
- data/bundler/lib/bundler/spec_set.rb +48 -33
- data/bundler/lib/bundler/version.rb +1 -1
- data/bundler/lib/bundler.rb +3 -3
- data/lib/rubygems/available_set.rb +3 -3
- data/lib/rubygems/basic_specification.rb +4 -4
- data/lib/rubygems/command.rb +25 -25
- data/lib/rubygems/command_manager.rb +9 -9
- data/lib/rubygems/commands/build_command.rb +8 -8
- data/lib/rubygems/commands/cert_command.rb +33 -33
- data/lib/rubygems/commands/check_command.rb +20 -20
- data/lib/rubygems/commands/cleanup_command.rb +17 -17
- data/lib/rubygems/commands/contents_command.rb +13 -13
- data/lib/rubygems/commands/dependency_command.rb +16 -16
- data/lib/rubygems/commands/environment_command.rb +5 -5
- data/lib/rubygems/commands/fetch_command.rb +8 -8
- data/lib/rubygems/commands/generate_index_command.rb +17 -17
- data/lib/rubygems/commands/help_command.rb +3 -3
- data/lib/rubygems/commands/info_command.rb +3 -3
- data/lib/rubygems/commands/install_command.rb +20 -20
- data/lib/rubygems/commands/list_command.rb +3 -3
- data/lib/rubygems/commands/lock_command.rb +4 -4
- data/lib/rubygems/commands/mirror_command.rb +3 -3
- data/lib/rubygems/commands/open_command.rb +9 -9
- data/lib/rubygems/commands/outdated_command.rb +5 -5
- data/lib/rubygems/commands/owner_command.rb +11 -11
- data/lib/rubygems/commands/pristine_command.rb +36 -36
- data/lib/rubygems/commands/push_command.rb +8 -8
- data/lib/rubygems/commands/query_command.rb +8 -8
- data/lib/rubygems/commands/rdoc_command.rb +17 -17
- data/lib/rubygems/commands/search_command.rb +3 -3
- data/lib/rubygems/commands/server_command.rb +3 -3
- data/lib/rubygems/commands/setup_command.rb +96 -106
- data/lib/rubygems/commands/signin_command.rb +9 -9
- data/lib/rubygems/commands/signout_command.rb +7 -7
- data/lib/rubygems/commands/sources_command.rb +21 -21
- data/lib/rubygems/commands/specification_command.rb +13 -13
- data/lib/rubygems/commands/stale_command.rb +2 -2
- data/lib/rubygems/commands/uninstall_command.rb +40 -40
- data/lib/rubygems/commands/unpack_command.rb +12 -12
- data/lib/rubygems/commands/update_command.rb +40 -56
- data/lib/rubygems/commands/which_command.rb +7 -7
- data/lib/rubygems/commands/yank_command.rb +11 -11
- data/lib/rubygems/config_file.rb +21 -21
- data/lib/rubygems/core_ext/kernel_gem.rb +1 -1
- data/lib/rubygems/core_ext/kernel_require.rb +1 -1
- data/lib/rubygems/core_ext/kernel_warn.rb +1 -1
- data/lib/rubygems/core_ext/tcpsocket_init.rb +1 -1
- data/lib/rubygems/defaults.rb +16 -16
- data/lib/rubygems/dependency.rb +9 -9
- data/lib/rubygems/dependency_installer.rb +13 -13
- data/lib/rubygems/dependency_list.rb +6 -6
- data/lib/rubygems/doctor.rb +18 -18
- data/lib/rubygems/errors.rb +2 -2
- data/lib/rubygems/exceptions.rb +5 -5
- data/lib/rubygems/ext/build_error.rb +1 -1
- data/lib/rubygems/ext/builder.rb +16 -16
- data/lib/rubygems/ext/cargo_builder.rb +7 -7
- data/lib/rubygems/ext/cmake_builder.rb +2 -2
- data/lib/rubygems/ext/configure_builder.rb +1 -1
- data/lib/rubygems/ext/ext_conf_builder.rb +8 -8
- data/lib/rubygems/ext/rake_builder.rb +3 -3
- data/lib/rubygems/ext.rb +7 -7
- data/lib/rubygems/gem_runner.rb +5 -5
- data/lib/rubygems/gemcutter_utilities.rb +31 -28
- data/lib/rubygems/indexer.rb +27 -27
- data/lib/rubygems/install_default_message.rb +2 -2
- data/lib/rubygems/install_message.rb +2 -2
- data/lib/rubygems/install_update_options.rb +55 -55
- data/lib/rubygems/installer.rb +32 -40
- data/lib/rubygems/installer_uninstaller_utils.rb +2 -2
- data/lib/rubygems/local_remote_options.rb +18 -20
- data/lib/rubygems/mock_gem_ui.rb +2 -2
- data/lib/rubygems/name_tuple.rb +4 -4
- data/lib/rubygems/optparse.rb +1 -1
- data/lib/rubygems/package/file_source.rb +2 -2
- data/lib/rubygems/package/old.rb +8 -8
- data/lib/rubygems/package/tar_header.rb +50 -50
- data/lib/rubygems/package/tar_reader/entry.rb +2 -2
- data/lib/rubygems/package/tar_reader.rb +1 -1
- data/lib/rubygems/package/tar_writer.rb +7 -7
- data/lib/rubygems/package.rb +54 -43
- data/lib/rubygems/package_task.rb +4 -4
- data/lib/rubygems/platform.rb +66 -55
- data/lib/rubygems/psych_tree.rb +1 -1
- data/lib/rubygems/query_utils.rb +35 -35
- data/lib/rubygems/rdoc.rb +2 -2
- data/lib/rubygems/remote_fetcher.rb +22 -22
- data/lib/rubygems/request/connection_pools.rb +4 -4
- data/lib/rubygems/request/http_pool.rb +1 -1
- data/lib/rubygems/request.rb +22 -22
- data/lib/rubygems/request_set/gem_dependency_api.rb +18 -18
- data/lib/rubygems/request_set/lockfile/parser.rb +26 -26
- data/lib/rubygems/request_set/lockfile/tokenizer.rb +4 -4
- data/lib/rubygems/request_set/lockfile.rb +5 -5
- data/lib/rubygems/request_set.rb +17 -17
- data/lib/rubygems/requirement.rb +6 -6
- data/lib/rubygems/resolver/activation_request.rb +3 -3
- data/lib/rubygems/resolver/api_set.rb +4 -4
- data/lib/rubygems/resolver/api_specification.rb +6 -6
- data/lib/rubygems/resolver/best_set.rb +5 -5
- data/lib/rubygems/resolver/conflict.rb +10 -10
- data/lib/rubygems/resolver/dependency_request.rb +2 -2
- data/lib/rubygems/resolver/git_set.rb +2 -2
- data/lib/rubygems/resolver/git_specification.rb +6 -6
- data/lib/rubygems/resolver/index_set.rb +3 -3
- data/lib/rubygems/resolver/index_specification.rb +6 -5
- data/lib/rubygems/resolver/installed_specification.rb +4 -4
- data/lib/rubygems/resolver/installer_set.rb +11 -16
- data/lib/rubygems/resolver/local_specification.rb +2 -2
- data/lib/rubygems/resolver/lock_set.rb +4 -4
- data/lib/rubygems/resolver/lock_specification.rb +4 -4
- data/lib/rubygems/resolver/molinillo.rb +1 -1
- data/lib/rubygems/resolver/specification.rb +1 -1
- data/lib/rubygems/resolver/vendor_set.rb +1 -1
- data/lib/rubygems/resolver/vendor_specification.rb +3 -3
- data/lib/rubygems/resolver.rb +39 -39
- data/lib/rubygems/s3_uri_signer.rb +6 -6
- data/lib/rubygems/safe_yaml.rb +2 -2
- data/lib/rubygems/security/policies.rb +11 -11
- data/lib/rubygems/security/policy.rb +18 -18
- data/lib/rubygems/security/signer.rb +5 -5
- data/lib/rubygems/security/trust_dir.rb +3 -3
- data/lib/rubygems/security.rb +28 -28
- data/lib/rubygems/security_option.rb +5 -5
- data/lib/rubygems/source/git.rb +21 -21
- data/lib/rubygems/source/installed.rb +1 -1
- data/lib/rubygems/source/local.rb +2 -2
- data/lib/rubygems/source/specific_file.rb +1 -1
- data/lib/rubygems/source.rb +16 -16
- data/lib/rubygems/spec_fetcher.rb +9 -9
- data/lib/rubygems/specification.rb +63 -62
- data/lib/rubygems/specification_policy.rb +15 -15
- data/lib/rubygems/stub_specification.rb +5 -5
- data/lib/rubygems/tsort.rb +1 -1
- data/lib/rubygems/uninstaller.rb +18 -18
- data/lib/rubygems/uri.rb +4 -4
- data/lib/rubygems/uri_formatter.rb +1 -1
- data/lib/rubygems/user_interaction.rb +33 -19
- data/lib/rubygems/util/licenses.rb +3 -3
- data/lib/rubygems/util.rb +10 -10
- data/lib/rubygems/validator.rb +5 -5
- data/lib/rubygems/version.rb +15 -9
- data/lib/rubygems/version_option.rb +3 -3
- data/lib/rubygems.rb +62 -61
- data/rubygems-update.gemspec +2 -2
- data/setup.rb +9 -9
- data/test/rubygems/helper.rb +132 -134
- data/test/rubygems/installer_test_case.rb +13 -13
- data/test/rubygems/package/tar_test_case.rb +2 -2
- data/test/rubygems/plugin/exception/rubygems_plugin.rb +1 -1
- data/test/rubygems/plugin/standarderror/rubygems_plugin.rb +1 -1
- data/test/rubygems/rubygems_plugin.rb +2 -2
- data/test/rubygems/specifications/rubyforge-0.0.1.gemspec +4 -4
- data/test/rubygems/test_bundled_ca.rb +10 -10
- data/test/rubygems/test_config.rb +3 -3
- data/test/rubygems/test_deprecate.rb +3 -3
- data/test/rubygems/test_exit.rb +2 -2
- data/test/rubygems/test_gem.rb +342 -342
- data/test/rubygems/test_gem_available_set.rb +21 -21
- data/test/rubygems/test_gem_bundler_version_finder.rb +1 -1
- data/test/rubygems/test_gem_command.rb +44 -44
- data/test/rubygems/test_gem_command_manager.rb +29 -29
- data/test/rubygems/test_gem_commands_build_command.rb +63 -63
- data/test/rubygems/test_gem_commands_cert_command.rb +97 -99
- data/test/rubygems/test_gem_commands_check_command.rb +4 -4
- data/test/rubygems/test_gem_commands_cleanup_command.rb +40 -40
- data/test/rubygems/test_gem_commands_contents_command.rb +27 -27
- data/test/rubygems/test_gem_commands_dependency_command.rb +36 -36
- data/test/rubygems/test_gem_commands_environment_command.rb +16 -16
- data/test/rubygems/test_gem_commands_fetch_command.rb +37 -37
- data/test/rubygems/test_gem_commands_generate_index_command.rb +7 -7
- data/test/rubygems/test_gem_commands_help_command.rb +13 -13
- data/test/rubygems/test_gem_commands_info_command.rb +28 -2
- data/test/rubygems/test_gem_commands_install_command.rb +131 -131
- data/test/rubygems/test_gem_commands_list_command.rb +4 -4
- data/test/rubygems/test_gem_commands_lock_command.rb +10 -10
- data/test/rubygems/test_gem_commands_mirror.rb +2 -2
- data/test/rubygems/test_gem_commands_open_command.rb +4 -4
- data/test/rubygems/test_gem_commands_outdated_command.rb +9 -9
- data/test/rubygems/test_gem_commands_owner_command.rb +41 -41
- data/test/rubygems/test_gem_commands_pristine_command.rb +92 -92
- data/test/rubygems/test_gem_commands_push_command.rb +54 -54
- data/test/rubygems/test_gem_commands_query_command.rb +73 -73
- data/test/rubygems/test_gem_commands_search_command.rb +2 -2
- data/test/rubygems/test_gem_commands_server_command.rb +2 -2
- data/test/rubygems/test_gem_commands_setup_command.rb +119 -85
- data/test/rubygems/test_gem_commands_signin_command.rb +45 -31
- data/test/rubygems/test_gem_commands_signout_command.rb +3 -3
- data/test/rubygems/test_gem_commands_sources_command.rb +28 -29
- data/test/rubygems/test_gem_commands_specification_command.rb +32 -32
- data/test/rubygems/test_gem_commands_stale_command.rb +4 -4
- data/test/rubygems/test_gem_commands_uninstall_command.rb +75 -75
- data/test/rubygems/test_gem_commands_unpack_command.rb +31 -31
- data/test/rubygems/test_gem_commands_update_command.rb +89 -89
- data/test/rubygems/test_gem_commands_which_command.rb +6 -6
- data/test/rubygems/test_gem_commands_yank_command.rb +40 -40
- data/test/rubygems/test_gem_config_file.rb +93 -81
- data/test/rubygems/test_gem_dependency.rb +73 -73
- data/test/rubygems/test_gem_dependency_installer.rb +165 -165
- data/test/rubygems/test_gem_dependency_list.rb +47 -47
- data/test/rubygems/test_gem_dependency_resolution_error.rb +4 -4
- data/test/rubygems/test_gem_doctor.rb +26 -26
- data/test/rubygems/test_gem_ext_builder.rb +59 -59
- data/test/rubygems/test_gem_ext_cargo_builder/custom_name/Cargo.lock +6 -6
- data/test/rubygems/test_gem_ext_cargo_builder/custom_name/Cargo.toml +1 -1
- data/test/rubygems/test_gem_ext_cargo_builder/custom_name/build.rb +8 -8
- data/test/rubygems/test_gem_ext_cargo_builder/custom_name/custom_name.gemspec +1 -1
- data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.lock +6 -6
- data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.toml +1 -1
- data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/build.rb +8 -8
- data/test/rubygems/test_gem_ext_cargo_builder.rb +26 -26
- data/test/rubygems/test_gem_ext_cargo_builder_link_flag_converter.rb +3 -3
- data/test/rubygems/test_gem_ext_cargo_builder_unit.rb +23 -23
- data/test/rubygems/test_gem_ext_cmake_builder.rb +15 -15
- data/test/rubygems/test_gem_ext_configure_builder.rb +13 -13
- data/test/rubygems/test_gem_ext_ext_conf_builder.rb +51 -52
- data/test/rubygems/test_gem_ext_rake_builder.rb +15 -15
- data/test/rubygems/test_gem_gem_runner.rb +7 -7
- data/test/rubygems/test_gem_gemcutter_utilities.rb +66 -66
- data/test/rubygems/test_gem_impossible_dependencies_error.rb +4 -4
- data/test/rubygems/test_gem_indexer.rb +48 -48
- data/test/rubygems/test_gem_install_update_options.rb +16 -16
- data/test/rubygems/test_gem_installer.rb +303 -300
- data/test/rubygems/test_gem_local_remote_options.rb +10 -10
- data/test/rubygems/test_gem_name_tuple.rb +4 -4
- data/test/rubygems/test_gem_package.rb +228 -206
- data/test/rubygems/test_gem_package_old.rb +13 -13
- data/test/rubygems/test_gem_package_tar_header.rb +42 -42
- data/test/rubygems/test_gem_package_tar_reader.rb +8 -8
- data/test/rubygems/test_gem_package_tar_reader_entry.rb +10 -10
- data/test/rubygems/test_gem_package_tar_writer.rb +76 -76
- data/test/rubygems/test_gem_package_task.rb +18 -18
- data/test/rubygems/test_gem_path_support.rb +14 -14
- data/test/rubygems/test_gem_platform.rb +298 -227
- data/test/rubygems/test_gem_rdoc.rb +14 -14
- data/test/rubygems/test_gem_remote_fetcher.rb +149 -149
- data/test/rubygems/test_gem_request.rb +55 -55
- data/test/rubygems/test_gem_request_connection_pools.rb +29 -29
- data/test/rubygems/test_gem_request_set.rb +99 -99
- data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +204 -206
- data/test/rubygems/test_gem_request_set_lockfile.rb +86 -86
- data/test/rubygems/test_gem_request_set_lockfile_parser.rb +56 -56
- data/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb +62 -62
- data/test/rubygems/test_gem_requirement.rb +47 -41
- data/test/rubygems/test_gem_resolver.rb +133 -99
- data/test/rubygems/test_gem_resolver_activation_request.rb +6 -6
- data/test/rubygems/test_gem_resolver_api_set.rb +33 -33
- data/test/rubygems/test_gem_resolver_api_specification.rb +47 -47
- data/test/rubygems/test_gem_resolver_best_set.rb +22 -22
- data/test/rubygems/test_gem_resolver_composed_set.rb +1 -1
- data/test/rubygems/test_gem_resolver_conflict.rb +12 -12
- data/test/rubygems/test_gem_resolver_dependency_request.rb +15 -15
- data/test/rubygems/test_gem_resolver_git_set.rb +21 -21
- data/test/rubygems/test_gem_resolver_git_specification.rb +21 -21
- data/test/rubygems/test_gem_resolver_index_set.rb +12 -12
- data/test/rubygems/test_gem_resolver_index_specification.rb +16 -16
- data/test/rubygems/test_gem_resolver_installed_specification.rb +5 -5
- data/test/rubygems/test_gem_resolver_installer_set.rb +78 -34
- data/test/rubygems/test_gem_resolver_local_specification.rb +7 -7
- data/test/rubygems/test_gem_resolver_lock_set.rb +12 -12
- data/test/rubygems/test_gem_resolver_lock_specification.rb +17 -17
- data/test/rubygems/test_gem_resolver_requirement_list.rb +1 -1
- data/test/rubygems/test_gem_resolver_specification.rb +8 -8
- data/test/rubygems/test_gem_resolver_vendor_set.rb +6 -6
- data/test/rubygems/test_gem_resolver_vendor_specification.rb +10 -10
- data/test/rubygems/test_gem_security.rb +67 -67
- data/test/rubygems/test_gem_security_policy.rb +62 -62
- data/test/rubygems/test_gem_security_signer.rb +28 -28
- data/test/rubygems/test_gem_security_trust_dir.rb +4 -4
- data/test/rubygems/test_gem_silent_ui.rb +38 -32
- data/test/rubygems/test_gem_source.rb +44 -44
- data/test/rubygems/test_gem_source_fetch_problem.rb +9 -9
- data/test/rubygems/test_gem_source_git.rb +59 -59
- data/test/rubygems/test_gem_source_installed.rb +16 -16
- data/test/rubygems/test_gem_source_list.rb +5 -5
- data/test/rubygems/test_gem_source_local.rb +14 -14
- data/test/rubygems/test_gem_source_lock.rb +31 -31
- data/test/rubygems/test_gem_source_specific_file.rb +17 -17
- data/test/rubygems/test_gem_source_subpath_problem.rb +7 -7
- data/test/rubygems/test_gem_source_vendor.rb +13 -13
- data/test/rubygems/test_gem_spec_fetcher.rb +72 -72
- data/test/rubygems/test_gem_specification.rb +444 -436
- data/test/rubygems/test_gem_stream_ui.rb +19 -19
- data/test/rubygems/test_gem_stub_specification.rb +32 -32
- data/test/rubygems/test_gem_text.rb +1 -1
- data/test/rubygems/test_gem_uninstaller.rb +112 -112
- data/test/rubygems/test_gem_unsatisfiable_dependency_error.rb +3 -3
- data/test/rubygems/test_gem_uri.rb +4 -4
- data/test/rubygems/test_gem_uri_formatter.rb +14 -14
- data/test/rubygems/test_gem_util.rb +23 -23
- data/test/rubygems/test_gem_validator.rb +8 -8
- data/test/rubygems/test_gem_version.rb +22 -15
- data/test/rubygems/test_gem_version_option.rb +15 -15
- data/test/rubygems/test_kernel.rb +31 -31
- data/test/rubygems/test_project_sanity.rb +1 -1
- data/test/rubygems/test_remote_fetch_error.rb +6 -6
- data/test/rubygems/test_require.rb +43 -43
- data/test/rubygems/test_rubygems.rb +8 -8
- data/test/rubygems/utilities.rb +19 -19
- metadata +14 -3
@@ -1,5 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
require_relative
|
2
|
+
require_relative "installer_test_case"
|
3
3
|
|
4
4
|
class TestGemInstaller < Gem::InstallerTestCase
|
5
5
|
def setup
|
@@ -21,7 +21,7 @@ class TestGemInstaller < Gem::InstallerTestCase
|
|
21
21
|
load_relative "no" do
|
22
22
|
installer = setup_base_installer
|
23
23
|
|
24
|
-
util_make_exec @spec,
|
24
|
+
util_make_exec @spec, ""
|
25
25
|
|
26
26
|
expected = <<-EOF
|
27
27
|
#!#{Gem.ruby}
|
@@ -55,7 +55,7 @@ load Gem.bin_path("a", "executable", version)
|
|
55
55
|
end
|
56
56
|
EOF
|
57
57
|
|
58
|
-
wrapper = installer.app_script_text
|
58
|
+
wrapper = installer.app_script_text "executable"
|
59
59
|
assert_equal expected, wrapper
|
60
60
|
end
|
61
61
|
end
|
@@ -66,12 +66,12 @@ end
|
|
66
66
|
installer.generate_bin
|
67
67
|
|
68
68
|
@spec = Gem::Specification.new do |s|
|
69
|
-
s.files = [
|
69
|
+
s.files = ["lib/code.rb"]
|
70
70
|
s.name = "a"
|
71
71
|
s.version = "3"
|
72
72
|
s.summary = "summary"
|
73
73
|
s.description = "desc"
|
74
|
-
s.require_path =
|
74
|
+
s.require_path = "lib"
|
75
75
|
end
|
76
76
|
|
77
77
|
util_make_exec
|
@@ -79,7 +79,7 @@ end
|
|
79
79
|
installer.wrappers = true
|
80
80
|
installer.generate_bin
|
81
81
|
|
82
|
-
installed_exec = File.join util_inst_bindir,
|
82
|
+
installed_exec = File.join util_inst_bindir, "executable"
|
83
83
|
assert_path_exist installed_exec
|
84
84
|
|
85
85
|
wrapper = File.read installed_exec
|
@@ -98,7 +98,7 @@ end
|
|
98
98
|
installer.generate_bin
|
99
99
|
end
|
100
100
|
|
101
|
-
conflicted = File.join @gemhome,
|
101
|
+
conflicted = File.join @gemhome, "bin", "executable"
|
102
102
|
assert_match %r{\A"executable" from a conflicts with (?:#{Regexp.quote(conflicted)}|installed executable from conflict)\z},
|
103
103
|
e.message
|
104
104
|
end
|
@@ -111,15 +111,15 @@ end
|
|
111
111
|
installer.generate_bin
|
112
112
|
|
113
113
|
@spec = Gem::Specification.new do |s|
|
114
|
-
s.files = [
|
114
|
+
s.files = ["lib/code.rb"]
|
115
115
|
s.name = "a"
|
116
116
|
s.version = "3"
|
117
117
|
s.summary = "summary"
|
118
118
|
s.description = "desc"
|
119
|
-
s.require_path =
|
119
|
+
s.require_path = "lib"
|
120
120
|
end
|
121
121
|
|
122
|
-
File.open File.join(util_inst_bindir,
|
122
|
+
File.open File.join(util_inst_bindir, "executable"), "w" do |io|
|
123
123
|
io.write <<-EXEC
|
124
124
|
#!/usr/local/bin/ruby
|
125
125
|
#
|
@@ -130,14 +130,14 @@ gem 'other', version
|
|
130
130
|
end
|
131
131
|
|
132
132
|
util_make_exec
|
133
|
-
Gem::Installer.exec_format =
|
133
|
+
Gem::Installer.exec_format = "foo-%s-bar"
|
134
134
|
installer.gem_dir = @spec.gem_dir
|
135
135
|
installer.wrappers = true
|
136
136
|
installer.format_executable = true
|
137
137
|
|
138
138
|
installer.generate_bin # should not raise
|
139
139
|
|
140
|
-
installed_exec = File.join util_inst_bindir,
|
140
|
+
installed_exec = File.join util_inst_bindir, "foo-executable-bar"
|
141
141
|
assert_path_exist installed_exec
|
142
142
|
|
143
143
|
wrapper = File.read installed_exec
|
@@ -172,7 +172,7 @@ gem 'other', version
|
|
172
172
|
|
173
173
|
installer.generate_bin
|
174
174
|
|
175
|
-
installed_exec = File.join util_inst_bindir,
|
175
|
+
installed_exec = File.join util_inst_bindir, "executable"
|
176
176
|
assert_path_exist installed_exec
|
177
177
|
|
178
178
|
wrapper = File.read installed_exec
|
@@ -187,7 +187,7 @@ gem 'other', version
|
|
187
187
|
|
188
188
|
installer.generate_bin
|
189
189
|
|
190
|
-
installed_exec = File.join util_inst_bindir,
|
190
|
+
installed_exec = File.join util_inst_bindir, "executable"
|
191
191
|
assert_path_exist installed_exec
|
192
192
|
|
193
193
|
wrapper = File.read installed_exec
|
@@ -203,8 +203,8 @@ gem 'other', version
|
|
203
203
|
bin_dir = bin_dir.downcase
|
204
204
|
end
|
205
205
|
|
206
|
-
orig_PATH, ENV[
|
207
|
-
ENV[
|
206
|
+
orig_PATH, ENV["PATH"] =
|
207
|
+
ENV["PATH"], [ENV["PATH"], bin_dir].join(File::PATH_SEPARATOR)
|
208
208
|
|
209
209
|
use_ui @ui do
|
210
210
|
installer.check_that_user_bin_dir_is_in_path
|
@@ -214,7 +214,7 @@ gem 'other', version
|
|
214
214
|
|
215
215
|
return unless win_platform?
|
216
216
|
|
217
|
-
ENV[
|
217
|
+
ENV["PATH"] = [orig_PATH, bin_dir.tr(File::SEPARATOR, File::ALT_SEPARATOR)].join(File::PATH_SEPARATOR)
|
218
218
|
|
219
219
|
use_ui @ui do
|
220
220
|
installer.check_that_user_bin_dir_is_in_path
|
@@ -222,17 +222,17 @@ gem 'other', version
|
|
222
222
|
|
223
223
|
assert_empty @ui.error
|
224
224
|
ensure
|
225
|
-
ENV[
|
225
|
+
ENV["PATH"] = orig_PATH
|
226
226
|
end
|
227
227
|
|
228
228
|
def test_check_that_user_bin_dir_is_in_path_tilde
|
229
229
|
pend "Tilde is PATH is not supported under MS Windows" if win_platform?
|
230
230
|
|
231
|
-
orig_PATH, ENV[
|
232
|
-
ENV[
|
231
|
+
orig_PATH, ENV["PATH"] =
|
232
|
+
ENV["PATH"], [ENV["PATH"], "~/bin"].join(File::PATH_SEPARATOR)
|
233
233
|
|
234
234
|
installer = setup_base_installer
|
235
|
-
installer.bin_dir.replace File.join @userhome,
|
235
|
+
installer.bin_dir.replace File.join @userhome, "bin"
|
236
236
|
|
237
237
|
use_ui @ui do
|
238
238
|
installer.check_that_user_bin_dir_is_in_path
|
@@ -240,7 +240,7 @@ gem 'other', version
|
|
240
240
|
|
241
241
|
assert_empty @ui.error
|
242
242
|
ensure
|
243
|
-
ENV[
|
243
|
+
ENV["PATH"] = orig_PATH unless win_platform?
|
244
244
|
end
|
245
245
|
|
246
246
|
def test_check_that_user_bin_dir_is_in_path_not_in_path
|
@@ -262,22 +262,22 @@ gem 'other', version
|
|
262
262
|
def test_ensure_dependency
|
263
263
|
installer = setup_base_installer
|
264
264
|
|
265
|
-
util_spec
|
265
|
+
util_spec "a"
|
266
266
|
|
267
|
-
dep = Gem::Dependency.new
|
267
|
+
dep = Gem::Dependency.new "a", ">= 2"
|
268
268
|
assert installer.ensure_dependency(@spec, dep)
|
269
269
|
|
270
|
-
dep = Gem::Dependency.new
|
270
|
+
dep = Gem::Dependency.new "b", "> 2"
|
271
271
|
e = assert_raise Gem::InstallError do
|
272
272
|
installer.ensure_dependency @spec, dep
|
273
273
|
end
|
274
274
|
|
275
|
-
assert_equal
|
275
|
+
assert_equal "a requires b (> 2)", e.message
|
276
276
|
end
|
277
277
|
|
278
278
|
def test_ensure_loadable_spec
|
279
|
-
a, a_gem = util_gem
|
280
|
-
s.add_dependency
|
279
|
+
a, a_gem = util_gem "a", 2 do |s|
|
280
|
+
s.add_dependency "garbage ~> 5"
|
281
281
|
end
|
282
282
|
|
283
283
|
installer = Gem::Installer.at a_gem
|
@@ -291,10 +291,10 @@ gem 'other', version
|
|
291
291
|
end
|
292
292
|
|
293
293
|
def test_ensure_loadable_spec_security_policy
|
294
|
-
pend
|
294
|
+
pend "openssl is missing" unless Gem::HAVE_OPENSSL
|
295
295
|
|
296
|
-
_, a_gem = util_gem
|
297
|
-
s.add_dependency
|
296
|
+
_, a_gem = util_gem "a", 2 do |s|
|
297
|
+
s.add_dependency "garbage ~> 5"
|
298
298
|
end
|
299
299
|
|
300
300
|
policy = Gem::Security::HighSecurity
|
@@ -310,7 +310,7 @@ gem 'other', version
|
|
310
310
|
|
311
311
|
installer.extract_files
|
312
312
|
|
313
|
-
assert_path_exist File.join @spec.gem_dir,
|
313
|
+
assert_path_exist File.join @spec.gem_dir, "bin/executable"
|
314
314
|
end
|
315
315
|
|
316
316
|
def test_generate_bin_bindir
|
@@ -319,12 +319,12 @@ gem 'other', version
|
|
319
319
|
installer.wrappers = true
|
320
320
|
|
321
321
|
@spec.executables = %w[executable]
|
322
|
-
@spec.bindir =
|
322
|
+
@spec.bindir = "bin"
|
323
323
|
|
324
|
-
exec_file = installer.formatted_program_filename
|
324
|
+
exec_file = installer.formatted_program_filename "executable"
|
325
325
|
exec_path = File.join @spec.gem_dir, exec_file
|
326
|
-
File.open exec_path,
|
327
|
-
f.puts
|
326
|
+
File.open exec_path, "w" do |f|
|
327
|
+
f.puts "#!/usr/bin/ruby"
|
328
328
|
end
|
329
329
|
|
330
330
|
installer.gem_dir = @spec.gem_dir
|
@@ -332,7 +332,7 @@ gem 'other', version
|
|
332
332
|
installer.generate_bin
|
333
333
|
|
334
334
|
assert_directory_exists util_inst_bindir
|
335
|
-
installed_exec = File.join(util_inst_bindir,
|
335
|
+
installed_exec = File.join(util_inst_bindir, "executable")
|
336
336
|
assert_path_exist installed_exec
|
337
337
|
assert_equal mask, File.stat(installed_exec).mode unless win_platform?
|
338
338
|
|
@@ -352,7 +352,7 @@ gem 'other', version
|
|
352
352
|
:install_dir => "/non/existent",
|
353
353
|
}
|
354
354
|
|
355
|
-
inst = Gem::Installer.at
|
355
|
+
inst = Gem::Installer.at "", options
|
356
356
|
|
357
357
|
Gem::Installer.path_warning = false
|
358
358
|
|
@@ -375,7 +375,7 @@ gem 'other', version
|
|
375
375
|
|
376
376
|
installer.generate_bin
|
377
377
|
assert_directory_exists util_inst_bindir
|
378
|
-
installed_exec = File.join util_inst_bindir,
|
378
|
+
installed_exec = File.join util_inst_bindir, "executable"
|
379
379
|
assert_path_exist installed_exec
|
380
380
|
assert_equal mask, File.stat(installed_exec).mode unless win_platform?
|
381
381
|
|
@@ -391,10 +391,10 @@ gem 'other', version
|
|
391
391
|
util_make_exec
|
392
392
|
installer.gem_dir = @spec.gem_dir
|
393
393
|
|
394
|
-
Gem::Installer.exec_format =
|
394
|
+
Gem::Installer.exec_format = "foo-%s-bar"
|
395
395
|
installer.generate_bin
|
396
396
|
assert_directory_exists util_inst_bindir
|
397
|
-
installed_exec = File.join util_inst_bindir,
|
397
|
+
installed_exec = File.join util_inst_bindir, "foo-executable-bar"
|
398
398
|
assert_path_exist installed_exec
|
399
399
|
ensure
|
400
400
|
Gem::Installer.exec_format = nil
|
@@ -407,10 +407,10 @@ gem 'other', version
|
|
407
407
|
util_make_exec
|
408
408
|
installer.gem_dir = @spec.gem_dir
|
409
409
|
|
410
|
-
Gem::Installer.exec_format =
|
410
|
+
Gem::Installer.exec_format = "foo-%s-bar"
|
411
411
|
installer.generate_bin
|
412
412
|
assert_directory_exists util_inst_bindir
|
413
|
-
installed_exec = File.join util_inst_bindir,
|
413
|
+
installed_exec = File.join util_inst_bindir, "executable"
|
414
414
|
assert_path_exist installed_exec
|
415
415
|
ensure
|
416
416
|
Gem::Installer.exec_format = nil
|
@@ -422,19 +422,19 @@ gem 'other', version
|
|
422
422
|
installer.wrappers = true
|
423
423
|
|
424
424
|
gem_dir = File.join("#{@gemhome}2", "gems", @spec.full_name)
|
425
|
-
gem_bindir = File.join gem_dir,
|
425
|
+
gem_bindir = File.join gem_dir, "bin"
|
426
426
|
FileUtils.mkdir_p gem_bindir
|
427
|
-
File.open File.join(gem_bindir,
|
427
|
+
File.open File.join(gem_bindir, "executable"), "w" do |f|
|
428
428
|
f.puts "#!/bin/ruby"
|
429
429
|
end
|
430
430
|
|
431
431
|
installer.gem_home = "#{@gemhome}2"
|
432
432
|
installer.gem_dir = gem_dir
|
433
|
-
installer.bin_dir = File.join "#{@gemhome}2",
|
433
|
+
installer.bin_dir = File.join "#{@gemhome}2", "bin"
|
434
434
|
|
435
435
|
installer.generate_bin
|
436
436
|
|
437
|
-
installed_exec = File.join("#{@gemhome}2", "bin",
|
437
|
+
installed_exec = File.join("#{@gemhome}2", "bin", "executable")
|
438
438
|
assert_path_exist installed_exec
|
439
439
|
assert_equal mask, File.stat(installed_exec).mode unless win_platform?
|
440
440
|
|
@@ -450,7 +450,7 @@ gem 'other', version
|
|
450
450
|
installer.wrappers = true
|
451
451
|
installer.generate_bin
|
452
452
|
|
453
|
-
assert_path_not_exist util_inst_bindir,
|
453
|
+
assert_path_not_exist util_inst_bindir, "bin dir was created when not needed"
|
454
454
|
end
|
455
455
|
|
456
456
|
def test_generate_bin_script_no_perms
|
@@ -462,9 +462,9 @@ gem 'other', version
|
|
462
462
|
Dir.mkdir util_inst_bindir
|
463
463
|
|
464
464
|
if win_platform?
|
465
|
-
pend(
|
465
|
+
pend("test_generate_bin_script_no_perms skipped on MS Windows")
|
466
466
|
elsif Process.uid.zero?
|
467
|
-
pend(
|
467
|
+
pend("test_generate_bin_script_no_perms skipped in root privilege")
|
468
468
|
else
|
469
469
|
FileUtils.chmod 0000, util_inst_bindir
|
470
470
|
|
@@ -473,7 +473,7 @@ gem 'other', version
|
|
473
473
|
end
|
474
474
|
end
|
475
475
|
ensure
|
476
|
-
FileUtils.chmod 0755, util_inst_bindir unless ($DEBUG
|
476
|
+
FileUtils.chmod 0755, util_inst_bindir unless ($DEBUG || win_platform?)
|
477
477
|
end
|
478
478
|
|
479
479
|
def test_generate_bin_script_no_shebang
|
@@ -482,16 +482,16 @@ gem 'other', version
|
|
482
482
|
installer.wrappers = true
|
483
483
|
@spec.executables = %w[executable]
|
484
484
|
|
485
|
-
gem_dir = File.join @gemhome,
|
486
|
-
gem_bindir = File.join gem_dir,
|
485
|
+
gem_dir = File.join @gemhome, "gems", @spec.full_name
|
486
|
+
gem_bindir = File.join gem_dir, "bin"
|
487
487
|
FileUtils.mkdir_p gem_bindir
|
488
|
-
File.open File.join(gem_bindir,
|
488
|
+
File.open File.join(gem_bindir, "executable"), "w" do |f|
|
489
489
|
f.puts "blah blah blah"
|
490
490
|
end
|
491
491
|
|
492
492
|
installer.generate_bin
|
493
493
|
|
494
|
-
installed_exec = File.join @gemhome,
|
494
|
+
installed_exec = File.join @gemhome, "bin", "executable"
|
495
495
|
assert_path_exist installed_exec
|
496
496
|
assert_equal mask, File.stat(installed_exec).mode unless win_platform?
|
497
497
|
|
@@ -507,9 +507,9 @@ gem 'other', version
|
|
507
507
|
installer.wrappers = true
|
508
508
|
util_make_exec
|
509
509
|
installer.gem_dir = @spec.gem_dir
|
510
|
-
installed_exec = File.join(util_inst_bindir,
|
510
|
+
installed_exec = File.join(util_inst_bindir, "executable")
|
511
511
|
|
512
|
-
real_exec = File.join @spec.gem_dir,
|
512
|
+
real_exec = File.join @spec.gem_dir, "bin", "executable"
|
513
513
|
|
514
514
|
# fake --no-wrappers for previous install
|
515
515
|
unless Gem.win_platform?
|
@@ -525,7 +525,7 @@ gem 'other', version
|
|
525
525
|
assert_match %r{generated by RubyGems}, File.read(installed_exec)
|
526
526
|
|
527
527
|
refute_match %r{generated by RubyGems}, File.read(real_exec),
|
528
|
-
|
528
|
+
"real executable overwritten"
|
529
529
|
end
|
530
530
|
|
531
531
|
def test_generate_bin_symlink
|
@@ -539,9 +539,9 @@ gem 'other', version
|
|
539
539
|
|
540
540
|
installer.generate_bin
|
541
541
|
assert_directory_exists util_inst_bindir
|
542
|
-
installed_exec = File.join util_inst_bindir,
|
542
|
+
installed_exec = File.join util_inst_bindir, "executable"
|
543
543
|
assert_equal true, File.symlink?(installed_exec)
|
544
|
-
assert_equal(File.join(@spec.gem_dir,
|
544
|
+
assert_equal(File.join(@spec.gem_dir, "bin", "executable"),
|
545
545
|
File.readlink(installed_exec))
|
546
546
|
end
|
547
547
|
|
@@ -566,9 +566,9 @@ gem 'other', version
|
|
566
566
|
Dir.mkdir util_inst_bindir
|
567
567
|
|
568
568
|
if win_platform?
|
569
|
-
pend(
|
569
|
+
pend("test_generate_bin_symlink_no_perms skipped on MS Windows")
|
570
570
|
elsif Process.uid.zero?
|
571
|
-
pend(
|
571
|
+
pend("test_user_install_disabled_read_only test skipped in root privilege")
|
572
572
|
else
|
573
573
|
FileUtils.chmod 0000, util_inst_bindir
|
574
574
|
|
@@ -577,7 +577,7 @@ gem 'other', version
|
|
577
577
|
end
|
578
578
|
end
|
579
579
|
ensure
|
580
|
-
FileUtils.chmod 0755, util_inst_bindir unless ($DEBUG
|
580
|
+
FileUtils.chmod 0755, util_inst_bindir unless ($DEBUG || win_platform?)
|
581
581
|
end
|
582
582
|
|
583
583
|
def test_generate_bin_symlink_update_newer
|
@@ -590,24 +590,24 @@ gem 'other', version
|
|
590
590
|
installer.gem_dir = @spec.gem_dir
|
591
591
|
|
592
592
|
installer.generate_bin
|
593
|
-
installed_exec = File.join(util_inst_bindir,
|
594
|
-
assert_equal(File.join(@spec.gem_dir,
|
593
|
+
installed_exec = File.join(util_inst_bindir, "executable")
|
594
|
+
assert_equal(File.join(@spec.gem_dir, "bin", "executable"),
|
595
595
|
File.readlink(installed_exec))
|
596
596
|
|
597
597
|
@spec = Gem::Specification.new do |s|
|
598
|
-
s.files = [
|
598
|
+
s.files = ["lib/code.rb"]
|
599
599
|
s.name = "a"
|
600
600
|
s.version = "3"
|
601
601
|
s.summary = "summary"
|
602
602
|
s.description = "desc"
|
603
|
-
s.require_path =
|
603
|
+
s.require_path = "lib"
|
604
604
|
end
|
605
605
|
|
606
606
|
util_make_exec
|
607
607
|
installer.gem_dir = @spec.gem_dir
|
608
608
|
installer.generate_bin
|
609
|
-
installed_exec = File.join(util_inst_bindir,
|
610
|
-
assert_equal(@spec.bin_file(
|
609
|
+
installed_exec = File.join(util_inst_bindir, "executable")
|
610
|
+
assert_equal(@spec.bin_file("executable"),
|
611
611
|
File.readlink(installed_exec),
|
612
612
|
"Ensure symlink moved to latest version")
|
613
613
|
end
|
@@ -622,17 +622,17 @@ gem 'other', version
|
|
622
622
|
installer.gem_dir = @spec.gem_dir
|
623
623
|
|
624
624
|
installer.generate_bin
|
625
|
-
installed_exec = File.join(util_inst_bindir,
|
626
|
-
assert_equal(File.join(@spec.gem_dir,
|
625
|
+
installed_exec = File.join(util_inst_bindir, "executable")
|
626
|
+
assert_equal(File.join(@spec.gem_dir, "bin", "executable"),
|
627
627
|
File.readlink(installed_exec))
|
628
628
|
|
629
629
|
spec = Gem::Specification.new do |s|
|
630
|
-
s.files = [
|
630
|
+
s.files = ["lib/code.rb"]
|
631
631
|
s.name = "a"
|
632
632
|
s.version = "1"
|
633
633
|
s.summary = "summary"
|
634
634
|
s.description = "desc"
|
635
|
-
s.require_path =
|
635
|
+
s.require_path = "lib"
|
636
636
|
end
|
637
637
|
|
638
638
|
util_make_exec
|
@@ -643,8 +643,8 @@ gem 'other', version
|
|
643
643
|
|
644
644
|
installer.generate_bin
|
645
645
|
|
646
|
-
installed_exec = File.join util_inst_bindir,
|
647
|
-
expected = File.join @spec.gem_dir,
|
646
|
+
installed_exec = File.join util_inst_bindir, "executable"
|
647
|
+
expected = File.join @spec.gem_dir, "bin", "executable"
|
648
648
|
assert_equal(expected,
|
649
649
|
File.readlink(installed_exec),
|
650
650
|
"Ensure symlink not moved")
|
@@ -661,16 +661,16 @@ gem 'other', version
|
|
661
661
|
|
662
662
|
installer.generate_bin
|
663
663
|
|
664
|
-
installed_exec = File.join util_inst_bindir,
|
664
|
+
installed_exec = File.join util_inst_bindir, "executable"
|
665
665
|
assert_path_exist installed_exec
|
666
666
|
|
667
667
|
@spec = Gem::Specification.new do |s|
|
668
|
-
s.files = [
|
668
|
+
s.files = ["lib/code.rb"]
|
669
669
|
s.name = "a"
|
670
670
|
s.version = "3"
|
671
671
|
s.summary = "summary"
|
672
672
|
s.description = "desc"
|
673
|
-
s.require_path =
|
673
|
+
s.require_path = "lib"
|
674
674
|
end
|
675
675
|
util_make_exec
|
676
676
|
|
@@ -680,8 +680,8 @@ gem 'other', version
|
|
680
680
|
|
681
681
|
installer.generate_bin
|
682
682
|
|
683
|
-
installed_exec = File.join util_inst_bindir,
|
684
|
-
assert_equal(@spec.bin_file(
|
683
|
+
installed_exec = File.join util_inst_bindir, "executable"
|
684
|
+
assert_equal(@spec.bin_file("executable"),
|
685
685
|
File.readlink(installed_exec),
|
686
686
|
"Ensure symlink moved to latest version")
|
687
687
|
end
|
@@ -691,7 +691,7 @@ gem 'other', version
|
|
691
691
|
Gem.win_platform = true
|
692
692
|
old_alt_separator = File::ALT_SEPARATOR
|
693
693
|
File.__send__(:remove_const, :ALT_SEPARATOR)
|
694
|
-
File.const_set(:ALT_SEPARATOR,
|
694
|
+
File.const_set(:ALT_SEPARATOR, "\\")
|
695
695
|
|
696
696
|
installer = setup_base_installer
|
697
697
|
|
@@ -704,7 +704,7 @@ gem 'other', version
|
|
704
704
|
end
|
705
705
|
|
706
706
|
assert_directory_exists util_inst_bindir
|
707
|
-
installed_exec = File.join(util_inst_bindir,
|
707
|
+
installed_exec = File.join(util_inst_bindir, "executable")
|
708
708
|
assert_path_exist installed_exec
|
709
709
|
|
710
710
|
if symlink_supported?
|
@@ -726,7 +726,7 @@ gem 'other', version
|
|
726
726
|
def test_generate_bin_uses_default_shebang
|
727
727
|
pend "Symlinks not supported or not enabled" unless symlink_supported?
|
728
728
|
|
729
|
-
load_relative
|
729
|
+
load_relative "no" do
|
730
730
|
installer = setup_base_installer
|
731
731
|
|
732
732
|
installer.wrappers = true
|
@@ -756,13 +756,16 @@ gem 'other', version
|
|
756
756
|
end
|
757
757
|
end
|
758
758
|
|
759
|
-
|
759
|
+
errors = @ui.error.split("\n")
|
760
|
+
assert_equal "WARNING: ascii_binder-0.1.10.1 ships with a dangling symlink named bin/ascii_binder pointing to missing bin/asciibinder file. Ignoring", errors.shift
|
761
|
+
assert_empty errors
|
762
|
+
|
760
763
|
assert_empty @ui.output
|
761
764
|
end
|
762
765
|
|
763
766
|
def test_generate_plugins
|
764
767
|
installer = util_setup_installer do |spec|
|
765
|
-
write_file File.join(@tempdir,
|
768
|
+
write_file File.join(@tempdir, "lib", "rubygems_plugin.rb") do |io|
|
766
769
|
io.write "puts __FILE__"
|
767
770
|
end
|
768
771
|
|
@@ -773,18 +776,18 @@ gem 'other', version
|
|
773
776
|
installer.install
|
774
777
|
end
|
775
778
|
|
776
|
-
plugin_path = File.join Gem.plugindir,
|
779
|
+
plugin_path = File.join Gem.plugindir, "a_plugin.rb"
|
777
780
|
|
778
781
|
FileUtils.rm plugin_path
|
779
782
|
|
780
783
|
installer.generate_plugins
|
781
784
|
|
782
|
-
assert File.exist?(plugin_path),
|
785
|
+
assert File.exist?(plugin_path), "plugin not written"
|
783
786
|
end
|
784
787
|
|
785
788
|
def test_generate_plugins_with_install_dir
|
786
|
-
spec = quick_gem
|
787
|
-
write_file File.join(@tempdir,
|
789
|
+
spec = quick_gem "a" do |s|
|
790
|
+
write_file File.join(@tempdir, "lib", "rubygems_plugin.rb") do |io|
|
788
791
|
io.write "puts __FILE__"
|
789
792
|
end
|
790
793
|
|
@@ -793,17 +796,17 @@ gem 'other', version
|
|
793
796
|
|
794
797
|
util_build_gem spec
|
795
798
|
|
796
|
-
plugin_path = File.join "#{@gemhome}2",
|
799
|
+
plugin_path = File.join "#{@gemhome}2", "plugins", "a_plugin.rb"
|
797
800
|
installer = util_installer spec, "#{@gemhome}2"
|
798
801
|
|
799
802
|
assert_equal spec, installer.install
|
800
803
|
|
801
|
-
assert File.exist?(plugin_path),
|
804
|
+
assert File.exist?(plugin_path), "plugin not written to install_dir"
|
802
805
|
end
|
803
806
|
|
804
807
|
def test_generate_plugins_with_user_install
|
805
|
-
spec = quick_gem
|
806
|
-
write_file File.join(@tempdir,
|
808
|
+
spec = quick_gem "a" do |s|
|
809
|
+
write_file File.join(@tempdir, "lib", "rubygems_plugin.rb") do |io|
|
807
810
|
io.write "puts __FILE__"
|
808
811
|
end
|
809
812
|
|
@@ -813,19 +816,19 @@ gem 'other', version
|
|
813
816
|
util_build_gem spec
|
814
817
|
|
815
818
|
File.chmod(0555, Gem.plugindir)
|
816
|
-
system_path = File.join(Gem.plugindir,
|
817
|
-
user_path = File.join(Gem.plugindir(Gem.user_dir),
|
819
|
+
system_path = File.join(Gem.plugindir, "a_plugin.rb")
|
820
|
+
user_path = File.join(Gem.plugindir(Gem.user_dir), "a_plugin.rb")
|
818
821
|
installer = util_installer spec, Gem.dir, :user
|
819
822
|
|
820
823
|
assert_equal spec, installer.install
|
821
824
|
|
822
|
-
assert !File.exist?(system_path),
|
823
|
-
assert File.exist?(user_path),
|
825
|
+
assert !File.exist?(system_path), "plugin incorrectly written to system plugins_dir"
|
826
|
+
assert File.exist?(user_path), "plugin not written to user plugins_dir"
|
824
827
|
end
|
825
828
|
|
826
829
|
def test_generate_plugins_with_build_root
|
827
|
-
spec = quick_gem
|
828
|
-
write_file File.join(@tempdir,
|
830
|
+
spec = quick_gem "a" do |s|
|
831
|
+
write_file File.join(@tempdir, "lib", "rubygems_plugin.rb") do |io|
|
829
832
|
io.write "puts __FILE__"
|
830
833
|
end
|
831
834
|
|
@@ -835,17 +838,17 @@ gem 'other', version
|
|
835
838
|
util_build_gem spec
|
836
839
|
|
837
840
|
File.chmod(0555, Gem.plugindir)
|
838
|
-
system_path = File.join(Gem.plugindir,
|
841
|
+
system_path = File.join(Gem.plugindir, "a_plugin.rb")
|
839
842
|
|
840
|
-
build_root = File.join(@tempdir,
|
841
|
-
build_root_path = File.join(build_root, Gem.plugindir.gsub(/^[a-zA-Z]:/,
|
843
|
+
build_root = File.join(@tempdir, "build_root")
|
844
|
+
build_root_path = File.join(build_root, Gem.plugindir.gsub(/^[a-zA-Z]:/, ""), "a_plugin.rb")
|
842
845
|
|
843
846
|
installer = Gem::Installer.at spec.cache_file, :build_root => build_root
|
844
847
|
|
845
848
|
assert_equal spec, installer.install
|
846
849
|
|
847
|
-
assert !File.exist?(system_path),
|
848
|
-
assert File.exist?(build_root_path),
|
850
|
+
assert !File.exist?(system_path), "plugin written incorrect written to system plugins_dir"
|
851
|
+
assert File.exist?(build_root_path), "plugin not written to build_root"
|
849
852
|
|
850
853
|
refute_includes File.read(build_root_path), build_root
|
851
854
|
end
|
@@ -853,49 +856,49 @@ gem 'other', version
|
|
853
856
|
def test_keeps_plugins_up_to_date
|
854
857
|
# NOTE: version a-2 is already installed by setup hooks
|
855
858
|
|
856
|
-
write_file File.join(@tempdir,
|
859
|
+
write_file File.join(@tempdir, "lib", "rubygems_plugin.rb") do |io|
|
857
860
|
io.write "puts __FILE__"
|
858
861
|
end
|
859
862
|
|
860
863
|
build_rake_in do
|
861
864
|
util_setup_installer do |spec|
|
862
|
-
spec.version =
|
865
|
+
spec.version = "1"
|
863
866
|
spec.files += %w[lib/rubygems_plugin.rb]
|
864
867
|
end.install
|
865
868
|
|
866
|
-
plugin_path = File.join Gem.plugindir,
|
867
|
-
refute File.exist?(plugin_path),
|
869
|
+
plugin_path = File.join Gem.plugindir, "a_plugin.rb"
|
870
|
+
refute File.exist?(plugin_path), "old version installed while newer version without plugin also installed, but plugin written"
|
868
871
|
|
869
872
|
util_setup_installer do |spec|
|
870
|
-
spec.version =
|
873
|
+
spec.version = "2"
|
871
874
|
spec.files += %w[lib/rubygems_plugin.rb]
|
872
875
|
end.install
|
873
876
|
|
874
|
-
plugin_path = File.join Gem.plugindir,
|
875
|
-
assert File.exist?(plugin_path),
|
876
|
-
assert_match %r{\Arequire.*a-2/lib/rubygems_plugin\.rb}, File.read(plugin_path),
|
877
|
+
plugin_path = File.join Gem.plugindir, "a_plugin.rb"
|
878
|
+
assert File.exist?(plugin_path), "latest version reinstalled, but plugin not written"
|
879
|
+
assert_match %r{\Arequire.*a-2/lib/rubygems_plugin\.rb}, File.read(plugin_path), "written plugin has incorrect content"
|
877
880
|
|
878
881
|
util_setup_installer do |spec|
|
879
|
-
spec.version =
|
882
|
+
spec.version = "3"
|
880
883
|
spec.files += %w[lib/rubygems_plugin.rb]
|
881
884
|
end.install
|
882
885
|
|
883
|
-
plugin_path = File.join Gem.plugindir,
|
884
|
-
assert File.exist?(plugin_path),
|
885
|
-
assert_match %r{\Arequire.*a-3/lib/rubygems_plugin\.rb}, File.read(plugin_path),
|
886
|
+
plugin_path = File.join Gem.plugindir, "a_plugin.rb"
|
887
|
+
assert File.exist?(plugin_path), "latest version installed, but plugin removed"
|
888
|
+
assert_match %r{\Arequire.*a-3/lib/rubygems_plugin\.rb}, File.read(plugin_path), "written plugin has incorrect content"
|
886
889
|
|
887
890
|
util_setup_installer do |spec|
|
888
|
-
spec.version =
|
891
|
+
spec.version = "4"
|
889
892
|
end.install
|
890
893
|
|
891
|
-
refute File.exist?(plugin_path),
|
894
|
+
refute File.exist?(plugin_path), "new version installed without a plugin while older version with a plugin installed, but plugin not removed"
|
892
895
|
end
|
893
896
|
end
|
894
897
|
|
895
898
|
def test_generates_plugins_dir_under_install_dir_if_not_there
|
896
899
|
Gem.use_paths "#{@gemhome}2" # Set GEM_HOME to an uninitialized repo
|
897
900
|
|
898
|
-
@spec = util_spec
|
901
|
+
@spec = util_spec "a"
|
899
902
|
|
900
903
|
path = Gem::Package.build @spec
|
901
904
|
|
@@ -904,8 +907,8 @@ gem 'other', version
|
|
904
907
|
end
|
905
908
|
|
906
909
|
def test_initialize
|
907
|
-
spec = util_spec
|
908
|
-
s.platform = Gem::Platform.new
|
910
|
+
spec = util_spec "a" do |s|
|
911
|
+
s.platform = Gem::Platform.new "mswin32"
|
909
912
|
end
|
910
913
|
|
911
914
|
gem = File.join @tempdir, spec.file_name
|
@@ -916,8 +919,8 @@ gem 'other', version
|
|
916
919
|
|
917
920
|
installer = Gem::Installer.at gem
|
918
921
|
|
919
|
-
assert_equal File.join(@gemhome,
|
920
|
-
assert_equal File.join(@gemhome,
|
922
|
+
assert_equal File.join(@gemhome, "gems", spec.full_name), installer.gem_dir
|
923
|
+
assert_equal File.join(@gemhome, "bin"), installer.bin_dir
|
921
924
|
end
|
922
925
|
|
923
926
|
def test_initialize_user_install
|
@@ -925,7 +928,7 @@ gem 'other', version
|
|
925
928
|
|
926
929
|
installer = Gem::Installer.at @gem, :user_install => true
|
927
930
|
|
928
|
-
assert_equal File.join(Gem.user_dir,
|
931
|
+
assert_equal File.join(Gem.user_dir, "gems", @spec.full_name),
|
929
932
|
installer.gem_dir
|
930
933
|
assert_equal Gem.bindir(Gem.user_dir), installer.bin_dir
|
931
934
|
end
|
@@ -936,7 +939,7 @@ gem 'other', version
|
|
936
939
|
installer =
|
937
940
|
Gem::Installer.at @gem, :user_install => true, :bin_dir => @tempdir
|
938
941
|
|
939
|
-
assert_equal File.join(Gem.user_dir,
|
942
|
+
assert_equal File.join(Gem.user_dir, "gems", @spec.full_name),
|
940
943
|
installer.gem_dir
|
941
944
|
assert_equal @tempdir, installer.bin_dir
|
942
945
|
end
|
@@ -944,26 +947,26 @@ gem 'other', version
|
|
944
947
|
def test_install
|
945
948
|
installer = util_setup_installer
|
946
949
|
|
947
|
-
gemdir = File.join @gemhome,
|
948
|
-
cache_file = File.join @gemhome,
|
949
|
-
stub_exe = File.join @gemhome,
|
950
|
-
rakefile = File.join gemdir,
|
951
|
-
spec_file = File.join @gemhome,
|
950
|
+
gemdir = File.join @gemhome, "gems", @spec.full_name
|
951
|
+
cache_file = File.join @gemhome, "cache", @spec.file_name
|
952
|
+
stub_exe = File.join @gemhome, "bin", "executable"
|
953
|
+
rakefile = File.join gemdir, "ext", "a", "Rakefile"
|
954
|
+
spec_file = File.join @gemhome, "specifications", @spec.spec_name
|
952
955
|
|
953
956
|
Gem.pre_install do
|
954
|
-
assert_path_not_exist cache_file,
|
957
|
+
assert_path_not_exist cache_file, "cache file must not exist yet"
|
955
958
|
true
|
956
959
|
end
|
957
960
|
|
958
961
|
Gem.post_build do
|
959
|
-
assert_path_exist gemdir,
|
960
|
-
assert_path_exist rakefile,
|
961
|
-
assert_path_not_exist stub_exe,
|
962
|
+
assert_path_exist gemdir, "gem install dir must exist"
|
963
|
+
assert_path_exist rakefile, "gem executable must exist"
|
964
|
+
assert_path_not_exist stub_exe, "gem executable must not exist"
|
962
965
|
true
|
963
966
|
end
|
964
967
|
|
965
968
|
Gem.post_install do
|
966
|
-
assert_path_exist cache_file,
|
969
|
+
assert_path_exist cache_file, "cache file must exist"
|
967
970
|
end
|
968
971
|
|
969
972
|
@newspec = nil
|
@@ -975,15 +978,15 @@ gem 'other', version
|
|
975
978
|
|
976
979
|
assert_equal @spec, @newspec
|
977
980
|
assert_path_exist gemdir
|
978
|
-
assert_path_exist stub_exe,
|
981
|
+
assert_path_exist stub_exe, "gem executable must exist"
|
979
982
|
|
980
|
-
exe = File.join gemdir,
|
983
|
+
exe = File.join gemdir, "bin", "executable"
|
981
984
|
assert_path_exist exe
|
982
985
|
|
983
986
|
exe_mode = File.stat(exe).mode & 0111
|
984
987
|
assert_equal 0111, exe_mode, "0%o" % exe_mode unless win_platform?
|
985
988
|
|
986
|
-
assert_path_exist File.join gemdir,
|
989
|
+
assert_path_exist File.join gemdir, "lib", "code.rb"
|
987
990
|
|
988
991
|
assert_path_exist rakefile
|
989
992
|
|
@@ -1000,7 +1003,7 @@ gem 'other', version
|
|
1000
1003
|
|
1001
1004
|
installer.wrappers = true
|
1002
1005
|
|
1003
|
-
gemdir = File.join @gemhome,
|
1006
|
+
gemdir = File.join @gemhome, "gems", @spec.full_name
|
1004
1007
|
|
1005
1008
|
@newspec = nil
|
1006
1009
|
build_rake_in do
|
@@ -1009,7 +1012,7 @@ gem 'other', version
|
|
1009
1012
|
end
|
1010
1013
|
end
|
1011
1014
|
|
1012
|
-
exe = File.join gemdir,
|
1015
|
+
exe = File.join gemdir, "bin", "executable"
|
1013
1016
|
|
1014
1017
|
e = assert_raise RuntimeError do
|
1015
1018
|
instance_eval File.read(exe)
|
@@ -1023,10 +1026,10 @@ gem 'other', version
|
|
1023
1026
|
|
1024
1027
|
# build old version that has a bin file
|
1025
1028
|
installer = util_setup_gem do |spec|
|
1026
|
-
File.open File.join(
|
1029
|
+
File.open File.join("bin", "executable"), "w" do |f|
|
1027
1030
|
f.puts "require 'code'"
|
1028
1031
|
end
|
1029
|
-
File.open File.join(
|
1032
|
+
File.open File.join("lib", "code.rb"), "w" do |f|
|
1030
1033
|
f.puts 'raise "I have an executable"'
|
1031
1034
|
end
|
1032
1035
|
end
|
@@ -1038,15 +1041,15 @@ gem 'other', version
|
|
1038
1041
|
end
|
1039
1042
|
end
|
1040
1043
|
|
1041
|
-
old_bin_file = File.join installer.bin_dir,
|
1044
|
+
old_bin_file = File.join installer.bin_dir, "executable"
|
1042
1045
|
|
1043
1046
|
# build new version that doesn't have a bin file
|
1044
1047
|
installer = util_setup_gem do |spec|
|
1045
|
-
FileUtils.rm File.join(
|
1046
|
-
spec.files.delete File.join(
|
1047
|
-
spec.executables.delete
|
1048
|
+
FileUtils.rm File.join("bin", "executable")
|
1049
|
+
spec.files.delete File.join("bin", "executable")
|
1050
|
+
spec.executables.delete "executable"
|
1048
1051
|
spec.version = @spec.version.bump
|
1049
|
-
File.open File.join(
|
1052
|
+
File.open File.join("lib", "code.rb"), "w" do |f|
|
1050
1053
|
f.puts 'raise "I do not have an executable"'
|
1051
1054
|
end
|
1052
1055
|
end
|
@@ -1063,7 +1066,7 @@ gem 'other', version
|
|
1063
1066
|
|
1064
1067
|
# We expect the bin stub to activate the version that actually contains
|
1065
1068
|
# the binstub.
|
1066
|
-
assert_match(
|
1069
|
+
assert_match("I have an executable", e.message)
|
1067
1070
|
end
|
1068
1071
|
|
1069
1072
|
def test_install_creates_binstub_that_understand_version
|
@@ -1078,7 +1081,7 @@ gem 'other', version
|
|
1078
1081
|
end
|
1079
1082
|
end
|
1080
1083
|
|
1081
|
-
exe = File.join @gemhome,
|
1084
|
+
exe = File.join @gemhome, "bin", "executable"
|
1082
1085
|
|
1083
1086
|
ARGV.unshift "_3.0_"
|
1084
1087
|
|
@@ -1096,17 +1099,17 @@ gem 'other', version
|
|
1096
1099
|
end
|
1097
1100
|
|
1098
1101
|
def test_install_creates_binstub_that_prefers_user_installed_gem_to_default
|
1099
|
-
default_spec = new_default_spec(
|
1100
|
-
default_spec.executables =
|
1102
|
+
default_spec = new_default_spec("default", "2", nil, "exe/executable")
|
1103
|
+
default_spec.executables = "executable"
|
1101
1104
|
install_default_gems default_spec
|
1102
1105
|
|
1103
|
-
exe = File.join @gemhome,
|
1106
|
+
exe = File.join @gemhome, "bin", "executable"
|
1104
1107
|
|
1105
1108
|
assert_path_exist exe, "default gem's executable not installed"
|
1106
1109
|
|
1107
1110
|
installer = util_setup_installer do |spec|
|
1108
|
-
spec.name =
|
1109
|
-
spec.version =
|
1111
|
+
spec.name = "default"
|
1112
|
+
spec.version = "2"
|
1110
1113
|
end
|
1111
1114
|
|
1112
1115
|
util_clear_gems
|
@@ -1139,7 +1142,7 @@ gem 'other', version
|
|
1139
1142
|
end
|
1140
1143
|
end
|
1141
1144
|
|
1142
|
-
exe = File.join @gemhome,
|
1145
|
+
exe = File.join @gemhome, "bin", "executable"
|
1143
1146
|
|
1144
1147
|
extra_arg = "\xE4pfel".dup.force_encoding("UTF-8")
|
1145
1148
|
ARGV.unshift extra_arg
|
@@ -1166,16 +1169,16 @@ gem 'other', version
|
|
1166
1169
|
end
|
1167
1170
|
end
|
1168
1171
|
|
1169
|
-
gemdir = File.join(@gemhome,
|
1170
|
-
assert_path_exist File.join gemdir,
|
1172
|
+
gemdir = File.join(@gemhome, "gems", @spec.full_name)
|
1173
|
+
assert_path_exist File.join gemdir, "lib", "code.rb"
|
1171
1174
|
|
1172
1175
|
installer = util_setup_installer
|
1173
1176
|
|
1174
1177
|
# Morph spec to have lib/other.rb instead of code.rb and recreate
|
1175
|
-
@spec.files = File.join(
|
1178
|
+
@spec.files = File.join("lib", "other.rb")
|
1176
1179
|
Dir.chdir @tempdir do
|
1177
|
-
File.open File.join(
|
1178
|
-
f.puts
|
1180
|
+
File.open File.join("lib", "other.rb"), "w" do |f|
|
1181
|
+
f.puts "1"
|
1179
1182
|
end
|
1180
1183
|
|
1181
1184
|
use_ui ui do
|
@@ -1190,14 +1193,14 @@ gem 'other', version
|
|
1190
1193
|
end
|
1191
1194
|
end
|
1192
1195
|
|
1193
|
-
assert_path_exist File.join gemdir,
|
1194
|
-
assert_path_not_exist File.join gemdir,
|
1196
|
+
assert_path_exist File.join gemdir, "lib", "other.rb"
|
1197
|
+
assert_path_not_exist File.join gemdir, "lib", "code.rb",
|
1195
1198
|
"code.rb from prior install of same gem shouldn't remain here"
|
1196
1199
|
end
|
1197
1200
|
|
1198
1201
|
def test_install_force
|
1199
|
-
_, missing_dep_gem = util_gem
|
1200
|
-
s.add_dependency
|
1202
|
+
_, missing_dep_gem = util_gem "missing_dep", "1" do |s|
|
1203
|
+
s.add_dependency "doesnt_exist", "1"
|
1201
1204
|
end
|
1202
1205
|
|
1203
1206
|
use_ui @ui do
|
@@ -1205,12 +1208,12 @@ gem 'other', version
|
|
1205
1208
|
installer.install
|
1206
1209
|
end
|
1207
1210
|
|
1208
|
-
gem_dir = File.join(@gemhome,
|
1211
|
+
gem_dir = File.join(@gemhome, "gems", "missing_dep-1")
|
1209
1212
|
assert_path_exist gem_dir
|
1210
1213
|
end
|
1211
1214
|
|
1212
1215
|
def test_install_build_root
|
1213
|
-
build_root = File.join(@tempdir,
|
1216
|
+
build_root = File.join(@tempdir, "build_root")
|
1214
1217
|
|
1215
1218
|
@gem = setup_base_gem
|
1216
1219
|
installer = Gem::Installer.at @gem, :build_root => build_root
|
@@ -1221,22 +1224,22 @@ gem 'other', version
|
|
1221
1224
|
def test_install_missing_dirs
|
1222
1225
|
installer = setup_base_installer
|
1223
1226
|
|
1224
|
-
FileUtils.rm_rf File.join(Gem.dir,
|
1225
|
-
FileUtils.rm_rf File.join(Gem.dir,
|
1227
|
+
FileUtils.rm_rf File.join(Gem.dir, "doc")
|
1228
|
+
FileUtils.rm_rf File.join(Gem.dir, "specifications")
|
1226
1229
|
|
1227
1230
|
use_ui @ui do
|
1228
1231
|
installer.install
|
1229
1232
|
end
|
1230
1233
|
|
1231
|
-
assert_directory_exists File.join(Gem.dir,
|
1232
|
-
assert_directory_exists File.join(Gem.dir,
|
1234
|
+
assert_directory_exists File.join(Gem.dir, "doc")
|
1235
|
+
assert_directory_exists File.join(Gem.dir, "specifications")
|
1233
1236
|
|
1234
|
-
assert_path_exist File.join @gemhome,
|
1235
|
-
assert_path_exist File.join @gemhome,
|
1237
|
+
assert_path_exist File.join @gemhome, "cache", @spec.file_name
|
1238
|
+
assert_path_exist File.join @gemhome, "specifications", @spec.spec_name
|
1236
1239
|
end
|
1237
1240
|
|
1238
1241
|
def test_install_post_build_false
|
1239
|
-
@spec = util_spec
|
1242
|
+
@spec = util_spec "a"
|
1240
1243
|
|
1241
1244
|
util_build_gem @spec
|
1242
1245
|
|
@@ -1256,10 +1259,10 @@ gem 'other', version
|
|
1256
1259
|
assert_equal "post-build hook at #{location} failed for a-2", e.message
|
1257
1260
|
end
|
1258
1261
|
|
1259
|
-
spec_file = File.join @gemhome,
|
1262
|
+
spec_file = File.join @gemhome, "specifications", @spec.spec_name
|
1260
1263
|
assert_path_not_exist spec_file
|
1261
1264
|
|
1262
|
-
gem_dir = File.join @gemhome,
|
1265
|
+
gem_dir = File.join @gemhome, "gems", @spec.full_name
|
1263
1266
|
assert_path_not_exist gem_dir
|
1264
1267
|
end
|
1265
1268
|
|
@@ -1274,15 +1277,15 @@ gem 'other', version
|
|
1274
1277
|
installer.install
|
1275
1278
|
end
|
1276
1279
|
|
1277
|
-
spec_file = File.join @gemhome,
|
1280
|
+
spec_file = File.join @gemhome, "specifications", @spec.spec_name
|
1278
1281
|
assert_path_exist spec_file
|
1279
1282
|
|
1280
|
-
gem_dir = File.join @gemhome,
|
1283
|
+
gem_dir = File.join @gemhome, "gems", @spec.full_name
|
1281
1284
|
assert_path_exist gem_dir
|
1282
1285
|
end
|
1283
1286
|
|
1284
1287
|
def test_install_pre_install_false
|
1285
|
-
@spec = util_spec
|
1288
|
+
@spec = util_spec "a"
|
1286
1289
|
|
1287
1290
|
util_build_gem @spec
|
1288
1291
|
|
@@ -1302,7 +1305,7 @@ gem 'other', version
|
|
1302
1305
|
assert_equal "pre-install hook at #{location} failed for a-2", e.message
|
1303
1306
|
end
|
1304
1307
|
|
1305
|
-
spec_file = File.join @gemhome,
|
1308
|
+
spec_file = File.join @gemhome, "specifications", @spec.spec_name
|
1306
1309
|
assert_path_not_exist spec_file
|
1307
1310
|
end
|
1308
1311
|
|
@@ -1317,13 +1320,13 @@ gem 'other', version
|
|
1317
1320
|
installer.install
|
1318
1321
|
end
|
1319
1322
|
|
1320
|
-
spec_file = File.join @gemhome,
|
1323
|
+
spec_file = File.join @gemhome, "specifications", @spec.spec_name
|
1321
1324
|
assert_path_exist spec_file
|
1322
1325
|
end
|
1323
1326
|
|
1324
1327
|
def test_install_with_message
|
1325
1328
|
@spec = setup_base_spec
|
1326
|
-
@spec.post_install_message =
|
1329
|
+
@spec.post_install_message = "I am a shiny gem!"
|
1327
1330
|
|
1328
1331
|
use_ui @ui do
|
1329
1332
|
path = Gem::Package.build @spec
|
@@ -1337,7 +1340,7 @@ gem 'other', version
|
|
1337
1340
|
|
1338
1341
|
def test_install_with_skipped_message
|
1339
1342
|
@spec = setup_base_spec
|
1340
|
-
@spec.post_install_message =
|
1343
|
+
@spec.post_install_message = "I am a shiny gem!"
|
1341
1344
|
|
1342
1345
|
use_ui @ui do
|
1343
1346
|
path = Gem::Package.build @spec
|
@@ -1370,7 +1373,7 @@ gem 'other', version
|
|
1370
1373
|
installer.install
|
1371
1374
|
end
|
1372
1375
|
|
1373
|
-
expected_makefile = File.join gemhome2,
|
1376
|
+
expected_makefile = File.join gemhome2, "gems", @spec.full_name, "Makefile"
|
1374
1377
|
|
1375
1378
|
assert_path_exist expected_makefile
|
1376
1379
|
end
|
@@ -1435,11 +1438,11 @@ gem 'other', version
|
|
1435
1438
|
installer.install
|
1436
1439
|
end
|
1437
1440
|
|
1438
|
-
expected_makefile = File.join Gem.user_dir,
|
1441
|
+
expected_makefile = File.join Gem.user_dir, "gems", @spec.full_name, "Makefile"
|
1439
1442
|
|
1440
1443
|
assert_path_exist expected_makefile
|
1441
1444
|
assert_path_exist expected_extension_dir
|
1442
|
-
assert_path_not_exist File.join expected_extension_dir,
|
1445
|
+
assert_path_not_exist File.join expected_extension_dir, "gem_make.out"
|
1443
1446
|
end
|
1444
1447
|
|
1445
1448
|
def test_find_lib_file_after_install
|
@@ -1469,7 +1472,7 @@ gem 'other', version
|
|
1469
1472
|
end
|
1470
1473
|
|
1471
1474
|
Dir.mkdir File.join(@tempdir, "lib")
|
1472
|
-
write_file File.join(@tempdir,
|
1475
|
+
write_file File.join(@tempdir, "lib", "b.rb") do |io|
|
1473
1476
|
io.write "# b.rb"
|
1474
1477
|
end
|
1475
1478
|
|
@@ -1483,14 +1486,14 @@ gem 'other', version
|
|
1483
1486
|
end
|
1484
1487
|
|
1485
1488
|
expected = File.join @spec.full_require_paths.find {|path|
|
1486
|
-
File.exist? File.join path,
|
1487
|
-
},
|
1488
|
-
assert_equal expected, @spec.matches_for_glob(
|
1489
|
+
File.exist? File.join path, "b.rb"
|
1490
|
+
}, "b.rb"
|
1491
|
+
assert_equal expected, @spec.matches_for_glob("b.rb").first
|
1489
1492
|
end
|
1490
1493
|
|
1491
1494
|
def test_install_extension_and_script
|
1492
1495
|
pend "Makefile creation crashes on jruby" if Gem.java_platform?
|
1493
|
-
pend if /mswin/ =~ RUBY_PLATFORM && ENV.key?(
|
1496
|
+
pend if /mswin/ =~ RUBY_PLATFORM && ENV.key?("GITHUB_ACTIONS") # not working from the beginning
|
1494
1497
|
|
1495
1498
|
@spec = setup_base_spec
|
1496
1499
|
@spec.extensions << "extconf.rb"
|
@@ -1566,15 +1569,15 @@ gem 'other', version
|
|
1566
1569
|
end
|
1567
1570
|
assert_path_exist so
|
1568
1571
|
rescue
|
1569
|
-
puts
|
1570
|
-
puts File.read File.join(@gemhome,
|
1571
|
-
puts
|
1572
|
+
puts "-" * 78
|
1573
|
+
puts File.read File.join(@gemhome, "gems", "a-2", "Makefile")
|
1574
|
+
puts "-" * 78
|
1572
1575
|
|
1573
|
-
path = File.join(@gemhome,
|
1576
|
+
path = File.join(@gemhome, "gems", "a-2", "gem_make.out")
|
1574
1577
|
|
1575
1578
|
if File.exist?(path)
|
1576
1579
|
puts File.read(path)
|
1577
|
-
puts
|
1580
|
+
puts "-" * 78
|
1578
1581
|
end
|
1579
1582
|
|
1580
1583
|
raise
|
@@ -1584,12 +1587,12 @@ gem 'other', version
|
|
1584
1587
|
def test_installation_satisfies_dependency_eh
|
1585
1588
|
installer = setup_base_installer
|
1586
1589
|
|
1587
|
-
util_spec
|
1590
|
+
util_spec "a"
|
1588
1591
|
|
1589
|
-
dep = Gem::Dependency.new
|
1592
|
+
dep = Gem::Dependency.new "a", ">= 2"
|
1590
1593
|
assert installer.installation_satisfies_dependency?(dep)
|
1591
1594
|
|
1592
|
-
dep = Gem::Dependency.new
|
1595
|
+
dep = Gem::Dependency.new "a", "> 2"
|
1593
1596
|
refute installer.installation_satisfies_dependency?(dep)
|
1594
1597
|
end
|
1595
1598
|
|
@@ -1598,15 +1601,15 @@ gem 'other', version
|
|
1598
1601
|
installer.options[:development] = true
|
1599
1602
|
installer.options[:dev_shallow] = true
|
1600
1603
|
|
1601
|
-
util_spec
|
1604
|
+
util_spec "a"
|
1602
1605
|
|
1603
|
-
dep = Gem::Dependency.new
|
1606
|
+
dep = Gem::Dependency.new "a", :development
|
1604
1607
|
assert installer.installation_satisfies_dependency?(dep)
|
1605
1608
|
end
|
1606
1609
|
|
1607
1610
|
def test_pre_install_checks_dependencies
|
1608
1611
|
installer = setup_base_installer
|
1609
|
-
@spec.add_dependency
|
1612
|
+
@spec.add_dependency "b", "> 5"
|
1610
1613
|
installer = util_setup_gem
|
1611
1614
|
installer.force = false
|
1612
1615
|
|
@@ -1619,7 +1622,7 @@ gem 'other', version
|
|
1619
1622
|
|
1620
1623
|
def test_pre_install_checks_dependencies_ignore
|
1621
1624
|
installer = util_setup_installer
|
1622
|
-
@spec.add_dependency
|
1625
|
+
@spec.add_dependency "b", "> 5"
|
1623
1626
|
installer.ignore_dependencies = true
|
1624
1627
|
|
1625
1628
|
build_rake_in do
|
@@ -1633,16 +1636,16 @@ gem 'other', version
|
|
1633
1636
|
gemhome2 = "#{@gemhome}2"
|
1634
1637
|
|
1635
1638
|
@gem = setup_base_gem
|
1636
|
-
@spec.add_dependency
|
1639
|
+
@spec.add_dependency "d"
|
1637
1640
|
|
1638
|
-
quick_gem
|
1641
|
+
quick_gem "d", 2
|
1639
1642
|
|
1640
1643
|
gem = File.join @gemhome, @spec.file_name
|
1641
1644
|
|
1642
1645
|
FileUtils.mv @gemhome, gemhome2
|
1643
1646
|
FileUtils.mkdir @gemhome
|
1644
1647
|
|
1645
|
-
FileUtils.mv File.join(gemhome2,
|
1648
|
+
FileUtils.mv File.join(gemhome2, "cache", @spec.file_name), gem
|
1646
1649
|
|
1647
1650
|
# Don't leak any already activated gems into the installer, require
|
1648
1651
|
# that it work everything out on it's own.
|
@@ -1658,7 +1661,7 @@ gem 'other', version
|
|
1658
1661
|
end
|
1659
1662
|
|
1660
1663
|
def test_pre_install_checks_malicious_name
|
1661
|
-
spec = util_spec
|
1664
|
+
spec = util_spec "../malicious", "1"
|
1662
1665
|
def spec.full_name # so the spec is buildable
|
1663
1666
|
"malicious-1"
|
1664
1667
|
end
|
@@ -1666,19 +1669,19 @@ gem 'other', version
|
|
1666
1669
|
|
1667
1670
|
util_build_gem spec
|
1668
1671
|
|
1669
|
-
gem = File.join(@gemhome,
|
1672
|
+
gem = File.join(@gemhome, "cache", spec.file_name)
|
1670
1673
|
|
1671
1674
|
use_ui @ui do
|
1672
1675
|
installer = Gem::Installer.at gem
|
1673
1676
|
e = assert_raise Gem::InstallError do
|
1674
1677
|
installer.pre_install_checks
|
1675
1678
|
end
|
1676
|
-
assert_equal
|
1679
|
+
assert_equal "#<Gem::Specification name=../malicious version=1> has an invalid name", e.message
|
1677
1680
|
end
|
1678
1681
|
end
|
1679
1682
|
|
1680
1683
|
def test_pre_install_checks_malicious_name_before_eval
|
1681
|
-
spec = util_spec "malicious\n::Object.const_set(:FROM_EVAL, true)#",
|
1684
|
+
spec = util_spec "malicious\n::Object.const_set(:FROM_EVAL, true)#", "1"
|
1682
1685
|
def spec.full_name # so the spec is buildable
|
1683
1686
|
"malicious-1"
|
1684
1687
|
end
|
@@ -1686,7 +1689,7 @@ gem 'other', version
|
|
1686
1689
|
|
1687
1690
|
util_build_gem spec
|
1688
1691
|
|
1689
|
-
gem = File.join(@gemhome,
|
1692
|
+
gem = File.join(@gemhome, "cache", spec.file_name)
|
1690
1693
|
|
1691
1694
|
use_ui @ui do
|
1692
1695
|
installer = Gem::Installer.at gem
|
@@ -1699,7 +1702,7 @@ gem 'other', version
|
|
1699
1702
|
end
|
1700
1703
|
|
1701
1704
|
def test_pre_install_checks_malicious_require_paths_before_eval
|
1702
|
-
spec = util_spec "malicious",
|
1705
|
+
spec = util_spec "malicious", "1"
|
1703
1706
|
def spec.full_name # so the spec is buildable
|
1704
1707
|
"malicious-1"
|
1705
1708
|
end
|
@@ -1708,7 +1711,7 @@ gem 'other', version
|
|
1708
1711
|
|
1709
1712
|
util_build_gem spec
|
1710
1713
|
|
1711
|
-
gem = File.join(@gemhome,
|
1714
|
+
gem = File.join(@gemhome, "cache", spec.file_name)
|
1712
1715
|
|
1713
1716
|
use_ui @ui do
|
1714
1717
|
installer = Gem::Installer.at gem
|
@@ -1722,7 +1725,7 @@ gem 'other', version
|
|
1722
1725
|
def test_pre_install_checks_malicious_extensions_before_eval
|
1723
1726
|
pend "mswin environment disallow to create file contained the carriage return code." if Gem.win_platform?
|
1724
1727
|
|
1725
|
-
spec = util_spec "malicious",
|
1728
|
+
spec = util_spec "malicious", "1"
|
1726
1729
|
def spec.full_name # so the spec is buildable
|
1727
1730
|
"malicious-1"
|
1728
1731
|
end
|
@@ -1731,7 +1734,7 @@ gem 'other', version
|
|
1731
1734
|
|
1732
1735
|
util_build_gem spec
|
1733
1736
|
|
1734
|
-
gem = File.join(@gemhome,
|
1737
|
+
gem = File.join(@gemhome, "cache", spec.file_name)
|
1735
1738
|
|
1736
1739
|
use_ui @ui do
|
1737
1740
|
installer = Gem::Installer.at gem
|
@@ -1743,7 +1746,7 @@ gem 'other', version
|
|
1743
1746
|
end
|
1744
1747
|
|
1745
1748
|
def test_pre_install_checks_malicious_specification_version_before_eval
|
1746
|
-
spec = util_spec "malicious",
|
1749
|
+
spec = util_spec "malicious", "1"
|
1747
1750
|
def spec.full_name # so the spec is buildable
|
1748
1751
|
"malicious-1"
|
1749
1752
|
end
|
@@ -1752,7 +1755,7 @@ gem 'other', version
|
|
1752
1755
|
|
1753
1756
|
util_build_gem spec
|
1754
1757
|
|
1755
|
-
gem = File.join(@gemhome,
|
1758
|
+
gem = File.join(@gemhome, "cache", spec.file_name)
|
1756
1759
|
|
1757
1760
|
use_ui @ui do
|
1758
1761
|
installer = Gem::Installer.at gem
|
@@ -1764,16 +1767,16 @@ gem 'other', version
|
|
1764
1767
|
end
|
1765
1768
|
|
1766
1769
|
def test_pre_install_checks_malicious_dependencies_before_eval
|
1767
|
-
spec = util_spec "malicious",
|
1770
|
+
spec = util_spec "malicious", "1"
|
1768
1771
|
def spec.full_name # so the spec is buildable
|
1769
1772
|
"malicious-1"
|
1770
1773
|
end
|
1771
1774
|
def spec.validate(*args); end
|
1772
|
-
spec.add_dependency "b\nfoo",
|
1775
|
+
spec.add_dependency "b\nfoo", "> 5"
|
1773
1776
|
|
1774
1777
|
util_build_gem spec
|
1775
1778
|
|
1776
|
-
gem = File.join(@gemhome,
|
1779
|
+
gem = File.join(@gemhome, "cache", spec.file_name)
|
1777
1780
|
|
1778
1781
|
use_ui @ui do
|
1779
1782
|
installer = Gem::Installer.at gem
|
@@ -1811,7 +1814,7 @@ gem 'other', version
|
|
1811
1814
|
|
1812
1815
|
util_make_exec @spec, "#!/usr/bin/ruby"
|
1813
1816
|
|
1814
|
-
shebang = installer.shebang
|
1817
|
+
shebang = installer.shebang "executable"
|
1815
1818
|
|
1816
1819
|
assert_equal "#!#{Gem.ruby}", shebang
|
1817
1820
|
end
|
@@ -1821,15 +1824,15 @@ gem 'other', version
|
|
1821
1824
|
installer = setup_base_installer
|
1822
1825
|
|
1823
1826
|
assert_nil installer.build_root
|
1824
|
-
assert_equal File.join(@gemhome,
|
1827
|
+
assert_equal File.join(@gemhome, "bin"), installer.bin_dir
|
1825
1828
|
assert_equal @gemhome, installer.gem_home
|
1826
1829
|
end
|
1827
1830
|
|
1828
1831
|
def test_process_options_build_root
|
1829
|
-
build_root = File.join @tempdir,
|
1830
|
-
bin_dir = File.join(build_root, @gemhome.gsub(/^[a-zA-Z]:/,
|
1831
|
-
gem_home = File.join(build_root, @gemhome.gsub(/^[a-zA-Z]:/,
|
1832
|
-
plugins_dir = File.join(build_root, @gemhome.gsub(/^[a-zA-Z]:/,
|
1832
|
+
build_root = File.join @tempdir, "build_root"
|
1833
|
+
bin_dir = File.join(build_root, @gemhome.gsub(/^[a-zA-Z]:/, ""), "bin")
|
1834
|
+
gem_home = File.join(build_root, @gemhome.gsub(/^[a-zA-Z]:/, ""))
|
1835
|
+
plugins_dir = File.join(build_root, @gemhome.gsub(/^[a-zA-Z]:/, ""), "plugins")
|
1833
1836
|
|
1834
1837
|
@gem = setup_base_gem
|
1835
1838
|
installer = use_ui(@ui) { Gem::Installer.at @gem, :build_root => build_root }
|
@@ -1848,24 +1851,24 @@ gem 'other', version
|
|
1848
1851
|
end
|
1849
1852
|
|
1850
1853
|
def test_shebang_arguments
|
1851
|
-
load_relative
|
1854
|
+
load_relative "no" do
|
1852
1855
|
installer = setup_base_installer
|
1853
1856
|
|
1854
1857
|
util_make_exec @spec, "#!/usr/bin/ruby -ws"
|
1855
1858
|
|
1856
|
-
shebang = installer.shebang
|
1859
|
+
shebang = installer.shebang "executable"
|
1857
1860
|
|
1858
1861
|
assert_equal "#!#{Gem.ruby} -ws", shebang
|
1859
1862
|
end
|
1860
1863
|
end
|
1861
1864
|
|
1862
1865
|
def test_shebang_arguments_with_load_relative
|
1863
|
-
load_relative
|
1866
|
+
load_relative "yes" do
|
1864
1867
|
installer = setup_base_installer
|
1865
1868
|
|
1866
1869
|
util_make_exec @spec, "#!/usr/bin/ruby -ws"
|
1867
1870
|
|
1868
|
-
shebang = installer.shebang
|
1871
|
+
shebang = installer.shebang "executable"
|
1869
1872
|
|
1870
1873
|
shebang_lines = shebang.split "\n"
|
1871
1874
|
|
@@ -1875,47 +1878,47 @@ gem 'other', version
|
|
1875
1878
|
end
|
1876
1879
|
|
1877
1880
|
def test_shebang_empty
|
1878
|
-
load_relative
|
1881
|
+
load_relative "no" do
|
1879
1882
|
installer = setup_base_installer
|
1880
1883
|
|
1881
|
-
util_make_exec @spec,
|
1884
|
+
util_make_exec @spec, ""
|
1882
1885
|
|
1883
|
-
shebang = installer.shebang
|
1886
|
+
shebang = installer.shebang "executable"
|
1884
1887
|
assert_equal "#!#{Gem.ruby}", shebang
|
1885
1888
|
end
|
1886
1889
|
end
|
1887
1890
|
|
1888
1891
|
def test_shebang_env
|
1889
|
-
load_relative
|
1892
|
+
load_relative "no" do
|
1890
1893
|
installer = setup_base_installer
|
1891
1894
|
|
1892
1895
|
util_make_exec @spec, "#!/usr/bin/env ruby"
|
1893
1896
|
|
1894
|
-
shebang = installer.shebang
|
1897
|
+
shebang = installer.shebang "executable"
|
1895
1898
|
|
1896
1899
|
assert_equal "#!#{Gem.ruby}", shebang
|
1897
1900
|
end
|
1898
1901
|
end
|
1899
1902
|
|
1900
1903
|
def test_shebang_env_arguments
|
1901
|
-
load_relative
|
1904
|
+
load_relative "no" do
|
1902
1905
|
installer = setup_base_installer
|
1903
1906
|
|
1904
1907
|
util_make_exec @spec, "#!/usr/bin/env ruby -ws"
|
1905
1908
|
|
1906
|
-
shebang = installer.shebang
|
1909
|
+
shebang = installer.shebang "executable"
|
1907
1910
|
|
1908
1911
|
assert_equal "#!#{Gem.ruby} -ws", shebang
|
1909
1912
|
end
|
1910
1913
|
end
|
1911
1914
|
|
1912
1915
|
def test_shebang_env_arguments_with_load_relative
|
1913
|
-
load_relative
|
1916
|
+
load_relative "yes" do
|
1914
1917
|
installer = setup_base_installer
|
1915
1918
|
|
1916
1919
|
util_make_exec @spec, "#!/usr/bin/env ruby -ws"
|
1917
1920
|
|
1918
|
-
shebang = installer.shebang
|
1921
|
+
shebang = installer.shebang "executable"
|
1919
1922
|
|
1920
1923
|
shebang_lines = shebang.split "\n"
|
1921
1924
|
|
@@ -1927,10 +1930,10 @@ gem 'other', version
|
|
1927
1930
|
def test_shebang_env_shebang
|
1928
1931
|
installer = setup_base_installer
|
1929
1932
|
|
1930
|
-
util_make_exec @spec,
|
1933
|
+
util_make_exec @spec, ""
|
1931
1934
|
installer.env_shebang = true
|
1932
1935
|
|
1933
|
-
shebang = installer.shebang
|
1936
|
+
shebang = installer.shebang "executable"
|
1934
1937
|
|
1935
1938
|
bin_env = get_bin_env
|
1936
1939
|
|
@@ -1939,36 +1942,36 @@ gem 'other', version
|
|
1939
1942
|
end
|
1940
1943
|
|
1941
1944
|
def test_shebang_nested
|
1942
|
-
load_relative
|
1945
|
+
load_relative "no" do
|
1943
1946
|
installer = setup_base_installer
|
1944
1947
|
|
1945
1948
|
util_make_exec @spec, "#!/opt/local/ruby/bin/ruby"
|
1946
1949
|
|
1947
|
-
shebang = installer.shebang
|
1950
|
+
shebang = installer.shebang "executable"
|
1948
1951
|
|
1949
1952
|
assert_equal "#!#{Gem.ruby}", shebang
|
1950
1953
|
end
|
1951
1954
|
end
|
1952
1955
|
|
1953
1956
|
def test_shebang_nested_arguments
|
1954
|
-
load_relative
|
1957
|
+
load_relative "no" do
|
1955
1958
|
installer = setup_base_installer
|
1956
1959
|
|
1957
1960
|
util_make_exec @spec, "#!/opt/local/ruby/bin/ruby -ws"
|
1958
1961
|
|
1959
|
-
shebang = installer.shebang
|
1962
|
+
shebang = installer.shebang "executable"
|
1960
1963
|
|
1961
1964
|
assert_equal "#!#{Gem.ruby} -ws", shebang
|
1962
1965
|
end
|
1963
1966
|
end
|
1964
1967
|
|
1965
1968
|
def test_shebang_nested_arguments_with_load_relative
|
1966
|
-
load_relative
|
1969
|
+
load_relative "yes" do
|
1967
1970
|
installer = setup_base_installer
|
1968
1971
|
|
1969
1972
|
util_make_exec @spec, "#!/opt/local/ruby/bin/ruby -ws"
|
1970
1973
|
|
1971
|
-
shebang = installer.shebang
|
1974
|
+
shebang = installer.shebang "executable"
|
1972
1975
|
|
1973
1976
|
shebang_lines = shebang.split "\n"
|
1974
1977
|
|
@@ -1978,36 +1981,36 @@ gem 'other', version
|
|
1978
1981
|
end
|
1979
1982
|
|
1980
1983
|
def test_shebang_version
|
1981
|
-
load_relative
|
1984
|
+
load_relative "no" do
|
1982
1985
|
installer = setup_base_installer
|
1983
1986
|
|
1984
1987
|
util_make_exec @spec, "#!/usr/bin/ruby18"
|
1985
1988
|
|
1986
|
-
shebang = installer.shebang
|
1989
|
+
shebang = installer.shebang "executable"
|
1987
1990
|
|
1988
1991
|
assert_equal "#!#{Gem.ruby}", shebang
|
1989
1992
|
end
|
1990
1993
|
end
|
1991
1994
|
|
1992
1995
|
def test_shebang_version_arguments
|
1993
|
-
load_relative
|
1996
|
+
load_relative "no" do
|
1994
1997
|
installer = setup_base_installer
|
1995
1998
|
|
1996
1999
|
util_make_exec @spec, "#!/usr/bin/ruby18 -ws"
|
1997
2000
|
|
1998
|
-
shebang = installer.shebang
|
2001
|
+
shebang = installer.shebang "executable"
|
1999
2002
|
|
2000
2003
|
assert_equal "#!#{Gem.ruby} -ws", shebang
|
2001
2004
|
end
|
2002
2005
|
end
|
2003
2006
|
|
2004
2007
|
def test_shebang_version_arguments_with_load_relative
|
2005
|
-
load_relative
|
2008
|
+
load_relative "yes" do
|
2006
2009
|
installer = setup_base_installer
|
2007
2010
|
|
2008
2011
|
util_make_exec @spec, "#!/usr/bin/ruby18 -ws"
|
2009
2012
|
|
2010
|
-
shebang = installer.shebang
|
2013
|
+
shebang = installer.shebang "executable"
|
2011
2014
|
|
2012
2015
|
shebang_lines = shebang.split "\n"
|
2013
2016
|
|
@@ -2017,36 +2020,36 @@ gem 'other', version
|
|
2017
2020
|
end
|
2018
2021
|
|
2019
2022
|
def test_shebang_version_env
|
2020
|
-
load_relative
|
2023
|
+
load_relative "no" do
|
2021
2024
|
installer = setup_base_installer
|
2022
2025
|
|
2023
2026
|
util_make_exec @spec, "#!/usr/bin/env ruby18"
|
2024
2027
|
|
2025
|
-
shebang = installer.shebang
|
2028
|
+
shebang = installer.shebang "executable"
|
2026
2029
|
|
2027
2030
|
assert_equal "#!#{Gem.ruby}", shebang
|
2028
2031
|
end
|
2029
2032
|
end
|
2030
2033
|
|
2031
2034
|
def test_shebang_version_env_arguments
|
2032
|
-
load_relative
|
2035
|
+
load_relative "no" do
|
2033
2036
|
installer = setup_base_installer
|
2034
2037
|
|
2035
2038
|
util_make_exec @spec, "#!/usr/bin/env ruby18 -ws"
|
2036
2039
|
|
2037
|
-
shebang = installer.shebang
|
2040
|
+
shebang = installer.shebang "executable"
|
2038
2041
|
|
2039
2042
|
assert_equal "#!#{Gem.ruby} -ws", shebang
|
2040
2043
|
end
|
2041
2044
|
end
|
2042
2045
|
|
2043
2046
|
def test_shebang_version_env_arguments_with_load_relative
|
2044
|
-
load_relative
|
2047
|
+
load_relative "yes" do
|
2045
2048
|
installer = setup_base_installer
|
2046
2049
|
|
2047
2050
|
util_make_exec @spec, "#!/usr/bin/env ruby18 -ws"
|
2048
2051
|
|
2049
|
-
shebang = installer.shebang
|
2052
|
+
shebang = installer.shebang "executable"
|
2050
2053
|
|
2051
2054
|
shebang_lines = shebang.split "\n"
|
2052
2055
|
|
@@ -2059,13 +2062,13 @@ gem 'other', version
|
|
2059
2062
|
installer = setup_base_installer
|
2060
2063
|
|
2061
2064
|
conf = Gem::ConfigFile.new []
|
2062
|
-
conf[:custom_shebang] =
|
2065
|
+
conf[:custom_shebang] = "test"
|
2063
2066
|
|
2064
2067
|
Gem.configuration = conf
|
2065
2068
|
|
2066
2069
|
util_make_exec @spec, "#!/usr/bin/ruby"
|
2067
2070
|
|
2068
|
-
shebang = installer.shebang
|
2071
|
+
shebang = installer.shebang "executable"
|
2069
2072
|
|
2070
2073
|
assert_equal "#!test", shebang
|
2071
2074
|
end
|
@@ -2083,13 +2086,13 @@ gem 'other', version
|
|
2083
2086
|
|
2084
2087
|
bin_env = get_bin_env
|
2085
2088
|
conf = Gem::ConfigFile.new []
|
2086
|
-
conf[:custom_shebang] =
|
2089
|
+
conf[:custom_shebang] = "1 $env 2 $ruby 3 $exec 4 $name"
|
2087
2090
|
|
2088
2091
|
Gem.configuration = conf
|
2089
2092
|
|
2090
2093
|
util_make_exec @spec, "#!/usr/bin/ruby"
|
2091
2094
|
|
2092
|
-
shebang = installer.shebang
|
2095
|
+
shebang = installer.shebang "executable"
|
2093
2096
|
|
2094
2097
|
assert_equal "#!1 #{bin_env} 2 #{Gem.ruby} 3 executable 4 a", shebang
|
2095
2098
|
end
|
@@ -2099,13 +2102,13 @@ gem 'other', version
|
|
2099
2102
|
|
2100
2103
|
bin_env = get_bin_env
|
2101
2104
|
conf = Gem::ConfigFile.new []
|
2102
|
-
conf[:custom_shebang] =
|
2105
|
+
conf[:custom_shebang] = "1 $env 2 $ruby 3 $exec"
|
2103
2106
|
|
2104
2107
|
Gem.configuration = conf
|
2105
2108
|
|
2106
2109
|
util_make_exec @spec, "#!/usr/bin/ruby -ws"
|
2107
2110
|
|
2108
|
-
shebang = installer.shebang
|
2111
|
+
shebang = installer.shebang "executable"
|
2109
2112
|
|
2110
2113
|
assert_equal "#!1 #{bin_env} 2 #{Gem.ruby} -ws 3 executable", shebang
|
2111
2114
|
end
|
@@ -2113,14 +2116,14 @@ gem 'other', version
|
|
2113
2116
|
def test_unpack
|
2114
2117
|
installer = util_setup_installer
|
2115
2118
|
|
2116
|
-
dest = File.join @gemhome,
|
2119
|
+
dest = File.join @gemhome, "gems", @spec.full_name
|
2117
2120
|
|
2118
2121
|
Gem::Deprecate.skip_during do
|
2119
2122
|
installer.unpack dest
|
2120
2123
|
end
|
2121
2124
|
|
2122
|
-
assert_path_exist File.join dest,
|
2123
|
-
assert_path_exist File.join dest,
|
2125
|
+
assert_path_exist File.join dest, "lib", "code.rb"
|
2126
|
+
assert_path_exist File.join dest, "bin", "executable"
|
2124
2127
|
end
|
2125
2128
|
|
2126
2129
|
def test_write_build_info_file
|
@@ -2163,12 +2166,12 @@ gem 'other', version
|
|
2163
2166
|
|
2164
2167
|
assert_path_not_exist @spec.build_info_file
|
2165
2168
|
assert_path_exist \
|
2166
|
-
File.join("#{@gemhome}2",
|
2169
|
+
File.join("#{@gemhome}2", "build_info", "#{@spec.full_name}.info")
|
2167
2170
|
end
|
2168
2171
|
|
2169
2172
|
def test_write_cache_file
|
2170
2173
|
@gem = setup_base_gem
|
2171
|
-
cache_file = File.join @gemhome,
|
2174
|
+
cache_file = File.join @gemhome, "cache", @spec.file_name
|
2172
2175
|
gem = File.join @gemhome, @spec.file_name
|
2173
2176
|
|
2174
2177
|
FileUtils.mv cache_file, gem
|
@@ -2226,7 +2229,7 @@ gem 'other', version
|
|
2226
2229
|
end
|
2227
2230
|
|
2228
2231
|
def test_default_gem_loaded_from
|
2229
|
-
spec = util_spec
|
2232
|
+
spec = util_spec "a"
|
2230
2233
|
installer = Gem::Installer.for_spec spec, :install_as_default => true
|
2231
2234
|
installer.install
|
2232
2235
|
assert_predicate spec, :default_gem?
|
@@ -2235,7 +2238,7 @@ gem 'other', version
|
|
2235
2238
|
def test_default_gem_without_wrappers
|
2236
2239
|
installer = setup_base_installer
|
2237
2240
|
|
2238
|
-
FileUtils.rm_rf File.join(Gem.default_dir,
|
2241
|
+
FileUtils.rm_rf File.join(Gem.default_dir, "specifications")
|
2239
2242
|
|
2240
2243
|
installer.wrappers = false
|
2241
2244
|
installer.options[:install_as_default] = true
|
@@ -2245,20 +2248,20 @@ gem 'other', version
|
|
2245
2248
|
installer.install
|
2246
2249
|
end
|
2247
2250
|
|
2248
|
-
assert_directory_exists File.join(@spec.gem_dir,
|
2249
|
-
installed_exec = File.join @spec.gem_dir,
|
2251
|
+
assert_directory_exists File.join(@spec.gem_dir, "bin")
|
2252
|
+
installed_exec = File.join @spec.gem_dir, "bin", "executable"
|
2250
2253
|
assert_path_exist installed_exec
|
2251
2254
|
|
2252
|
-
assert_directory_exists File.join(Gem.default_dir,
|
2253
|
-
assert_directory_exists File.join(Gem.default_dir,
|
2255
|
+
assert_directory_exists File.join(Gem.default_dir, "specifications")
|
2256
|
+
assert_directory_exists File.join(Gem.default_dir, "specifications", "default")
|
2254
2257
|
|
2255
|
-
default_spec = eval File.read File.join(Gem.default_dir,
|
2258
|
+
default_spec = eval File.read File.join(Gem.default_dir, "specifications", "default", "a-2.gemspec")
|
2256
2259
|
assert_equal Gem::Version.new("2"), default_spec.version
|
2257
|
-
assert_equal [
|
2260
|
+
assert_equal ["bin/executable"], default_spec.files
|
2258
2261
|
|
2259
2262
|
assert_directory_exists util_inst_bindir
|
2260
2263
|
|
2261
|
-
installed_exec = File.join util_inst_bindir,
|
2264
|
+
installed_exec = File.join util_inst_bindir, "executable"
|
2262
2265
|
assert_path_exist installed_exec
|
2263
2266
|
|
2264
2267
|
wrapper = File.read installed_exec
|
@@ -2284,7 +2287,7 @@ gem 'other', version
|
|
2284
2287
|
|
2285
2288
|
assert_directory_exists util_inst_bindir
|
2286
2289
|
|
2287
|
-
installed_exec = File.join util_inst_bindir,
|
2290
|
+
installed_exec = File.join util_inst_bindir, "executable"
|
2288
2291
|
assert_path_exist installed_exec
|
2289
2292
|
|
2290
2293
|
wrapper = File.read installed_exec
|
@@ -2292,8 +2295,8 @@ gem 'other', version
|
|
2292
2295
|
end
|
2293
2296
|
|
2294
2297
|
def test_default_gem_with_exe_as_bindir
|
2295
|
-
@spec = quick_gem
|
2296
|
-
util_make_exec spec,
|
2298
|
+
@spec = quick_gem "c" do |spec|
|
2299
|
+
util_make_exec spec, "#!/usr/bin/ruby", "exe"
|
2297
2300
|
end
|
2298
2301
|
|
2299
2302
|
util_build_gem @spec
|
@@ -2309,16 +2312,16 @@ gem 'other', version
|
|
2309
2312
|
installer.install
|
2310
2313
|
end
|
2311
2314
|
|
2312
|
-
assert_directory_exists File.join(@spec.gem_dir,
|
2313
|
-
installed_exec = File.join @spec.gem_dir,
|
2315
|
+
assert_directory_exists File.join(@spec.gem_dir, "exe")
|
2316
|
+
installed_exec = File.join @spec.gem_dir, "exe", "executable"
|
2314
2317
|
assert_path_exist installed_exec
|
2315
2318
|
|
2316
|
-
assert_directory_exists File.join(Gem.default_dir,
|
2317
|
-
assert_directory_exists File.join(Gem.default_dir,
|
2319
|
+
assert_directory_exists File.join(Gem.default_dir, "specifications")
|
2320
|
+
assert_directory_exists File.join(Gem.default_dir, "specifications", "default")
|
2318
2321
|
|
2319
|
-
default_spec = eval File.read File.join(Gem.default_dir,
|
2322
|
+
default_spec = eval File.read File.join(Gem.default_dir, "specifications", "default", "c-2.gemspec")
|
2320
2323
|
assert_equal Gem::Version.new("2"), default_spec.version
|
2321
|
-
assert_equal [
|
2324
|
+
assert_equal ["exe/executable"], default_spec.files
|
2322
2325
|
end
|
2323
2326
|
|
2324
2327
|
def test_default_gem_to_specific_install_dir
|
@@ -2330,17 +2333,17 @@ gem 'other', version
|
|
2330
2333
|
installer.install
|
2331
2334
|
end
|
2332
2335
|
|
2333
|
-
assert_directory_exists File.join("#{@gemhome}2",
|
2334
|
-
assert_directory_exists File.join("#{@gemhome}2",
|
2336
|
+
assert_directory_exists File.join("#{@gemhome}2", "specifications")
|
2337
|
+
assert_directory_exists File.join("#{@gemhome}2", "specifications", "default")
|
2335
2338
|
|
2336
|
-
default_spec = eval File.read File.join("#{@gemhome}2",
|
2339
|
+
default_spec = eval File.read File.join("#{@gemhome}2", "specifications", "default", "a-2.gemspec")
|
2337
2340
|
assert_equal Gem::Version.new("2"), default_spec.version
|
2338
|
-
assert_equal [
|
2341
|
+
assert_equal ["bin/executable"], default_spec.files
|
2339
2342
|
end
|
2340
2343
|
|
2341
2344
|
def test_package_attribute
|
2342
|
-
gem = quick_gem
|
2343
|
-
util_make_exec spec,
|
2345
|
+
gem = quick_gem "c" do |spec|
|
2346
|
+
util_make_exec spec, "#!/usr/bin/ruby", "exe"
|
2344
2347
|
end
|
2345
2348
|
|
2346
2349
|
installer = util_installer(gem, @gemhome)
|
@@ -2349,8 +2352,8 @@ gem 'other', version
|
|
2349
2352
|
end
|
2350
2353
|
|
2351
2354
|
def test_gem_attribute
|
2352
|
-
gem = quick_gem
|
2353
|
-
util_make_exec spec,
|
2355
|
+
gem = quick_gem "c" do |spec|
|
2356
|
+
util_make_exec spec, "#!/usr/bin/ruby", "exe"
|
2354
2357
|
end
|
2355
2358
|
|
2356
2359
|
installer = util_installer(gem, @gemhome)
|
@@ -2361,14 +2364,14 @@ gem 'other', version
|
|
2361
2364
|
private
|
2362
2365
|
|
2363
2366
|
def util_execless
|
2364
|
-
@spec = util_spec
|
2367
|
+
@spec = util_spec "z"
|
2365
2368
|
util_build_gem @spec
|
2366
2369
|
|
2367
2370
|
util_installer @spec, @gemhome
|
2368
2371
|
end
|
2369
2372
|
|
2370
2373
|
def util_conflict_executable(wrappers)
|
2371
|
-
conflict = quick_gem
|
2374
|
+
conflict = quick_gem "conflict" do |spec|
|
2372
2375
|
util_make_exec spec
|
2373
2376
|
end
|
2374
2377
|
|
@@ -2384,11 +2387,11 @@ gem 'other', version
|
|
2384
2387
|
end
|
2385
2388
|
|
2386
2389
|
def load_relative(value)
|
2387
|
-
orig_LIBRUBY_RELATIVE = RbConfig::CONFIG[
|
2388
|
-
RbConfig::CONFIG[
|
2390
|
+
orig_LIBRUBY_RELATIVE = RbConfig::CONFIG["LIBRUBY_RELATIVE"]
|
2391
|
+
RbConfig::CONFIG["LIBRUBY_RELATIVE"] = value
|
2389
2392
|
|
2390
2393
|
yield
|
2391
2394
|
ensure
|
2392
|
-
RbConfig::CONFIG[
|
2395
|
+
RbConfig::CONFIG["LIBRUBY_RELATIVE"] = orig_LIBRUBY_RELATIVE
|
2393
2396
|
end
|
2394
2397
|
end
|