rubygems-update 3.3.18 → 3.3.21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +52 -0
- data/Manifest.txt +4 -0
- data/bin/gem +2 -2
- data/bin/update_rubygems +4 -4
- data/bundler/CHANGELOG.md +78 -0
- data/bundler/UPGRADING.md +11 -4
- 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 +5 -3
- data/bundler/lib/bundler/definition.rb +103 -29
- data/bundler/lib/bundler/dsl.rb +2 -2
- data/bundler/lib/bundler/endpoint_specification.rb +1 -12
- 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 +4 -0
- data/bundler/lib/bundler/index.rb +10 -12
- 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/man/bundle-add.1 +1 -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-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-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-viz.1 +4 -1
- data/bundler/lib/bundler/man/bundle-viz.1.ronn +2 -0
- data/bundler/lib/bundler/man/bundle.1 +10 -9
- data/bundler/lib/bundler/man/bundle.1.ronn +8 -6
- data/bundler/lib/bundler/man/gemfile.5 +16 -10
- data/bundler/lib/bundler/man/gemfile.5.ronn +23 -16
- data/bundler/lib/bundler/man/index.txt +1 -0
- data/bundler/lib/bundler/match_metadata.rb +13 -0
- data/bundler/lib/bundler/match_remote_metadata.rb +26 -0
- data/bundler/lib/bundler/plugin.rb +2 -0
- data/bundler/lib/bundler/remote_specification.rb +6 -11
- data/bundler/lib/bundler/resolver/spec_group.rb +11 -8
- data/bundler/lib/bundler/resolver.rb +40 -18
- 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 +41 -0
- data/bundler/lib/bundler/rubygems_gem_installer.rb +19 -12
- data/bundler/lib/bundler/settings.rb +1 -0
- 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 +38 -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 +33 -33
- 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 -132
- 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 +2 -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 +266 -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 +7 -3
data/lib/rubygems/source.rb
CHANGED
@@ -12,9 +12,9 @@ class Gem::Source
|
|
12
12
|
include Gem::Text
|
13
13
|
|
14
14
|
FILES = { # :nodoc:
|
15
|
-
:released =>
|
16
|
-
:latest =>
|
17
|
-
:prerelease =>
|
15
|
+
:released => "specs",
|
16
|
+
:latest => "latest_specs",
|
17
|
+
:prerelease => "prerelease_specs",
|
18
18
|
}.freeze
|
19
19
|
|
20
20
|
##
|
@@ -62,7 +62,7 @@ class Gem::Source
|
|
62
62
|
end
|
63
63
|
|
64
64
|
def ==(other) # :nodoc:
|
65
|
-
self.class === other
|
65
|
+
self.class === other && @uri == other.uri
|
66
66
|
end
|
67
67
|
|
68
68
|
alias_method :eql?, :== # :nodoc:
|
@@ -71,7 +71,7 @@ class Gem::Source
|
|
71
71
|
# Returns a Set that can fetch specifications from this source.
|
72
72
|
|
73
73
|
def dependency_resolver_set # :nodoc:
|
74
|
-
return Gem::Resolver::IndexSet.new self if
|
74
|
+
return Gem::Resolver::IndexSet.new self if "file" == uri.scheme
|
75
75
|
|
76
76
|
fetch_uri = if uri.host == "rubygems.org"
|
77
77
|
index_uri = uri.dup
|
@@ -141,7 +141,7 @@ class Gem::Source
|
|
141
141
|
return spec if spec
|
142
142
|
end
|
143
143
|
|
144
|
-
source_uri.path <<
|
144
|
+
source_uri.path << ".rz"
|
145
145
|
|
146
146
|
spec = fetcher.fetch_path source_uri
|
147
147
|
spec = Gem::Util.inflate spec
|
@@ -150,7 +150,7 @@ class Gem::Source
|
|
150
150
|
require "fileutils"
|
151
151
|
FileUtils.mkdir_p cache_dir
|
152
152
|
|
153
|
-
File.open local_spec,
|
153
|
+
File.open local_spec, "wb" do |io|
|
154
154
|
io.write spec
|
155
155
|
end
|
156
156
|
end
|
@@ -209,13 +209,13 @@ class Gem::Source
|
|
209
209
|
end
|
210
210
|
|
211
211
|
def pretty_print(q) # :nodoc:
|
212
|
-
q.group 2,
|
212
|
+
q.group 2, "[Remote:", "]" do
|
213
213
|
q.breakable
|
214
214
|
q.text @uri.to_s
|
215
215
|
|
216
216
|
if api = uri
|
217
217
|
q.breakable
|
218
|
-
q.text
|
218
|
+
q.text "API URI: "
|
219
219
|
q.text api.to_s
|
220
220
|
end
|
221
221
|
end
|
@@ -229,13 +229,13 @@ class Gem::Source
|
|
229
229
|
private
|
230
230
|
|
231
231
|
def enforce_trailing_slash(uri)
|
232
|
-
uri.merge(uri.path.gsub(/\/+$/,
|
232
|
+
uri.merge(uri.path.gsub(/\/+$/, "") + "/")
|
233
233
|
end
|
234
234
|
end
|
235
235
|
|
236
|
-
require_relative
|
237
|
-
require_relative
|
238
|
-
require_relative
|
239
|
-
require_relative
|
240
|
-
require_relative
|
241
|
-
require_relative
|
236
|
+
require_relative "source/git"
|
237
|
+
require_relative "source/installed"
|
238
|
+
require_relative "source/specific_file"
|
239
|
+
require_relative "source/local"
|
240
|
+
require_relative "source/lock"
|
241
|
+
require_relative "source/vendor"
|
@@ -1,9 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
require_relative
|
3
|
-
require_relative
|
4
|
-
require_relative
|
5
|
-
require_relative
|
6
|
-
require_relative
|
2
|
+
require_relative "remote_fetcher"
|
3
|
+
require_relative "user_interaction"
|
4
|
+
require_relative "errors"
|
5
|
+
require_relative "text"
|
6
|
+
require_relative "name_tuple"
|
7
7
|
|
8
8
|
##
|
9
9
|
# SpecFetcher handles metadata updates from remote gem repositories.
|
@@ -98,7 +98,7 @@ class Gem::SpecFetcher
|
|
98
98
|
|
99
99
|
found[source] = specs.select do |tup|
|
100
100
|
if dependency.match?(tup)
|
101
|
-
if matching_platform
|
101
|
+
if matching_platform && !Gem::Platform.match_gem?(tup.platform, tup.name)
|
102
102
|
pm = (
|
103
103
|
rejected_specs[dependency] ||= \
|
104
104
|
Gem::PlatformMismatch.new(tup.name, tup.version))
|
@@ -171,19 +171,19 @@ class Gem::SpecFetcher
|
|
171
171
|
# alternative gem names.
|
172
172
|
|
173
173
|
def suggest_gems_from_name(gem_name, type = :latest, num_results = 5)
|
174
|
-
gem_name = gem_name.downcase.tr(
|
174
|
+
gem_name = gem_name.downcase.tr("_-", "")
|
175
175
|
max = gem_name.size / 2
|
176
176
|
names = available_specs(type).first.values.flatten(1)
|
177
177
|
|
178
178
|
matches = names.map do |n|
|
179
179
|
next unless n.match_platform?
|
180
|
-
[n.name, 0] if n.name.downcase.tr(
|
180
|
+
[n.name, 0] if n.name.downcase.tr("_-", "").include?(gem_name)
|
181
181
|
end.compact
|
182
182
|
|
183
183
|
if matches.length < num_results
|
184
184
|
matches += names.map do |n|
|
185
185
|
next unless n.match_platform?
|
186
|
-
distance = levenshtein_distance gem_name, n.name.downcase.tr(
|
186
|
+
distance = levenshtein_distance gem_name, n.name.downcase.tr("_-", "")
|
187
187
|
next if distance >= max
|
188
188
|
return [n.name] if distance == 0
|
189
189
|
[n.name, distance]
|
@@ -6,12 +6,11 @@
|
|
6
6
|
# See LICENSE.txt for permissions.
|
7
7
|
#++
|
8
8
|
|
9
|
-
require_relative
|
10
|
-
require_relative
|
11
|
-
require_relative
|
12
|
-
require_relative
|
13
|
-
require_relative
|
14
|
-
require_relative 'util/list'
|
9
|
+
require_relative "deprecate"
|
10
|
+
require_relative "basic_specification"
|
11
|
+
require_relative "stub_specification"
|
12
|
+
require_relative "platform"
|
13
|
+
require_relative "util/list"
|
15
14
|
|
16
15
|
##
|
17
16
|
# The Specification class contains the information for a gem. Typically
|
@@ -75,20 +74,20 @@ class Gem::Specification < Gem::BasicSpecification
|
|
75
74
|
# key should be equal to the CURRENT_SPECIFICATION_VERSION.
|
76
75
|
|
77
76
|
SPECIFICATION_VERSION_HISTORY = { # :nodoc:
|
78
|
-
-1 => [
|
77
|
+
-1 => ["(RubyGems versions up to and including 0.7 did not have versioned specifications)"],
|
79
78
|
1 => [
|
80
79
|
'Deprecated "test_suite_file" in favor of the new, but equivalent, "test_files"',
|
81
80
|
'"test_file=x" is a shortcut for "test_files=[x]"',
|
82
81
|
],
|
83
82
|
2 => [
|
84
83
|
'Added "required_rubygems_version"',
|
85
|
-
|
84
|
+
"Now forward-compatible with future versions",
|
86
85
|
],
|
87
86
|
3 => [
|
88
|
-
|
87
|
+
"Added Fixnum validation to the specification_version",
|
89
88
|
],
|
90
89
|
4 => [
|
91
|
-
|
90
|
+
"Added sandboxed freeform metadata to the specification version.",
|
92
91
|
],
|
93
92
|
}.freeze
|
94
93
|
|
@@ -127,7 +126,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
127
126
|
@@default_value = {
|
128
127
|
:authors => [],
|
129
128
|
:autorequire => nil,
|
130
|
-
:bindir =>
|
129
|
+
:bindir => "bin",
|
131
130
|
:cert_chain => [],
|
132
131
|
:date => nil,
|
133
132
|
:dependencies => [],
|
@@ -144,7 +143,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
144
143
|
:platform => Gem::Platform::RUBY,
|
145
144
|
:post_install_message => nil,
|
146
145
|
:rdoc_options => [],
|
147
|
-
:require_paths => [
|
146
|
+
:require_paths => ["lib"],
|
148
147
|
:required_ruby_version => Gem::Requirement.default,
|
149
148
|
:required_rubygems_version => Gem::Requirement.default,
|
150
149
|
:requirements => [],
|
@@ -474,7 +473,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
474
473
|
# spec.platform = Gem::Platform.local
|
475
474
|
|
476
475
|
def platform=(platform)
|
477
|
-
if @original_platform.nil?
|
476
|
+
if @original_platform.nil? ||
|
478
477
|
@original_platform == Gem::Platform::RUBY
|
479
478
|
@original_platform = platform
|
480
479
|
end
|
@@ -490,12 +489,12 @@ class Gem::Specification < Gem::BasicSpecification
|
|
490
489
|
# legacy constants
|
491
490
|
when nil, Gem::Platform::RUBY then
|
492
491
|
@new_platform = Gem::Platform::RUBY
|
493
|
-
when
|
494
|
-
@new_platform = Gem::Platform.new
|
495
|
-
when
|
496
|
-
@new_platform = Gem::Platform.new
|
497
|
-
when
|
498
|
-
@new_platform = Gem::Platform.new
|
492
|
+
when "mswin32" then # was Gem::Platform::WIN32
|
493
|
+
@new_platform = Gem::Platform.new "x86-mswin32"
|
494
|
+
when "i586-linux" then # was Gem::Platform::LINUX_586
|
495
|
+
@new_platform = Gem::Platform.new "x86-linux"
|
496
|
+
when "powerpc-darwin" then # was Gem::Platform::DARWIN
|
497
|
+
@new_platform = Gem::Platform.new "ppc-darwin"
|
499
498
|
else
|
500
499
|
@new_platform = Gem::Platform.new platform
|
501
500
|
end
|
@@ -1047,7 +1046,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1047
1046
|
|
1048
1047
|
def self.find_active_stub_by_path(path)
|
1049
1048
|
stub = @@active_stub_with_requirable_file[path] ||= (stubs.find do |s|
|
1050
|
-
s.activated?
|
1049
|
+
s.activated? && s.contains_requirable_file?(path)
|
1051
1050
|
end || NOT_FOUND)
|
1052
1051
|
stub.this
|
1053
1052
|
end
|
@@ -1150,7 +1149,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1150
1149
|
file = file.dup.tap(&Gem::UNTAINT)
|
1151
1150
|
return unless File.file?(file)
|
1152
1151
|
|
1153
|
-
code = Gem.open_file(file,
|
1152
|
+
code = Gem.open_file(file, "r:UTF-8:-", &:read)
|
1154
1153
|
|
1155
1154
|
code.tap(&Gem::UNTAINT)
|
1156
1155
|
|
@@ -1235,7 +1234,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1235
1234
|
latest_remote = remotes.sort.last
|
1236
1235
|
|
1237
1236
|
yield [local_spec, latest_remote] if
|
1238
|
-
latest_remote
|
1237
|
+
latest_remote && local_spec.version < latest_remote
|
1239
1238
|
end
|
1240
1239
|
|
1241
1240
|
nil
|
@@ -1392,7 +1391,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1392
1391
|
@required_rubygems_version,
|
1393
1392
|
@original_platform,
|
1394
1393
|
@dependencies,
|
1395
|
-
|
1394
|
+
"", # rubyforge_project
|
1396
1395
|
@email,
|
1397
1396
|
@authors,
|
1398
1397
|
@description,
|
@@ -1558,7 +1557,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1558
1557
|
# Singular reader for #authors. Returns the first author in the list
|
1559
1558
|
|
1560
1559
|
def author
|
1561
|
-
val = authors
|
1560
|
+
(val = authors) && val.first
|
1562
1561
|
end
|
1563
1562
|
|
1564
1563
|
##
|
@@ -1610,7 +1609,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1610
1609
|
return if default_gem?
|
1611
1610
|
return if File.exist? gem_build_complete_path
|
1612
1611
|
return if !File.writable?(base_dir)
|
1613
|
-
return if !File.exist?(File.join(base_dir,
|
1612
|
+
return if !File.exist?(File.join(base_dir, "extensions"))
|
1614
1613
|
|
1615
1614
|
begin
|
1616
1615
|
# We need to require things in $LOAD_PATH without looking for the
|
@@ -1618,9 +1617,9 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1618
1617
|
unresolved_deps = Gem::Specification.unresolved_deps.dup
|
1619
1618
|
Gem::Specification.unresolved_deps.clear
|
1620
1619
|
|
1621
|
-
require_relative
|
1622
|
-
require_relative
|
1623
|
-
require_relative
|
1620
|
+
require_relative "config_file"
|
1621
|
+
require_relative "ext"
|
1622
|
+
require_relative "user_interaction"
|
1624
1623
|
|
1625
1624
|
ui = Gem::SilentUI.new
|
1626
1625
|
Gem::DefaultUserInteraction.use_ui ui do
|
@@ -1670,7 +1669,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1670
1669
|
conflicts = {}
|
1671
1670
|
self.runtime_dependencies.each do |dep|
|
1672
1671
|
spec = Gem.loaded_specs[dep.name]
|
1673
|
-
if spec
|
1672
|
+
if spec && !spec.satisfies_requirement?(dep)
|
1674
1673
|
(conflicts[spec] ||= []) << dep
|
1675
1674
|
end
|
1676
1675
|
end
|
@@ -1697,7 +1696,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1697
1696
|
self.dependencies.any? do |dep|
|
1698
1697
|
if dep.runtime?
|
1699
1698
|
spec = Gem.loaded_specs[dep.name]
|
1700
|
-
spec
|
1699
|
+
spec && !spec.satisfies_requirement?(dep)
|
1701
1700
|
else
|
1702
1701
|
false
|
1703
1702
|
end
|
@@ -1718,7 +1717,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1718
1717
|
|
1719
1718
|
DateLike = Object.new # :nodoc:
|
1720
1719
|
def DateLike.===(obj) # :nodoc:
|
1721
|
-
defined?(::Date)
|
1720
|
+
defined?(::Date) && Date === obj
|
1722
1721
|
end
|
1723
1722
|
|
1724
1723
|
DateTimeFormat = # :nodoc:
|
@@ -1758,9 +1757,9 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1758
1757
|
# executable now. See Gem.bin_path.
|
1759
1758
|
|
1760
1759
|
def default_executable # :nodoc:
|
1761
|
-
if defined?(@default_executable)
|
1760
|
+
if defined?(@default_executable) && @default_executable
|
1762
1761
|
result = @default_executable
|
1763
|
-
elsif @executables
|
1762
|
+
elsif @executables && @executables.size == 1
|
1764
1763
|
result = Array(@executables).first
|
1765
1764
|
else
|
1766
1765
|
result = nil
|
@@ -1839,7 +1838,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1839
1838
|
# spec.doc_dir 'ri' # => "/path/to/gem_repo/doc/a-1/ri"
|
1840
1839
|
|
1841
1840
|
def doc_dir(type = nil)
|
1842
|
-
@doc_dir ||= File.join base_dir,
|
1841
|
+
@doc_dir ||= File.join base_dir, "doc", full_name
|
1843
1842
|
|
1844
1843
|
if type
|
1845
1844
|
File.join @doc_dir, type
|
@@ -1851,17 +1850,17 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1851
1850
|
def encode_with(coder) # :nodoc:
|
1852
1851
|
mark_version
|
1853
1852
|
|
1854
|
-
coder.add
|
1855
|
-
coder.add
|
1853
|
+
coder.add "name", @name
|
1854
|
+
coder.add "version", @version
|
1856
1855
|
platform = case @original_platform
|
1857
|
-
when nil,
|
1858
|
-
|
1856
|
+
when nil, "" then
|
1857
|
+
"ruby"
|
1859
1858
|
when String then
|
1860
1859
|
@original_platform
|
1861
1860
|
else
|
1862
1861
|
@original_platform.to_s
|
1863
1862
|
end
|
1864
|
-
coder.add
|
1863
|
+
coder.add "platform", platform
|
1865
1864
|
|
1866
1865
|
attributes = @@attributes.map(&:to_s) - %w[name version platform]
|
1867
1866
|
attributes.each do |name|
|
@@ -1877,7 +1876,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1877
1876
|
# Singular accessor for #executables
|
1878
1877
|
|
1879
1878
|
def executable
|
1880
|
-
val = executables
|
1879
|
+
(val = executables) && val.first
|
1881
1880
|
end
|
1882
1881
|
|
1883
1882
|
##
|
@@ -1989,7 +1988,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1989
1988
|
# True if this gem has files in test_files
|
1990
1989
|
|
1991
1990
|
def has_unit_tests? # :nodoc:
|
1992
|
-
|
1991
|
+
!test_files.empty?
|
1993
1992
|
end
|
1994
1993
|
|
1995
1994
|
# :stopdoc:
|
@@ -2042,7 +2041,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2042
2041
|
self.name = name if name
|
2043
2042
|
self.version = version if version
|
2044
2043
|
|
2045
|
-
if platform = Gem.platforms.last
|
2044
|
+
if (platform = Gem.platforms.last) && platform != Gem::Platform::RUBY && platform != Gem::Platform.local
|
2046
2045
|
self.platform = platform
|
2047
2046
|
end
|
2048
2047
|
|
@@ -2157,8 +2156,8 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2157
2156
|
return
|
2158
2157
|
end
|
2159
2158
|
|
2160
|
-
if @specification_version > CURRENT_SPECIFICATION_VERSION
|
2161
|
-
|
2159
|
+
if @specification_version > CURRENT_SPECIFICATION_VERSION &&
|
2160
|
+
sym.to_s.end_with?("=")
|
2162
2161
|
warn "ignoring #{sym} loading #{full_name}" if $DEBUG
|
2163
2162
|
else
|
2164
2163
|
super
|
@@ -2184,7 +2183,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2184
2183
|
# file list.
|
2185
2184
|
|
2186
2185
|
def normalize
|
2187
|
-
if defined?(@extra_rdoc_files)
|
2186
|
+
if defined?(@extra_rdoc_files) && @extra_rdoc_files
|
2188
2187
|
@extra_rdoc_files.uniq!
|
2189
2188
|
@files ||= []
|
2190
2189
|
@files.concat(@extra_rdoc_files)
|
@@ -2209,7 +2208,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2209
2208
|
# platform. For use with legacy gems.
|
2210
2209
|
|
2211
2210
|
def original_name # :nodoc:
|
2212
|
-
if platform == Gem::Platform::RUBY
|
2211
|
+
if platform == Gem::Platform::RUBY || platform.nil?
|
2213
2212
|
"#{@name}-#{@version}"
|
2214
2213
|
else
|
2215
2214
|
"#{@name}-#{@version}-#{@original_platform}"
|
@@ -2231,7 +2230,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2231
2230
|
end
|
2232
2231
|
|
2233
2232
|
def pretty_print(q) # :nodoc:
|
2234
|
-
q.group 2,
|
2233
|
+
q.group 2, "Gem::Specification.new do |s|", "end" do
|
2235
2234
|
q.breakable
|
2236
2235
|
|
2237
2236
|
attributes = @@attributes - [:name, :version]
|
@@ -2242,8 +2241,8 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2242
2241
|
attributes.each do |attr_name|
|
2243
2242
|
current_value = self.send attr_name
|
2244
2243
|
current_value = current_value.sort if %i[files test_files].include? attr_name
|
2245
|
-
if current_value != default_value(attr_name)
|
2246
|
-
self.class.required_attribute?
|
2244
|
+
if current_value != default_value(attr_name) ||
|
2245
|
+
self.class.required_attribute?(attr_name)
|
2247
2246
|
|
2248
2247
|
q.text "s.#{attr_name} = "
|
2249
2248
|
|
@@ -2301,7 +2300,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2301
2300
|
# Singular accessor for #require_paths
|
2302
2301
|
|
2303
2302
|
def require_path
|
2304
|
-
val = require_paths
|
2303
|
+
(val = require_paths) && val.first
|
2305
2304
|
end
|
2306
2305
|
|
2307
2306
|
##
|
@@ -2326,7 +2325,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2326
2325
|
# Returns the full path to this spec's ri directory.
|
2327
2326
|
|
2328
2327
|
def ri_dir
|
2329
|
-
@ri_dir ||= File.join base_dir,
|
2328
|
+
@ri_dir ||= File.join base_dir, "ri", full_name
|
2330
2329
|
end
|
2331
2330
|
|
2332
2331
|
##
|
@@ -2336,13 +2335,13 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2336
2335
|
def ruby_code(obj)
|
2337
2336
|
case obj
|
2338
2337
|
when String then obj.dump + ".freeze"
|
2339
|
-
when Array then
|
2338
|
+
when Array then "[" + obj.map {|x| ruby_code x }.join(", ") + "]"
|
2340
2339
|
when Hash then
|
2341
2340
|
seg = obj.keys.sort.map {|k| "#{k.to_s.dump} => #{obj[k].to_s.dump}" }
|
2342
2341
|
"{ #{seg.join(', ')} }"
|
2343
2342
|
when Gem::Version then obj.to_s.dump
|
2344
|
-
when DateLike then obj.strftime(
|
2345
|
-
when Time then obj.strftime(
|
2343
|
+
when DateLike then obj.strftime("%Y-%m-%d").dump
|
2344
|
+
when Time then obj.strftime("%Y-%m-%d").dump
|
2346
2345
|
when Numeric then obj.inspect
|
2347
2346
|
when true, false, nil then obj.inspect
|
2348
2347
|
when Gem::Platform then "Gem::Platform.new(#{obj.to_a.inspect})"
|
@@ -2376,7 +2375,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2376
2375
|
|
2377
2376
|
def satisfies_requirement?(dependency)
|
2378
2377
|
return @name == dependency.name &&
|
2379
|
-
|
2378
|
+
dependency.requirement.satisfied_by?(@version)
|
2380
2379
|
end
|
2381
2380
|
|
2382
2381
|
##
|
@@ -2430,7 +2429,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2430
2429
|
# Singular accessor for #test_files
|
2431
2430
|
|
2432
2431
|
def test_file # :nodoc:
|
2433
|
-
val = test_files
|
2432
|
+
(val = test_files) && val.first
|
2434
2433
|
end
|
2435
2434
|
|
2436
2435
|
##
|
@@ -2452,7 +2451,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2452
2451
|
@test_files = [@test_suite_file].flatten
|
2453
2452
|
@test_suite_file = nil
|
2454
2453
|
end
|
2455
|
-
if defined?(@test_files)
|
2454
|
+
if defined?(@test_files) && @test_files
|
2456
2455
|
@test_files
|
2457
2456
|
else
|
2458
2457
|
@test_files = []
|
@@ -2476,13 +2475,13 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2476
2475
|
|
2477
2476
|
result << " s.name = #{ruby_code name}"
|
2478
2477
|
result << " s.version = #{ruby_code version}"
|
2479
|
-
unless platform.nil?
|
2478
|
+
unless platform.nil? || platform == Gem::Platform::RUBY
|
2480
2479
|
result << " s.platform = #{ruby_code original_platform}"
|
2481
2480
|
end
|
2482
2481
|
result << ""
|
2483
2482
|
result << " s.required_rubygems_version = #{ruby_code required_rubygems_version} if s.respond_to? :required_rubygems_version="
|
2484
2483
|
|
2485
|
-
if metadata
|
2484
|
+
if metadata && !metadata.empty?
|
2486
2485
|
result << " s.metadata = #{ruby_code metadata} if s.respond_to? :metadata="
|
2487
2486
|
end
|
2488
2487
|
result << " s.require_paths = #{ruby_code raw_require_paths}"
|
@@ -2575,14 +2574,14 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2575
2574
|
# back, we have to check again here to make sure that our
|
2576
2575
|
# psych code was properly loaded, and load it if not.
|
2577
2576
|
unless Gem.const_defined?(:NoAliasYAMLTree)
|
2578
|
-
require_relative
|
2577
|
+
require_relative "psych_tree"
|
2579
2578
|
end
|
2580
2579
|
|
2581
2580
|
builder = Gem::NoAliasYAMLTree.create
|
2582
2581
|
builder << self
|
2583
2582
|
ast = builder.tree
|
2584
2583
|
|
2585
|
-
require
|
2584
|
+
require "stringio"
|
2586
2585
|
io = StringIO.new
|
2587
2586
|
io.set_encoding Encoding::UTF_8
|
2588
2587
|
|
@@ -2666,10 +2665,12 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2666
2665
|
|
2667
2666
|
def version=(version)
|
2668
2667
|
@version = Gem::Version.create(version)
|
2668
|
+
return if @version.nil?
|
2669
|
+
|
2669
2670
|
# skip to set required_ruby_version when pre-released rubygems.
|
2670
2671
|
# It caused to raise CircularDependencyError
|
2671
2672
|
if @version.prerelease? && (@name.nil? || @name.strip != "rubygems")
|
2672
|
-
self.required_rubygems_version =
|
2673
|
+
self.required_rubygems_version = "> 1.3.1"
|
2673
2674
|
end
|
2674
2675
|
invalidate_memoized_attributes
|
2675
2676
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require_relative
|
1
|
+
require_relative "user_interaction"
|
2
2
|
|
3
3
|
class Gem::SpecificationPolicy
|
4
4
|
include Gem::UserInteraction
|
@@ -120,7 +120,7 @@ class Gem::SpecificationPolicy
|
|
120
120
|
metadata = @specification.metadata
|
121
121
|
|
122
122
|
unless Hash === metadata
|
123
|
-
error
|
123
|
+
error "metadata must be a hash"
|
124
124
|
end
|
125
125
|
|
126
126
|
metadata.each do |key, value|
|
@@ -188,7 +188,7 @@ duplicate dependency on #{dep}, (#{prev.requirement}) use:
|
|
188
188
|
prerelease_dep && !@specification.version.prerelease?
|
189
189
|
|
190
190
|
open_ended = dep.requirement.requirements.all? do |op, version|
|
191
|
-
|
191
|
+
!version.prerelease? && (op == ">" || op == ">=")
|
192
192
|
end
|
193
193
|
|
194
194
|
if open_ended
|
@@ -198,12 +198,12 @@ duplicate dependency on #{dep}, (#{prev.requirement}) use:
|
|
198
198
|
|
199
199
|
base = segments.first 2
|
200
200
|
|
201
|
-
recommendation = if (op ==
|
201
|
+
recommendation = if (op == ">" || op == ">=") && segments == [0]
|
202
202
|
" use a bounded requirement, such as '~> x.y'"
|
203
203
|
else
|
204
|
-
bugfix = if op ==
|
204
|
+
bugfix = if op == ">"
|
205
205
|
", '> #{dep_version}'"
|
206
|
-
elsif op ==
|
206
|
+
elsif op == ">=" && base != segments
|
207
207
|
", '>= #{dep_version}'"
|
208
208
|
end
|
209
209
|
|
@@ -286,7 +286,7 @@ duplicate dependency on #{dep}, (#{prev.requirement}) use:
|
|
286
286
|
def validate_require_paths
|
287
287
|
return unless @specification.raw_require_paths.empty?
|
288
288
|
|
289
|
-
error
|
289
|
+
error "specification must have at least one require_path"
|
290
290
|
end
|
291
291
|
|
292
292
|
def validate_non_files
|
@@ -310,7 +310,7 @@ duplicate dependency on #{dep}, (#{prev.requirement}) use:
|
|
310
310
|
def validate_specification_version
|
311
311
|
return if @specification.specification_version.is_a?(Integer)
|
312
312
|
|
313
|
-
error
|
313
|
+
error "specification_version must be an Integer (did you mean version?)"
|
314
314
|
end
|
315
315
|
|
316
316
|
def validate_platform
|
@@ -338,7 +338,7 @@ duplicate dependency on #{dep}, (#{prev.requirement}) use:
|
|
338
338
|
String
|
339
339
|
end
|
340
340
|
|
341
|
-
unless Array === val
|
341
|
+
unless Array === val && val.all? {|x| x.kind_of?(klass) }
|
342
342
|
error "#{field} must be an Array of #{klass}"
|
343
343
|
end
|
344
344
|
end
|
@@ -380,7 +380,7 @@ http://spdx.org/licenses or '#{Gem::Licenses::NONSTANDARD}' for a nonstandard li
|
|
380
380
|
WARNING
|
381
381
|
end
|
382
382
|
|
383
|
-
LAZY = '"FIxxxXME" or "TOxxxDO"'.gsub(/xxx/,
|
383
|
+
LAZY = '"FIxxxXME" or "TOxxxDO"'.gsub(/xxx/, "")
|
384
384
|
LAZY_PATTERN = /\AFI XME|\ATO DO/x.freeze
|
385
385
|
HOMEPAGE_URI_PATTERN = /\A[a-z][a-z\d+.-]*:/i.freeze
|
386
386
|
|
@@ -404,8 +404,8 @@ http://spdx.org/licenses or '#{Gem::Licenses::NONSTANDARD}' for a nonstandard li
|
|
404
404
|
homepage = @specification.homepage
|
405
405
|
|
406
406
|
# Make sure a homepage is valid HTTP/HTTPS URI
|
407
|
-
if homepage
|
408
|
-
require
|
407
|
+
if homepage && !homepage.empty?
|
408
|
+
require "uri"
|
409
409
|
begin
|
410
410
|
homepage_uri = URI.parse(homepage)
|
411
411
|
unless [URI::HTTP, URI::HTTPS].member? homepage_uri.class
|
@@ -445,7 +445,7 @@ http://spdx.org/licenses or '#{Gem::Licenses::NONSTANDARD}' for a nonstandard li
|
|
445
445
|
|
446
446
|
def validate_shebang_line_in(executable)
|
447
447
|
executable_path = File.join(@specification.bindir, executable)
|
448
|
-
return if File.read(executable_path, 2) ==
|
448
|
+
return if File.read(executable_path, 2) == "#!"
|
449
449
|
|
450
450
|
warning "#{executable_path} is missing #! line"
|
451
451
|
end
|
@@ -457,11 +457,11 @@ http://spdx.org/licenses or '#{Gem::Licenses::NONSTANDARD}' for a nonstandard li
|
|
457
457
|
end
|
458
458
|
|
459
459
|
def validate_extensions # :nodoc:
|
460
|
-
require_relative
|
460
|
+
require_relative "ext"
|
461
461
|
builder = Gem::Ext::Builder.new(@specification)
|
462
462
|
|
463
463
|
rake_extension = @specification.extensions.any? {|s| builder.builder_for(s) == Gem::Ext::RakeBuilder }
|
464
|
-
rake_dependency = @specification.dependencies.any? {|d| d.name ==
|
464
|
+
rake_dependency = @specification.dependencies.any? {|d| d.name == "rake" }
|
465
465
|
|
466
466
|
warning <<-WARNING if rake_extension && !rake_dependency
|
467
467
|
You have specified rake based extension, but rake is not added as dependency. It is recommended to add rake as a dependency in gemspec since there's no guarantee rake will be already installed.
|
@@ -9,7 +9,7 @@ class Gem::StubSpecification < Gem::BasicSpecification
|
|
9
9
|
PREFIX = "# stub: ".freeze
|
10
10
|
|
11
11
|
# :nodoc:
|
12
|
-
OPEN_MODE =
|
12
|
+
OPEN_MODE = "r:UTF-8:-".freeze
|
13
13
|
|
14
14
|
class StubLine # :nodoc: all
|
15
15
|
attr_reader :name, :version, :platform, :require_paths, :extensions,
|
@@ -19,9 +19,9 @@ class Gem::StubSpecification < Gem::BasicSpecification
|
|
19
19
|
|
20
20
|
# These are common require paths.
|
21
21
|
REQUIRE_PATHS = { # :nodoc:
|
22
|
-
|
23
|
-
|
24
|
-
|
22
|
+
"lib" => "lib".freeze,
|
23
|
+
"test" => "test".freeze,
|
24
|
+
"ext" => "ext".freeze,
|
25
25
|
}.freeze
|
26
26
|
|
27
27
|
# These are common require path lists. This hash is used to optimize
|
@@ -29,7 +29,7 @@ class Gem::StubSpecification < Gem::BasicSpecification
|
|
29
29
|
# in their require paths, so lets take advantage of that by pre-allocating
|
30
30
|
# a require path list for that case.
|
31
31
|
REQUIRE_PATH_LIST = { # :nodoc:
|
32
|
-
|
32
|
+
"lib" => ["lib"].freeze,
|
33
33
|
}.freeze
|
34
34
|
|
35
35
|
def initialize(data, extensions)
|