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,47 +1,47 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
require_relative
|
3
|
-
require
|
4
|
-
require
|
2
|
+
require_relative "helper"
|
3
|
+
require "rubygems/platform"
|
4
|
+
require "rbconfig"
|
5
5
|
|
6
6
|
class TestGemPlatform < Gem::TestCase
|
7
7
|
def test_self_local
|
8
|
-
util_set_arch
|
8
|
+
util_set_arch "i686-darwin8.10.1"
|
9
9
|
|
10
10
|
assert_equal Gem::Platform.new(%w[x86 darwin 8]), Gem::Platform.local
|
11
11
|
end
|
12
12
|
|
13
13
|
def test_self_match
|
14
14
|
Gem::Deprecate.skip_during do
|
15
|
-
assert Gem::Platform.match(nil),
|
16
|
-
assert Gem::Platform.match(Gem::Platform.local),
|
17
|
-
assert Gem::Platform.match(Gem::Platform.local.to_s),
|
18
|
-
assert Gem::Platform.match(Gem::Platform::RUBY),
|
15
|
+
assert Gem::Platform.match(nil), "nil == ruby"
|
16
|
+
assert Gem::Platform.match(Gem::Platform.local), "exact match"
|
17
|
+
assert Gem::Platform.match(Gem::Platform.local.to_s), "=~ match"
|
18
|
+
assert Gem::Platform.match(Gem::Platform::RUBY), "ruby"
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
22
|
def test_self_match_gem?
|
23
|
-
assert Gem::Platform.match_gem?(nil,
|
24
|
-
assert Gem::Platform.match_gem?(Gem::Platform.local,
|
25
|
-
assert Gem::Platform.match_gem?(Gem::Platform.local.to_s,
|
26
|
-
assert Gem::Platform.match_gem?(Gem::Platform::RUBY,
|
23
|
+
assert Gem::Platform.match_gem?(nil, "json"), "nil == ruby"
|
24
|
+
assert Gem::Platform.match_gem?(Gem::Platform.local, "json"), "exact match"
|
25
|
+
assert Gem::Platform.match_gem?(Gem::Platform.local.to_s, "json"), "=~ match"
|
26
|
+
assert Gem::Platform.match_gem?(Gem::Platform::RUBY, "json"), "ruby"
|
27
27
|
end
|
28
28
|
|
29
29
|
def test_self_match_spec?
|
30
30
|
make_spec = -> platform do
|
31
|
-
util_spec
|
31
|
+
util_spec "mygem-for-platform-match_spec", "1" do |s|
|
32
32
|
s.platform = platform
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
-
assert Gem::Platform.match_spec?(make_spec.call(nil)),
|
37
|
-
assert Gem::Platform.match_spec?(make_spec.call(Gem::Platform.local)),
|
38
|
-
assert Gem::Platform.match_spec?(make_spec.call(Gem::Platform.local.to_s)),
|
39
|
-
assert Gem::Platform.match_spec?(make_spec.call(Gem::Platform::RUBY)),
|
36
|
+
assert Gem::Platform.match_spec?(make_spec.call(nil)), "nil == ruby"
|
37
|
+
assert Gem::Platform.match_spec?(make_spec.call(Gem::Platform.local)), "exact match"
|
38
|
+
assert Gem::Platform.match_spec?(make_spec.call(Gem::Platform.local.to_s)), "=~ match"
|
39
|
+
assert Gem::Platform.match_spec?(make_spec.call(Gem::Platform::RUBY)), "ruby"
|
40
40
|
end
|
41
41
|
|
42
42
|
def test_self_match_spec_with_match_gem_override
|
43
43
|
make_spec = -> name, platform do
|
44
|
-
util_spec name,
|
44
|
+
util_spec name, "1" do |s|
|
45
45
|
s.platform = platform
|
46
46
|
end
|
47
47
|
end
|
@@ -50,7 +50,7 @@ class TestGemPlatform < Gem::TestCase
|
|
50
50
|
alias_method :original_match_gem?, :match_gem?
|
51
51
|
def match_gem?(platform, gem_name)
|
52
52
|
# e.g., sassc and libv8 are such gems, their native extensions do not use the Ruby C API
|
53
|
-
if gem_name ==
|
53
|
+
if gem_name == "gem-with-ruby-impl-independent-precompiled-ext"
|
54
54
|
match_platforms?(platform, [Gem::Platform::RUBY, Gem::Platform.local])
|
55
55
|
else
|
56
56
|
match_platforms?(platform, Gem.platforms)
|
@@ -61,10 +61,10 @@ class TestGemPlatform < Gem::TestCase
|
|
61
61
|
platforms = Gem.platforms
|
62
62
|
Gem.platforms = [Gem::Platform::RUBY]
|
63
63
|
begin
|
64
|
-
assert_equal true, Gem::Platform.match_spec?(make_spec.call(
|
65
|
-
assert_equal false, Gem::Platform.match_spec?(make_spec.call(
|
64
|
+
assert_equal true, Gem::Platform.match_spec?(make_spec.call("mygem", Gem::Platform::RUBY))
|
65
|
+
assert_equal false, Gem::Platform.match_spec?(make_spec.call("mygem", Gem::Platform.local))
|
66
66
|
|
67
|
-
name =
|
67
|
+
name = "gem-with-ruby-impl-independent-precompiled-ext"
|
68
68
|
assert_equal true, Gem::Platform.match_spec?(make_spec.call(name, Gem::Platform.local))
|
69
69
|
ensure
|
70
70
|
Gem.platforms = platforms
|
@@ -80,135 +80,142 @@ class TestGemPlatform < Gem::TestCase
|
|
80
80
|
assert_equal Gem::Platform.local, Gem::Platform.new(Gem::Platform::CURRENT)
|
81
81
|
assert_equal Gem::Platform::RUBY, Gem::Platform.new(Gem::Platform::RUBY)
|
82
82
|
assert_equal Gem::Platform::RUBY, Gem::Platform.new(nil)
|
83
|
-
assert_equal Gem::Platform::RUBY, Gem::Platform.new(
|
83
|
+
assert_equal Gem::Platform::RUBY, Gem::Platform.new("")
|
84
84
|
end
|
85
85
|
|
86
86
|
def test_initialize
|
87
87
|
test_cases = {
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
88
|
+
"amd64-freebsd6" => ["amd64", "freebsd", "6"],
|
89
|
+
"hppa2.0w-hpux11.31" => ["hppa2.0w", "hpux", "11"],
|
90
|
+
"java" => [nil, "java", nil],
|
91
|
+
"jruby" => [nil, "java", nil],
|
92
|
+
"universal-dotnet" => ["universal", "dotnet", nil],
|
93
|
+
"universal-dotnet2.0" => ["universal", "dotnet", "2.0"],
|
94
|
+
"universal-dotnet4.0" => ["universal", "dotnet", "4.0"],
|
95
|
+
"powerpc-aix5.3.0.0" => ["powerpc", "aix", "5"],
|
96
|
+
"powerpc-darwin7" => ["powerpc", "darwin", "7"],
|
97
|
+
"powerpc-darwin8" => ["powerpc", "darwin", "8"],
|
98
|
+
"powerpc-linux" => ["powerpc", "linux", nil],
|
99
|
+
"powerpc64-linux" => ["powerpc64", "linux", nil],
|
100
|
+
"sparc-solaris2.10" => ["sparc", "solaris", "2.10"],
|
101
|
+
"sparc-solaris2.8" => ["sparc", "solaris", "2.8"],
|
102
|
+
"sparc-solaris2.9" => ["sparc", "solaris", "2.9"],
|
103
|
+
"universal-darwin8" => ["universal", "darwin", "8"],
|
104
|
+
"universal-darwin9" => ["universal", "darwin", "9"],
|
105
|
+
"universal-macruby" => ["universal", "macruby", nil],
|
106
|
+
"i386-cygwin" => ["x86", "cygwin", nil],
|
107
|
+
"i686-darwin" => ["x86", "darwin", nil],
|
108
|
+
"i686-darwin8.4.1" => ["x86", "darwin", "8"],
|
109
|
+
"i386-freebsd4.11" => ["x86", "freebsd", "4"],
|
110
|
+
"i386-freebsd5" => ["x86", "freebsd", "5"],
|
111
|
+
"i386-freebsd6" => ["x86", "freebsd", "6"],
|
112
|
+
"i386-freebsd7" => ["x86", "freebsd", "7"],
|
113
|
+
"i386-freebsd" => ["x86", "freebsd", nil],
|
114
|
+
"universal-freebsd" => ["universal", "freebsd", nil],
|
115
|
+
"i386-java1.5" => ["x86", "java", "1.5"],
|
116
|
+
"x86-java1.6" => ["x86", "java", "1.6"],
|
117
|
+
"i386-java1.6" => ["x86", "java", "1.6"],
|
118
|
+
"i686-linux" => ["x86", "linux", nil],
|
119
|
+
"i586-linux" => ["x86", "linux", nil],
|
120
|
+
"i486-linux" => ["x86", "linux", nil],
|
121
|
+
"i386-linux" => ["x86", "linux", nil],
|
122
|
+
"i586-linux-gnu" => ["x86", "linux", "gnu"],
|
123
|
+
"i386-linux-gnu" => ["x86", "linux", "gnu"],
|
124
|
+
"i386-mingw32" => ["x86", "mingw32", nil],
|
125
|
+
"x64-mingw-ucrt" => ["x64", "mingw", "ucrt"],
|
126
|
+
"i386-mswin32" => ["x86", "mswin32", nil],
|
127
|
+
"i386-mswin32_80" => ["x86", "mswin32", "80"],
|
128
|
+
"i386-mswin32-80" => ["x86", "mswin32", "80"],
|
129
|
+
"x86-mswin32" => ["x86", "mswin32", nil],
|
130
|
+
"x86-mswin32_60" => ["x86", "mswin32", "60"],
|
131
|
+
"x86-mswin32-60" => ["x86", "mswin32", "60"],
|
132
|
+
"i386-netbsdelf" => ["x86", "netbsdelf", nil],
|
133
|
+
"i386-openbsd4.0" => ["x86", "openbsd", "4.0"],
|
134
|
+
"i386-solaris2.10" => ["x86", "solaris", "2.10"],
|
135
|
+
"i386-solaris2.8" => ["x86", "solaris", "2.8"],
|
136
|
+
"mswin32" => ["x86", "mswin32", nil],
|
137
|
+
"x86_64-linux" => ["x86_64", "linux", nil],
|
138
|
+
"x86_64-linux-gnu" => ["x86_64", "linux", "gnu"],
|
139
|
+
"x86_64-linux-musl" => ["x86_64", "linux", "musl"],
|
140
|
+
"x86_64-linux-uclibc" => ["x86_64", "linux", "uclibc"],
|
141
|
+
"arm-linux-eabi" => ["arm", "linux", "eabi"],
|
142
|
+
"arm-linux-gnueabi" => ["arm", "linux", "gnueabi"],
|
143
|
+
"arm-linux-musleabi" => ["arm", "linux", "musleabi"],
|
144
|
+
"arm-linux-uclibceabi" => ["arm", "linux", "uclibceabi"],
|
145
|
+
"x86_64-openbsd3.9" => ["x86_64", "openbsd", "3.9"],
|
146
|
+
"x86_64-openbsd4.0" => ["x86_64", "openbsd", "4.0"],
|
147
|
+
"x86_64-openbsd" => ["x86_64", "openbsd", nil],
|
142
148
|
}
|
143
149
|
|
144
150
|
test_cases.each do |arch, expected|
|
145
151
|
platform = Gem::Platform.new arch
|
146
152
|
assert_equal expected, platform.to_a, arch.inspect
|
153
|
+
assert_equal expected, Gem::Platform.new(platform.to_s).to_a, arch.inspect
|
147
154
|
end
|
148
155
|
end
|
149
156
|
|
150
157
|
def test_initialize_command_line
|
151
|
-
expected = [
|
158
|
+
expected = ["x86", "mswin32", nil]
|
152
159
|
|
153
|
-
platform = Gem::Platform.new
|
160
|
+
platform = Gem::Platform.new "i386-mswin32"
|
154
161
|
|
155
|
-
assert_equal expected, platform.to_a,
|
162
|
+
assert_equal expected, platform.to_a, "i386-mswin32"
|
156
163
|
|
157
|
-
expected = [
|
164
|
+
expected = ["x86", "mswin32", "80"]
|
158
165
|
|
159
|
-
platform = Gem::Platform.new
|
166
|
+
platform = Gem::Platform.new "i386-mswin32-80"
|
160
167
|
|
161
|
-
assert_equal expected, platform.to_a,
|
168
|
+
assert_equal expected, platform.to_a, "i386-mswin32-80"
|
162
169
|
|
163
|
-
expected = [
|
170
|
+
expected = ["x86", "solaris", "2.10"]
|
164
171
|
|
165
|
-
platform = Gem::Platform.new
|
172
|
+
platform = Gem::Platform.new "i386-solaris-2.10"
|
166
173
|
|
167
|
-
assert_equal expected, platform.to_a,
|
174
|
+
assert_equal expected, platform.to_a, "i386-solaris-2.10"
|
168
175
|
end
|
169
176
|
|
170
177
|
def test_initialize_mswin32_vc6
|
171
|
-
orig_RUBY_SO_NAME = RbConfig::CONFIG[
|
172
|
-
RbConfig::CONFIG[
|
178
|
+
orig_RUBY_SO_NAME = RbConfig::CONFIG["RUBY_SO_NAME"]
|
179
|
+
RbConfig::CONFIG["RUBY_SO_NAME"] = "msvcrt-ruby18"
|
173
180
|
|
174
|
-
expected = [
|
181
|
+
expected = ["x86", "mswin32", nil]
|
175
182
|
|
176
|
-
platform = Gem::Platform.new
|
183
|
+
platform = Gem::Platform.new "i386-mswin32"
|
177
184
|
|
178
|
-
assert_equal expected, platform.to_a,
|
185
|
+
assert_equal expected, platform.to_a, "i386-mswin32 VC6"
|
179
186
|
ensure
|
180
187
|
if orig_RUBY_SO_NAME
|
181
|
-
RbConfig::CONFIG[
|
188
|
+
RbConfig::CONFIG["RUBY_SO_NAME"] = orig_RUBY_SO_NAME
|
182
189
|
else
|
183
|
-
RbConfig::CONFIG.delete
|
190
|
+
RbConfig::CONFIG.delete "RUBY_SO_NAME"
|
184
191
|
end
|
185
192
|
end
|
186
193
|
|
187
194
|
def test_initialize_platform
|
188
|
-
platform = Gem::Platform.new
|
195
|
+
platform = Gem::Platform.new "cpu-my_platform1"
|
189
196
|
|
190
|
-
assert_equal
|
191
|
-
assert_equal
|
192
|
-
assert_equal
|
197
|
+
assert_equal "cpu", platform.cpu
|
198
|
+
assert_equal "my_platform", platform.os
|
199
|
+
assert_equal "1", platform.version
|
193
200
|
end
|
194
201
|
|
195
202
|
def test_initialize_test
|
196
|
-
platform = Gem::Platform.new
|
197
|
-
assert_equal
|
198
|
-
assert_equal
|
199
|
-
assert_equal
|
200
|
-
|
201
|
-
platform = Gem::Platform.new
|
202
|
-
assert_equal
|
203
|
-
assert_equal
|
204
|
-
assert_equal
|
203
|
+
platform = Gem::Platform.new "cpu-my_platform1"
|
204
|
+
assert_equal "cpu", platform.cpu
|
205
|
+
assert_equal "my_platform", platform.os
|
206
|
+
assert_equal "1", platform.version
|
207
|
+
|
208
|
+
platform = Gem::Platform.new "cpu-other_platform1"
|
209
|
+
assert_equal "cpu", platform.cpu
|
210
|
+
assert_equal "other_platform", platform.os
|
211
|
+
assert_equal "1", platform.version
|
205
212
|
end
|
206
213
|
|
207
214
|
def test_to_s
|
208
215
|
if win_platform?
|
209
|
-
assert_equal
|
216
|
+
assert_equal "x86-mswin32-60", Gem::Platform.local.to_s
|
210
217
|
else
|
211
|
-
assert_equal
|
218
|
+
assert_equal "x86-darwin-8", Gem::Platform.local.to_s
|
212
219
|
end
|
213
220
|
end
|
214
221
|
|
@@ -231,146 +238,210 @@ class TestGemPlatform < Gem::TestCase
|
|
231
238
|
end
|
232
239
|
|
233
240
|
def test_equals3_cpu
|
234
|
-
ppc_darwin8 = Gem::Platform.new
|
235
|
-
uni_darwin8 = Gem::Platform.new
|
236
|
-
x86_darwin8 = Gem::Platform.new
|
237
|
-
|
238
|
-
util_set_arch
|
239
|
-
assert((ppc_darwin8 === Gem::Platform.local),
|
240
|
-
assert((uni_darwin8 === Gem::Platform.local),
|
241
|
-
refute((x86_darwin8 === Gem::Platform.local),
|
242
|
-
|
243
|
-
util_set_arch
|
244
|
-
refute((ppc_darwin8 === Gem::Platform.local),
|
245
|
-
assert((uni_darwin8 === Gem::Platform.local),
|
246
|
-
assert((x86_darwin8 === Gem::Platform.local),
|
247
|
-
|
248
|
-
util_set_arch
|
249
|
-
assert((ppc_darwin8 === Gem::Platform.local),
|
250
|
-
assert((uni_darwin8 === Gem::Platform.local),
|
251
|
-
assert((x86_darwin8 === Gem::Platform.local),
|
241
|
+
ppc_darwin8 = Gem::Platform.new "powerpc-darwin8.0"
|
242
|
+
uni_darwin8 = Gem::Platform.new "universal-darwin8.0"
|
243
|
+
x86_darwin8 = Gem::Platform.new "i686-darwin8.0"
|
244
|
+
|
245
|
+
util_set_arch "powerpc-darwin8"
|
246
|
+
assert((ppc_darwin8 === Gem::Platform.local), "powerpc =~ universal")
|
247
|
+
assert((uni_darwin8 === Gem::Platform.local), "powerpc =~ universal")
|
248
|
+
refute((x86_darwin8 === Gem::Platform.local), "powerpc =~ universal")
|
249
|
+
|
250
|
+
util_set_arch "i686-darwin8"
|
251
|
+
refute((ppc_darwin8 === Gem::Platform.local), "powerpc =~ universal")
|
252
|
+
assert((uni_darwin8 === Gem::Platform.local), "x86 =~ universal")
|
253
|
+
assert((x86_darwin8 === Gem::Platform.local), "powerpc =~ universal")
|
254
|
+
|
255
|
+
util_set_arch "universal-darwin8"
|
256
|
+
assert((ppc_darwin8 === Gem::Platform.local), "universal =~ ppc")
|
257
|
+
assert((uni_darwin8 === Gem::Platform.local), "universal =~ universal")
|
258
|
+
assert((x86_darwin8 === Gem::Platform.local), "universal =~ x86")
|
252
259
|
end
|
253
260
|
|
254
261
|
def test_nil_cpu_arch_is_treated_as_universal
|
255
|
-
with_nil_arch = Gem::Platform.new [nil,
|
256
|
-
with_uni_arch = Gem::Platform.new [
|
257
|
-
with_x86_arch = Gem::Platform.new [
|
258
|
-
|
259
|
-
assert((with_nil_arch === with_uni_arch),
|
260
|
-
assert((with_uni_arch === with_nil_arch),
|
261
|
-
assert((with_nil_arch === with_x86_arch),
|
262
|
-
assert((with_x86_arch === with_nil_arch),
|
262
|
+
with_nil_arch = Gem::Platform.new [nil, "mingw32"]
|
263
|
+
with_uni_arch = Gem::Platform.new ["universal", "mingw32"]
|
264
|
+
with_x86_arch = Gem::Platform.new ["x86", "mingw32"]
|
265
|
+
|
266
|
+
assert((with_nil_arch === with_uni_arch), "nil =~ universal")
|
267
|
+
assert((with_uni_arch === with_nil_arch), "universal =~ nil")
|
268
|
+
assert((with_nil_arch === with_x86_arch), "nil =~ x86")
|
269
|
+
assert((with_x86_arch === with_nil_arch), "x86 =~ nil")
|
270
|
+
end
|
271
|
+
|
272
|
+
def test_nil_version_is_treated_as_any_version
|
273
|
+
x86_darwin_8 = Gem::Platform.new "i686-darwin8.0"
|
274
|
+
x86_darwin_nil = Gem::Platform.new "i686-darwin"
|
275
|
+
|
276
|
+
assert((x86_darwin_8 === x86_darwin_nil), "8.0 =~ nil")
|
277
|
+
assert((x86_darwin_nil === x86_darwin_8), "nil =~ 8.0")
|
278
|
+
end
|
279
|
+
|
280
|
+
def test_nil_version_is_stricter_for_linux_os
|
281
|
+
x86_linux = Gem::Platform.new "i686-linux"
|
282
|
+
x86_linux_gnu = Gem::Platform.new "i686-linux-gnu"
|
283
|
+
x86_linux_musl = Gem::Platform.new "i686-linux-musl"
|
284
|
+
x86_linux_uclibc = Gem::Platform.new "i686-linux-uclibc"
|
285
|
+
|
286
|
+
# a naked linux runtime is implicit gnu, as it represents the common glibc-linked runtime
|
287
|
+
assert(x86_linux === x86_linux_gnu, "linux =~ linux-gnu")
|
288
|
+
assert(x86_linux_gnu === x86_linux, "linux-gnu =~ linux")
|
289
|
+
|
290
|
+
# musl and explicit gnu should differ
|
291
|
+
refute(x86_linux_gnu === x86_linux_musl, "linux-gnu =~ linux-musl")
|
292
|
+
refute(x86_linux_musl === x86_linux_gnu, "linux-musl =~ linux-gnu")
|
293
|
+
|
294
|
+
# explicit libc differ
|
295
|
+
refute(x86_linux_uclibc === x86_linux_musl, "linux-uclibc =~ linux-musl")
|
296
|
+
refute(x86_linux_musl === x86_linux_uclibc, "linux-musl =~ linux-uclibc")
|
297
|
+
|
298
|
+
# musl host runtime accepts libc-generic or statically linked gems...
|
299
|
+
assert(x86_linux === x86_linux_musl, "linux =~ linux-musl")
|
300
|
+
# ...but implicit gnu runtime generally does not accept musl-specific gems
|
301
|
+
refute(x86_linux_musl === x86_linux, "linux-musl =~ linux")
|
302
|
+
|
303
|
+
# other libc are not glibc compatible
|
304
|
+
refute(x86_linux === x86_linux_uclibc, "linux =~ linux-uclibc")
|
305
|
+
refute(x86_linux_uclibc === x86_linux, "linux-uclibc =~ linux")
|
306
|
+
end
|
307
|
+
|
308
|
+
def test_eabi_version_is_stricter_for_linux_os
|
309
|
+
arm_linux_eabi = Gem::Platform.new "arm-linux-eabi"
|
310
|
+
arm_linux_gnueabi = Gem::Platform.new "arm-linux-gnueabi"
|
311
|
+
arm_linux_musleabi = Gem::Platform.new "arm-linux-musleabi"
|
312
|
+
arm_linux_uclibceabi = Gem::Platform.new "arm-linux-uclibceabi"
|
313
|
+
|
314
|
+
# a naked linux runtime is implicit gnu, as it represents the common glibc-linked runtime
|
315
|
+
assert(arm_linux_eabi === arm_linux_gnueabi, "linux-eabi =~ linux-gnueabi")
|
316
|
+
assert(arm_linux_gnueabi === arm_linux_eabi, "linux-gnueabi =~ linux-eabi")
|
317
|
+
|
318
|
+
# musl and explicit gnu should differ
|
319
|
+
refute(arm_linux_gnueabi === arm_linux_musleabi, "linux-gnueabi =~ linux-musleabi")
|
320
|
+
refute(arm_linux_musleabi === arm_linux_gnueabi, "linux-musleabi =~ linux-gnueabi")
|
321
|
+
|
322
|
+
# explicit libc differ
|
323
|
+
refute(arm_linux_uclibceabi === arm_linux_musleabi, "linux-uclibceabi =~ linux-musleabi")
|
324
|
+
refute(arm_linux_musleabi === arm_linux_uclibceabi, "linux-musleabi =~ linux-uclibceabi")
|
325
|
+
|
326
|
+
# musl host runtime accepts libc-generic or statically linked gems...
|
327
|
+
assert(arm_linux_eabi === arm_linux_musleabi, "linux-eabi =~ linux-musleabi")
|
328
|
+
# ...but implicit gnu runtime generally does not accept musl-specific gems
|
329
|
+
refute(arm_linux_musleabi === arm_linux_eabi, "linux-musleabi =~ linux-eabi")
|
330
|
+
|
331
|
+
# other libc are not glibc compatible
|
332
|
+
refute(arm_linux_eabi === arm_linux_uclibceabi, "linux-eabi =~ linux-uclibceabi")
|
333
|
+
refute(arm_linux_uclibceabi === arm_linux_eabi, "linux-uclibceabi =~ linux-eabi")
|
263
334
|
end
|
264
335
|
|
265
336
|
def test_equals3_cpu_arm
|
266
|
-
arm = Gem::Platform.new
|
267
|
-
armv5 = Gem::Platform.new
|
268
|
-
armv7 = Gem::Platform.new
|
269
|
-
|
270
|
-
util_set_arch
|
271
|
-
assert((arm === Gem::Platform.local),
|
272
|
-
assert((armv5 === Gem::Platform.local),
|
273
|
-
refute((armv7 === Gem::Platform.local),
|
274
|
-
refute((Gem::Platform.local === arm),
|
275
|
-
|
276
|
-
util_set_arch
|
277
|
-
assert((arm === Gem::Platform.local),
|
278
|
-
refute((armv5 === Gem::Platform.local),
|
279
|
-
assert((armv7 === Gem::Platform.local),
|
280
|
-
refute((Gem::Platform.local === arm),
|
337
|
+
arm = Gem::Platform.new "arm-linux"
|
338
|
+
armv5 = Gem::Platform.new "armv5-linux"
|
339
|
+
armv7 = Gem::Platform.new "armv7-linux"
|
340
|
+
|
341
|
+
util_set_arch "armv5-linux"
|
342
|
+
assert((arm === Gem::Platform.local), "arm === armv5")
|
343
|
+
assert((armv5 === Gem::Platform.local), "armv5 === armv5")
|
344
|
+
refute((armv7 === Gem::Platform.local), "armv7 === armv5")
|
345
|
+
refute((Gem::Platform.local === arm), "armv5 === arm")
|
346
|
+
|
347
|
+
util_set_arch "armv7-linux"
|
348
|
+
assert((arm === Gem::Platform.local), "arm === armv7")
|
349
|
+
refute((armv5 === Gem::Platform.local), "armv5 === armv7")
|
350
|
+
assert((armv7 === Gem::Platform.local), "armv7 === armv7")
|
351
|
+
refute((Gem::Platform.local === arm), "armv7 === arm")
|
281
352
|
end
|
282
353
|
|
283
354
|
def test_equals3_universal_mingw
|
284
|
-
uni_mingw = Gem::Platform.new
|
285
|
-
mingw32 = Gem::Platform.new
|
286
|
-
mingw_ucrt = Gem::Platform.new
|
287
|
-
|
288
|
-
util_set_arch
|
289
|
-
assert((uni_mingw === Gem::Platform.local),
|
290
|
-
assert((mingw32 === Gem::Platform.local),
|
291
|
-
refute((mingw_ucrt === Gem::Platform.local),
|
292
|
-
|
293
|
-
util_set_arch
|
294
|
-
assert((uni_mingw === Gem::Platform.local),
|
295
|
-
assert((mingw_ucrt === Gem::Platform.local),
|
296
|
-
refute((mingw32 === Gem::Platform.local),
|
355
|
+
uni_mingw = Gem::Platform.new "universal-mingw"
|
356
|
+
mingw32 = Gem::Platform.new "x64-mingw32"
|
357
|
+
mingw_ucrt = Gem::Platform.new "x64-mingw-ucrt"
|
358
|
+
|
359
|
+
util_set_arch "x64-mingw32"
|
360
|
+
assert((uni_mingw === Gem::Platform.local), "uni_mingw === mingw32")
|
361
|
+
assert((mingw32 === Gem::Platform.local), "mingw32 === mingw32")
|
362
|
+
refute((mingw_ucrt === Gem::Platform.local), "mingw32 === mingw_ucrt")
|
363
|
+
|
364
|
+
util_set_arch "x64-mingw-ucrt"
|
365
|
+
assert((uni_mingw === Gem::Platform.local), "uni_mingw === mingw32")
|
366
|
+
assert((mingw_ucrt === Gem::Platform.local), "mingw_ucrt === mingw_ucrt")
|
367
|
+
refute((mingw32 === Gem::Platform.local), "mingw32 === mingw_ucrt")
|
297
368
|
end
|
298
369
|
|
299
370
|
def test_equals3_version
|
300
|
-
util_set_arch
|
371
|
+
util_set_arch "i686-darwin8"
|
301
372
|
|
302
|
-
x86_darwin = Gem::Platform.new [
|
303
|
-
x86_darwin7 = Gem::Platform.new [
|
304
|
-
x86_darwin8 = Gem::Platform.new [
|
305
|
-
x86_darwin9 = Gem::Platform.new [
|
373
|
+
x86_darwin = Gem::Platform.new ["x86", "darwin", nil]
|
374
|
+
x86_darwin7 = Gem::Platform.new ["x86", "darwin", "7"]
|
375
|
+
x86_darwin8 = Gem::Platform.new ["x86", "darwin", "8"]
|
376
|
+
x86_darwin9 = Gem::Platform.new ["x86", "darwin", "9"]
|
306
377
|
|
307
|
-
assert((x86_darwin === Gem::Platform.local),
|
308
|
-
assert((x86_darwin8 === Gem::Platform.local),
|
378
|
+
assert((x86_darwin === Gem::Platform.local), "x86_darwin === x86_darwin8")
|
379
|
+
assert((x86_darwin8 === Gem::Platform.local), "x86_darwin8 === x86_darwin8")
|
309
380
|
|
310
|
-
refute((x86_darwin7 === Gem::Platform.local),
|
311
|
-
refute((x86_darwin9 === Gem::Platform.local),
|
381
|
+
refute((x86_darwin7 === Gem::Platform.local), "x86_darwin7 === x86_darwin8")
|
382
|
+
refute((x86_darwin9 === Gem::Platform.local), "x86_darwin9 === x86_darwin8")
|
312
383
|
end
|
313
384
|
|
314
385
|
def test_equals_tilde
|
315
|
-
util_set_arch
|
386
|
+
util_set_arch "i386-mswin32"
|
316
387
|
|
317
|
-
assert_local_match
|
318
|
-
assert_local_match
|
388
|
+
assert_local_match "mswin32"
|
389
|
+
assert_local_match "i386-mswin32"
|
319
390
|
|
320
391
|
# oddballs
|
321
|
-
assert_local_match
|
322
|
-
assert_local_match
|
323
|
-
refute_local_match
|
324
|
-
refute_local_match
|
325
|
-
refute_local_match
|
326
|
-
refute_local_match
|
327
|
-
|
328
|
-
util_set_arch
|
329
|
-
assert_local_match
|
330
|
-
assert_local_match
|
331
|
-
assert_local_match
|
332
|
-
|
333
|
-
util_set_arch
|
334
|
-
assert_local_match
|
335
|
-
assert_local_match
|
336
|
-
|
337
|
-
util_set_arch
|
338
|
-
assert_local_match
|
339
|
-
assert_local_match
|
340
|
-
|
341
|
-
util_set_arch
|
342
|
-
assert_local_match
|
343
|
-
assert_local_match
|
344
|
-
refute_local_match
|
345
|
-
assert_local_match
|
346
|
-
assert_local_match
|
347
|
-
refute_local_match
|
348
|
-
|
349
|
-
util_set_arch
|
350
|
-
assert_local_match
|
351
|
-
refute_local_match
|
352
|
-
assert_local_match
|
353
|
-
assert_local_match
|
354
|
-
refute_local_match
|
355
|
-
assert_local_match
|
356
|
-
|
357
|
-
util_set_arch
|
358
|
-
assert_local_match
|
359
|
-
assert_local_match
|
360
|
-
refute_local_match
|
361
|
-
assert_local_match
|
362
|
-
|
363
|
-
util_set_arch
|
364
|
-
assert_local_match
|
365
|
-
|
366
|
-
util_set_arch
|
367
|
-
assert_local_match
|
368
|
-
|
369
|
-
util_set_arch
|
370
|
-
assert_local_match
|
371
|
-
|
372
|
-
util_set_arch
|
373
|
-
assert_local_match
|
392
|
+
assert_local_match "i386-mswin32-mq5.3"
|
393
|
+
assert_local_match "i386-mswin32-mq6"
|
394
|
+
refute_local_match "win32-1.8.2-VC7"
|
395
|
+
refute_local_match "win32-1.8.4-VC6"
|
396
|
+
refute_local_match "win32-source"
|
397
|
+
refute_local_match "windows"
|
398
|
+
|
399
|
+
util_set_arch "i686-linux"
|
400
|
+
assert_local_match "i486-linux"
|
401
|
+
assert_local_match "i586-linux"
|
402
|
+
assert_local_match "i686-linux"
|
403
|
+
|
404
|
+
util_set_arch "i686-darwin8"
|
405
|
+
assert_local_match "i686-darwin8.4.1"
|
406
|
+
assert_local_match "i686-darwin8.8.2"
|
407
|
+
|
408
|
+
util_set_arch "java"
|
409
|
+
assert_local_match "java"
|
410
|
+
assert_local_match "jruby"
|
411
|
+
|
412
|
+
util_set_arch "universal-dotnet2.0"
|
413
|
+
assert_local_match "universal-dotnet"
|
414
|
+
assert_local_match "universal-dotnet-2.0"
|
415
|
+
refute_local_match "universal-dotnet-4.0"
|
416
|
+
assert_local_match "dotnet"
|
417
|
+
assert_local_match "dotnet-2.0"
|
418
|
+
refute_local_match "dotnet-4.0"
|
419
|
+
|
420
|
+
util_set_arch "universal-dotnet4.0"
|
421
|
+
assert_local_match "universal-dotnet"
|
422
|
+
refute_local_match "universal-dotnet-2.0"
|
423
|
+
assert_local_match "universal-dotnet-4.0"
|
424
|
+
assert_local_match "dotnet"
|
425
|
+
refute_local_match "dotnet-2.0"
|
426
|
+
assert_local_match "dotnet-4.0"
|
427
|
+
|
428
|
+
util_set_arch "universal-macruby-1.0"
|
429
|
+
assert_local_match "universal-macruby"
|
430
|
+
assert_local_match "macruby"
|
431
|
+
refute_local_match "universal-macruby-0.10"
|
432
|
+
assert_local_match "universal-macruby-1.0"
|
433
|
+
|
434
|
+
util_set_arch "powerpc-darwin"
|
435
|
+
assert_local_match "powerpc-darwin"
|
436
|
+
|
437
|
+
util_set_arch "powerpc-darwin7"
|
438
|
+
assert_local_match "powerpc-darwin7.9.0"
|
439
|
+
|
440
|
+
util_set_arch "powerpc-darwin8"
|
441
|
+
assert_local_match "powerpc-darwin8.10.0"
|
442
|
+
|
443
|
+
util_set_arch "sparc-solaris2.8"
|
444
|
+
assert_local_match "sparc-solaris2.8-mq5.3"
|
374
445
|
end
|
375
446
|
|
376
447
|
def test_inspect
|