rubygems-update 2.7.11 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rubygems-update might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.rubocop.yml +66 -0
- data/.travis.yml +22 -18
- data/CONTRIBUTING.md +141 -0
- data/History.txt +289 -19
- data/MAINTAINERS.txt +1 -0
- data/Manifest.txt +16 -11
- data/POLICIES.md +92 -0
- data/README.md +47 -26
- data/Rakefile +47 -207
- data/{UPGRADING.rdoc → UPGRADING.md} +31 -32
- data/appveyor.yml +20 -45
- data/bin/gem +1 -2
- data/bin/update_rubygems +2 -3
- data/bundler/CHANGELOG.md +54 -0
- data/bundler/bundler.gemspec +7 -1
- data/bundler/lib/bundler.rb +26 -8
- data/bundler/lib/bundler/build_metadata.rb +2 -2
- data/bundler/lib/bundler/cli.rb +63 -21
- data/bundler/lib/bundler/cli/add.rb +15 -5
- data/bundler/lib/bundler/cli/binstubs.rb +8 -2
- data/bundler/lib/bundler/cli/doctor.rb +47 -1
- data/bundler/lib/bundler/cli/install.rb +8 -5
- data/bundler/lib/bundler/cli/list.rb +41 -5
- data/bundler/lib/bundler/cli/outdated.rb +7 -1
- data/bundler/lib/bundler/cli/pristine.rb +4 -0
- data/bundler/lib/bundler/cli/remove.rb +18 -0
- data/bundler/lib/bundler/definition.rb +15 -16
- data/bundler/lib/bundler/dependency.rb +2 -2
- data/bundler/lib/bundler/dsl.rb +19 -3
- data/bundler/lib/bundler/feature_flag.rb +7 -0
- data/bundler/lib/bundler/gem_version_promoter.rb +4 -2
- data/bundler/lib/bundler/injector.rb +168 -9
- data/bundler/lib/bundler/installer.rb +29 -6
- data/bundler/lib/bundler/installer/parallel_installer.rb +5 -0
- data/bundler/lib/bundler/plugin.rb +10 -3
- data/bundler/lib/bundler/plugin/events.rb +61 -0
- data/bundler/lib/bundler/resolver.rb +2 -2
- data/bundler/lib/bundler/runtime.rb +8 -2
- data/bundler/lib/bundler/settings.rb +24 -3
- data/bundler/lib/bundler/settings/validator.rb +23 -0
- data/bundler/lib/bundler/shared_helpers.rb +19 -3
- data/bundler/lib/bundler/source.rb +9 -9
- data/bundler/lib/bundler/templates/newgem/lib/newgem.rb.tt +1 -0
- data/bundler/lib/bundler/version.rb +1 -1
- data/bundler/man/bundle-add.ronn +13 -2
- data/bundler/man/bundle-config.ronn +21 -0
- data/bundler/man/bundle-install.ronn +1 -1
- data/bundler/man/bundle-list.ronn +19 -1
- data/bundler/man/bundle-outdated.ronn +4 -0
- data/bundler/man/bundle-remove.ronn +23 -0
- data/bundler/man/bundle-update.ronn +1 -1
- data/lib/rubygems.rb +70 -96
- data/lib/rubygems/available_set.rb +1 -1
- data/lib/rubygems/basic_specification.rb +12 -12
- data/lib/rubygems/bundler_version_finder.rb +3 -3
- data/lib/rubygems/command.rb +22 -15
- data/lib/rubygems/command_manager.rb +20 -11
- data/lib/rubygems/commands/build_command.rb +27 -8
- data/lib/rubygems/commands/cert_command.rb +45 -24
- data/lib/rubygems/commands/check_command.rb +1 -1
- data/lib/rubygems/commands/cleanup_command.rb +14 -7
- data/lib/rubygems/commands/contents_command.rb +14 -15
- data/lib/rubygems/commands/dependency_command.rb +17 -17
- data/lib/rubygems/commands/environment_command.rb +20 -1
- data/lib/rubygems/commands/fetch_command.rb +2 -3
- data/lib/rubygems/commands/generate_index_command.rb +2 -3
- data/lib/rubygems/commands/help_command.rb +12 -13
- data/lib/rubygems/commands/info_command.rb +33 -0
- data/lib/rubygems/commands/install_command.rb +21 -17
- data/lib/rubygems/commands/list_command.rb +0 -1
- data/lib/rubygems/commands/lock_command.rb +3 -4
- data/lib/rubygems/commands/open_command.rb +16 -10
- data/lib/rubygems/commands/owner_command.rb +20 -11
- data/lib/rubygems/commands/pristine_command.rb +23 -16
- data/lib/rubygems/commands/push_command.rb +17 -8
- data/lib/rubygems/commands/query_command.rb +24 -24
- data/lib/rubygems/commands/rdoc_command.rb +3 -4
- data/lib/rubygems/commands/search_command.rb +0 -1
- data/lib/rubygems/commands/server_command.rb +1 -2
- data/lib/rubygems/commands/setup_command.rb +78 -38
- data/lib/rubygems/commands/signin_command.rb +2 -1
- data/lib/rubygems/commands/signout_command.rb +2 -2
- data/lib/rubygems/commands/sources_command.rb +11 -12
- data/lib/rubygems/commands/specification_command.rb +7 -7
- data/lib/rubygems/commands/uninstall_command.rb +41 -19
- data/lib/rubygems/commands/unpack_command.rb +16 -7
- data/lib/rubygems/commands/update_command.rb +28 -23
- data/lib/rubygems/commands/which_command.rb +4 -5
- data/lib/rubygems/commands/yank_command.rb +1 -2
- data/lib/rubygems/compatibility.rb +1 -21
- data/lib/rubygems/config_file.rb +36 -36
- data/lib/rubygems/core_ext/kernel_require.rb +6 -6
- data/lib/rubygems/core_ext/kernel_warn.rb +45 -0
- data/lib/rubygems/defaults.rb +31 -12
- data/lib/rubygems/dependency.rb +14 -14
- data/lib/rubygems/dependency_installer.rb +29 -31
- data/lib/rubygems/dependency_list.rb +8 -9
- data/lib/rubygems/deprecate.rb +2 -3
- data/lib/rubygems/doctor.rb +5 -6
- data/lib/rubygems/errors.rb +3 -3
- data/lib/rubygems/exceptions.rb +11 -4
- data/lib/rubygems/ext.rb +0 -1
- data/lib/rubygems/ext/build_error.rb +0 -1
- data/lib/rubygems/ext/builder.rb +50 -23
- data/lib/rubygems/ext/cmake_builder.rb +2 -2
- data/lib/rubygems/ext/configure_builder.rb +2 -3
- data/lib/rubygems/ext/ext_conf_builder.rb +8 -7
- data/lib/rubygems/ext/rake_builder.rb +16 -18
- data/lib/rubygems/gem_runner.rb +2 -2
- data/lib/rubygems/gemcutter_utilities.rb +40 -13
- data/lib/rubygems/indexer.rb +19 -12
- data/lib/rubygems/install_default_message.rb +0 -1
- data/lib/rubygems/install_message.rb +0 -1
- data/lib/rubygems/install_update_options.rb +2 -28
- data/lib/rubygems/installer.rb +95 -75
- data/lib/rubygems/installer_test_case.rb +0 -14
- data/lib/rubygems/local_remote_options.rb +5 -4
- data/lib/rubygems/mock_gem_ui.rb +3 -4
- data/lib/rubygems/name_tuple.rb +4 -4
- data/lib/rubygems/package.rb +90 -73
- data/lib/rubygems/package/digest_io.rb +3 -4
- data/lib/rubygems/package/file_source.rb +3 -4
- data/lib/rubygems/package/io_source.rb +1 -2
- data/lib/rubygems/package/old.rb +8 -16
- data/lib/rubygems/package/source.rb +0 -1
- data/lib/rubygems/package/tar_header.rb +2 -2
- data/lib/rubygems/package/tar_reader.rb +2 -4
- data/lib/rubygems/package/tar_reader/entry.rb +20 -4
- data/lib/rubygems/package/tar_test_case.rb +2 -8
- data/lib/rubygems/package/tar_writer.rb +13 -15
- data/lib/rubygems/package_task.rb +0 -1
- data/lib/rubygems/path_support.rb +16 -6
- data/lib/rubygems/platform.rb +4 -5
- data/lib/rubygems/psych_tree.rb +1 -1
- data/lib/rubygems/rdoc.rb +0 -311
- data/lib/rubygems/remote_fetcher.rb +34 -48
- data/lib/rubygems/request.rb +16 -15
- data/lib/rubygems/request/connection_pools.rb +24 -13
- data/lib/rubygems/request/http_pool.rb +3 -4
- data/lib/rubygems/request/https_pool.rb +1 -3
- data/lib/rubygems/request_set.rb +52 -25
- data/lib/rubygems/request_set/gem_dependency_api.rb +36 -40
- data/lib/rubygems/request_set/lockfile.rb +12 -12
- data/lib/rubygems/request_set/lockfile/parser.rb +18 -29
- data/lib/rubygems/request_set/lockfile/tokenizer.rb +9 -9
- data/lib/rubygems/requirement.rb +16 -16
- data/lib/rubygems/resolver.rb +10 -15
- data/lib/rubygems/resolver/activation_request.rb +6 -6
- data/lib/rubygems/resolver/api_set.rb +5 -6
- data/lib/rubygems/resolver/api_specification.rb +2 -3
- data/lib/rubygems/resolver/best_set.rb +5 -6
- data/lib/rubygems/resolver/composed_set.rb +5 -6
- data/lib/rubygems/resolver/conflict.rb +5 -5
- data/lib/rubygems/resolver/current_set.rb +1 -2
- data/lib/rubygems/resolver/dependency_request.rb +4 -4
- data/lib/rubygems/resolver/git_set.rb +5 -6
- data/lib/rubygems/resolver/git_specification.rb +4 -5
- data/lib/rubygems/resolver/index_set.rb +5 -6
- data/lib/rubygems/resolver/index_specification.rb +3 -4
- data/lib/rubygems/resolver/installed_specification.rb +3 -4
- data/lib/rubygems/resolver/installer_set.rb +12 -12
- data/lib/rubygems/resolver/local_specification.rb +1 -2
- data/lib/rubygems/resolver/lock_set.rb +5 -6
- data/lib/rubygems/resolver/lock_specification.rb +7 -8
- data/lib/rubygems/resolver/requirement_list.rb +1 -1
- data/lib/rubygems/resolver/set.rb +2 -2
- data/lib/rubygems/resolver/source_set.rb +4 -5
- data/lib/rubygems/resolver/spec_specification.rb +1 -2
- data/lib/rubygems/resolver/specification.rb +10 -7
- data/lib/rubygems/resolver/stats.rb +1 -1
- data/lib/rubygems/resolver/vendor_set.rb +4 -5
- data/lib/rubygems/resolver/vendor_specification.rb +2 -3
- data/lib/rubygems/safe_yaml.rb +18 -10
- data/lib/rubygems/security.rb +21 -22
- data/lib/rubygems/security/policies.rb +1 -2
- data/lib/rubygems/security/policy.rb +25 -25
- data/lib/rubygems/security/signer.rb +72 -24
- data/lib/rubygems/security/trust_dir.rb +10 -10
- data/lib/rubygems/server.rb +21 -21
- data/lib/rubygems/source.rb +16 -25
- data/lib/rubygems/source/git.rb +9 -10
- data/lib/rubygems/source/installed.rb +3 -4
- data/lib/rubygems/source/local.rb +7 -7
- data/lib/rubygems/source/lock.rb +4 -4
- data/lib/rubygems/source/specific_file.rb +5 -5
- data/lib/rubygems/source/vendor.rb +2 -3
- data/lib/rubygems/source_list.rb +2 -2
- data/lib/rubygems/source_local.rb +0 -1
- data/lib/rubygems/spec_fetcher.rb +5 -6
- data/lib/rubygems/specification.rb +199 -536
- data/lib/rubygems/specification_policy.rb +407 -0
- data/lib/rubygems/ssl_certs/{rubygems.org → index.rubygems.org}/GlobalSignRootCA.pem +0 -0
- data/lib/rubygems/ssl_certs/rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem +23 -0
- data/lib/rubygems/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem +25 -0
- data/lib/rubygems/stub_specification.rb +11 -15
- data/lib/rubygems/test_case.rb +141 -66
- data/lib/rubygems/test_utilities.rb +20 -35
- data/lib/rubygems/text.rb +6 -6
- data/lib/rubygems/uninstaller.rb +37 -26
- data/lib/rubygems/uri_formatter.rb +1 -2
- data/lib/rubygems/user_interaction.rb +38 -93
- data/lib/rubygems/util.rb +20 -14
- data/lib/rubygems/util/licenses.rb +27 -1
- data/lib/rubygems/util/list.rb +1 -1
- data/lib/rubygems/validator.rb +4 -5
- data/lib/rubygems/version.rb +15 -15
- data/lib/rubygems/version_option.rb +2 -3
- data/rubygems-update.gemspec +43 -0
- data/setup.rb +2 -8
- data/test/rubygems/rubygems_plugin.rb +0 -1
- data/test/rubygems/simple_gem.rb +1 -1
- data/test/rubygems/test_bundled_ca.rb +4 -7
- data/test/rubygems/test_config.rb +7 -2
- data/test/rubygems/test_gem.rb +161 -130
- data/test/rubygems/test_gem_command.rb +0 -1
- data/test/rubygems/test_gem_command_manager.rb +8 -3
- data/test/rubygems/test_gem_commands_build_command.rb +219 -15
- data/test/rubygems/test_gem_commands_cert_command.rb +69 -8
- data/test/rubygems/test_gem_commands_check_command.rb +1 -1
- data/test/rubygems/test_gem_commands_cleanup_command.rb +27 -1
- data/test/rubygems/test_gem_commands_contents_command.rb +1 -2
- data/test/rubygems/test_gem_commands_dependency_command.rb +33 -34
- data/test/rubygems/test_gem_commands_environment_command.rb +1 -0
- data/test/rubygems/test_gem_commands_fetch_command.rb +0 -1
- data/test/rubygems/test_gem_commands_generate_index_command.rb +0 -1
- data/test/rubygems/test_gem_commands_help_command.rb +7 -4
- data/test/rubygems/test_gem_commands_info_command.rb +44 -0
- data/test/rubygems/test_gem_commands_install_command.rb +79 -12
- data/test/rubygems/test_gem_commands_lock_command.rb +0 -1
- data/test/rubygems/test_gem_commands_open_command.rb +29 -0
- data/test/rubygems/test_gem_commands_outdated_command.rb +0 -1
- data/test/rubygems/test_gem_commands_owner_command.rb +93 -57
- data/test/rubygems/test_gem_commands_pristine_command.rb +65 -30
- data/test/rubygems/test_gem_commands_push_command.rb +39 -0
- data/test/rubygems/test_gem_commands_query_command.rb +102 -100
- data/test/rubygems/test_gem_commands_search_command.rb +0 -1
- data/test/rubygems/test_gem_commands_server_command.rb +0 -1
- data/test/rubygems/test_gem_commands_setup_command.rb +39 -8
- data/test/rubygems/test_gem_commands_signin_command.rb +1 -1
- data/test/rubygems/test_gem_commands_sources_command.rb +0 -1
- data/test/rubygems/test_gem_commands_specification_command.rb +2 -3
- data/test/rubygems/test_gem_commands_stale_command.rb +3 -2
- data/test/rubygems/test_gem_commands_uninstall_command.rb +81 -7
- data/test/rubygems/test_gem_commands_unpack_command.rb +17 -1
- data/test/rubygems/test_gem_commands_update_command.rb +19 -2
- data/test/rubygems/test_gem_commands_which_command.rb +0 -1
- data/test/rubygems/test_gem_commands_yank_command.rb +0 -1
- data/test/rubygems/test_gem_config_file.rb +4 -2
- data/test/rubygems/test_gem_dependency.rb +0 -1
- data/test/rubygems/test_gem_dependency_installer.rb +8 -5
- data/test/rubygems/test_gem_dependency_list.rb +6 -7
- data/test/rubygems/test_gem_dependency_resolution_error.rb +0 -1
- data/test/rubygems/test_gem_doctor.rb +1 -2
- data/test/rubygems/test_gem_ext_builder.rb +10 -23
- data/test/rubygems/test_gem_ext_cmake_builder.rb +5 -4
- data/test/rubygems/test_gem_ext_configure_builder.rb +3 -3
- data/test/rubygems/test_gem_ext_ext_conf_builder.rb +8 -9
- data/test/rubygems/test_gem_ext_rake_builder.rb +20 -5
- data/test/rubygems/test_gem_gem_runner.rb +0 -1
- data/test/rubygems/test_gem_gemcutter_utilities.rb +32 -6
- data/test/rubygems/test_gem_impossible_dependencies_error.rb +0 -1
- data/test/rubygems/test_gem_indexer.rb +1 -2
- data/test/rubygems/test_gem_install_update_options.rb +1 -20
- data/test/rubygems/test_gem_installer.rb +69 -203
- data/test/rubygems/test_gem_local_remote_options.rb +3 -3
- data/test/rubygems/test_gem_name_tuple.rb +0 -1
- data/test/rubygems/test_gem_package.rb +59 -50
- data/test/rubygems/test_gem_package_old.rb +0 -1
- data/test/rubygems/test_gem_package_tar_header.rb +1 -2
- data/test/rubygems/test_gem_package_tar_reader.rb +0 -1
- data/test/rubygems/test_gem_package_tar_reader_entry.rb +11 -0
- data/test/rubygems/test_gem_package_tar_writer.rb +40 -7
- data/test/rubygems/test_gem_package_task.rb +2 -2
- data/test/rubygems/test_gem_path_support.rb +28 -11
- data/test/rubygems/test_gem_platform.rb +4 -5
- data/test/rubygems/test_gem_rdoc.rb +1 -2
- data/test/rubygems/test_gem_remote_fetcher.rb +111 -130
- data/test/rubygems/test_gem_request.rb +5 -5
- data/test/rubygems/test_gem_request_connection_pools.rb +24 -3
- data/test/rubygems/test_gem_request_set.rb +5 -5
- data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +2 -7
- data/test/rubygems/test_gem_request_set_lockfile.rb +1 -2
- data/test/rubygems/test_gem_request_set_lockfile_parser.rb +4 -9
- data/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb +1 -1
- data/test/rubygems/test_gem_requirement.rb +18 -4
- data/test/rubygems/test_gem_resolver.rb +13 -17
- data/test/rubygems/test_gem_resolver_activation_request.rb +0 -1
- data/test/rubygems/test_gem_resolver_api_set.rb +0 -1
- data/test/rubygems/test_gem_resolver_api_specification.rb +0 -1
- data/test/rubygems/test_gem_resolver_best_set.rb +0 -1
- data/test/rubygems/test_gem_resolver_composed_set.rb +0 -1
- data/test/rubygems/test_gem_resolver_conflict.rb +0 -1
- data/test/rubygems/test_gem_resolver_dependency_request.rb +0 -1
- data/test/rubygems/test_gem_resolver_git_set.rb +0 -1
- data/test/rubygems/test_gem_resolver_git_specification.rb +0 -1
- data/test/rubygems/test_gem_resolver_index_set.rb +0 -1
- data/test/rubygems/test_gem_resolver_index_specification.rb +0 -1
- data/test/rubygems/test_gem_resolver_installed_specification.rb +0 -1
- data/test/rubygems/test_gem_resolver_installer_set.rb +2 -3
- data/test/rubygems/test_gem_resolver_local_specification.rb +0 -1
- data/test/rubygems/test_gem_resolver_lock_set.rb +0 -1
- data/test/rubygems/test_gem_resolver_lock_specification.rb +0 -1
- data/test/rubygems/test_gem_resolver_requirement_list.rb +0 -1
- data/test/rubygems/test_gem_resolver_specification.rb +1 -2
- data/test/rubygems/test_gem_resolver_vendor_set.rb +0 -1
- data/test/rubygems/test_gem_resolver_vendor_specification.rb +0 -1
- data/test/rubygems/test_gem_security.rb +1 -3
- data/test/rubygems/test_gem_security_policy.rb +4 -5
- data/test/rubygems/test_gem_security_signer.rb +4 -3
- data/test/rubygems/test_gem_security_trust_dir.rb +1 -2
- data/test/rubygems/test_gem_server.rb +4 -4
- data/test/rubygems/test_gem_source.rb +0 -13
- data/test/rubygems/test_gem_source_fetch_problem.rb +0 -1
- data/test/rubygems/test_gem_source_git.rb +0 -1
- data/test/rubygems/test_gem_source_installed.rb +0 -1
- data/test/rubygems/test_gem_source_lock.rb +0 -1
- data/test/rubygems/test_gem_source_vendor.rb +0 -1
- data/test/rubygems/test_gem_spec_fetcher.rb +0 -1
- data/test/rubygems/test_gem_specification.rb +334 -198
- data/test/rubygems/test_gem_stream_ui.rb +13 -30
- data/test/rubygems/test_gem_stub_specification.rb +0 -2
- data/test/rubygems/test_gem_text.rb +4 -5
- data/test/rubygems/test_gem_uninstaller.rb +21 -1
- data/test/rubygems/test_gem_unsatisfiable_dependency_error.rb +0 -1
- data/test/rubygems/test_gem_uri_formatter.rb +0 -1
- data/test/rubygems/test_gem_util.rb +6 -11
- data/test/rubygems/test_gem_validator.rb +0 -1
- data/test/rubygems/test_gem_version.rb +11 -11
- data/test/rubygems/test_gem_version_option.rb +0 -1
- data/test/rubygems/test_remote_fetch_error.rb +0 -1
- data/test/rubygems/test_require.rb +67 -52
- data/util/CL2notes +1 -2
- data/util/ci +15 -12
- data/util/create_certs.rb +6 -7
- data/util/create_encrypted_key.rb +0 -1
- data/util/patch_with_prs.rb +1 -1
- data/util/rubocop +8 -0
- data/util/update_bundled_ca_certificates.rb +15 -14
- data/util/update_changelog.rb +1 -1
- metadata +67 -59
- data/.autotest +0 -71
- data/.document +0 -5
- data/CONTRIBUTING.rdoc +0 -130
- data/CVE-2013-4287.txt +0 -35
- data/CVE-2013-4363.txt +0 -45
- data/CVE-2015-3900.txt +0 -40
- data/POLICIES.rdoc +0 -74
- data/lib/rubygems/ssl_certs/rubygems.org/GlobalSignRootCA_R3.pem +0 -21
- data/test/rubygems/fix_openssl_warnings.rb +0 -13
@@ -5,11 +5,11 @@ class Gem::RequestSet::Lockfile::Tokenizer
|
|
5
5
|
Token = Struct.new :type, :value, :column, :line
|
6
6
|
EOF = Token.new :EOF
|
7
7
|
|
8
|
-
def self.from_file
|
8
|
+
def self.from_file(file)
|
9
9
|
new File.read(file), file
|
10
10
|
end
|
11
11
|
|
12
|
-
def initialize
|
12
|
+
def initialize(input, filename = nil, line = 0, pos = 0)
|
13
13
|
@line = line
|
14
14
|
@line_pos = pos
|
15
15
|
@tokens = []
|
@@ -17,7 +17,7 @@ class Gem::RequestSet::Lockfile::Tokenizer
|
|
17
17
|
tokenize input
|
18
18
|
end
|
19
19
|
|
20
|
-
def make_parser
|
20
|
+
def make_parser(set, platforms)
|
21
21
|
Gem::RequestSet::Lockfile::Parser.new self, set, platforms, @filename
|
22
22
|
end
|
23
23
|
|
@@ -25,7 +25,7 @@ class Gem::RequestSet::Lockfile::Tokenizer
|
|
25
25
|
@tokens.map { |token| [token.type, token.value, token.column, token.line] }
|
26
26
|
end
|
27
27
|
|
28
|
-
def skip
|
28
|
+
def skip(type)
|
29
29
|
@tokens.shift while not @tokens.empty? and peek.type == type
|
30
30
|
end
|
31
31
|
|
@@ -33,7 +33,7 @@ class Gem::RequestSet::Lockfile::Tokenizer
|
|
33
33
|
# Calculates the column (by byte) and the line of the current token based on
|
34
34
|
# +byte_offset+.
|
35
35
|
|
36
|
-
def token_pos
|
36
|
+
def token_pos(byte_offset) # :nodoc:
|
37
37
|
[byte_offset - @line_pos, @line]
|
38
38
|
end
|
39
39
|
|
@@ -41,7 +41,7 @@ class Gem::RequestSet::Lockfile::Tokenizer
|
|
41
41
|
@tokens.empty?
|
42
42
|
end
|
43
43
|
|
44
|
-
def unshift
|
44
|
+
def unshift(token)
|
45
45
|
@tokens.unshift token
|
46
46
|
end
|
47
47
|
|
@@ -56,7 +56,7 @@ class Gem::RequestSet::Lockfile::Tokenizer
|
|
56
56
|
|
57
57
|
private
|
58
58
|
|
59
|
-
def tokenize
|
59
|
+
def tokenize(input)
|
60
60
|
require 'strscan'
|
61
61
|
s = StringScanner.new input
|
62
62
|
|
@@ -65,7 +65,7 @@ class Gem::RequestSet::Lockfile::Tokenizer
|
|
65
65
|
|
66
66
|
pos = s.pos if leading_whitespace = s.scan(/ +/)
|
67
67
|
|
68
|
-
if s.scan(/[<|=>]{7}/)
|
68
|
+
if s.scan(/[<|=>]{7}/)
|
69
69
|
message = "your #{@filename} contains merge conflict markers"
|
70
70
|
column, line = token_pos pos
|
71
71
|
|
@@ -80,7 +80,7 @@ class Gem::RequestSet::Lockfile::Tokenizer
|
|
80
80
|
@line += 1
|
81
81
|
token
|
82
82
|
when s.scan(/[A-Z]+/) then
|
83
|
-
if leading_whitespace
|
83
|
+
if leading_whitespace
|
84
84
|
text = s.matched
|
85
85
|
text += s.scan(/[^\s)]*/).to_s # in case of no match
|
86
86
|
Token.new(:text, text, *token_pos(pos))
|
data/lib/rubygems/requirement.rb
CHANGED
@@ -22,22 +22,22 @@ class Gem::Requirement
|
|
22
22
|
">=" => lambda { |v, r| v >= r },
|
23
23
|
"<=" => lambda { |v, r| v <= r },
|
24
24
|
"~>" => lambda { |v, r| v >= r && v.release < r.bump }
|
25
|
-
}
|
25
|
+
}.freeze
|
26
26
|
|
27
27
|
SOURCE_SET_REQUIREMENT = Struct.new(:for_lockfile).new "!" # :nodoc:
|
28
28
|
|
29
29
|
quoted = OPS.keys.map { |k| Regexp.quote k }.join "|"
|
30
|
-
PATTERN_RAW = "\\s*(#{quoted})?\\s*(#{Gem::Version::VERSION_PATTERN})\\s*" # :nodoc:
|
30
|
+
PATTERN_RAW = "\\s*(#{quoted})?\\s*(#{Gem::Version::VERSION_PATTERN})\\s*".freeze # :nodoc:
|
31
31
|
|
32
32
|
##
|
33
33
|
# A regular expression that matches a requirement
|
34
34
|
|
35
|
-
PATTERN = /\A#{PATTERN_RAW}\z
|
35
|
+
PATTERN = /\A#{PATTERN_RAW}\z/.freeze
|
36
36
|
|
37
37
|
##
|
38
38
|
# The default requirement matches any version
|
39
39
|
|
40
|
-
DefaultRequirement = [">=", Gem::Version.new(0)]
|
40
|
+
DefaultRequirement = [">=", Gem::Version.new(0)].freeze
|
41
41
|
|
42
42
|
##
|
43
43
|
# Raised when a bad requirement is encountered
|
@@ -51,7 +51,7 @@ class Gem::Requirement
|
|
51
51
|
# If the input is "weird", the default version requirement is
|
52
52
|
# returned.
|
53
53
|
|
54
|
-
def self.create
|
54
|
+
def self.create(*inputs)
|
55
55
|
return new inputs if inputs.length > 1
|
56
56
|
|
57
57
|
input = inputs.shift
|
@@ -64,7 +64,7 @@ class Gem::Requirement
|
|
64
64
|
when '!' then
|
65
65
|
source_set
|
66
66
|
else
|
67
|
-
if input.respond_to? :to_str
|
67
|
+
if input.respond_to? :to_str
|
68
68
|
new [input.to_str]
|
69
69
|
else
|
70
70
|
default
|
@@ -98,7 +98,7 @@ class Gem::Requirement
|
|
98
98
|
# parse("1.0") # => ["=", Gem::Version.new("1.0")]
|
99
99
|
# parse(Gem::Version.new("1.0")) # => ["=, Gem::Version.new("1.0")]
|
100
100
|
|
101
|
-
def self.parse
|
101
|
+
def self.parse(obj)
|
102
102
|
return ["=", obj] if Gem::Version === obj
|
103
103
|
|
104
104
|
unless PATTERN =~ obj.to_s
|
@@ -124,7 +124,7 @@ class Gem::Requirement
|
|
124
124
|
# requirements are ignored. An empty set of +requirements+ is the
|
125
125
|
# same as <tt>">= 0"</tt>.
|
126
126
|
|
127
|
-
def initialize
|
127
|
+
def initialize(*requirements)
|
128
128
|
requirements = requirements.flatten
|
129
129
|
requirements.compact!
|
130
130
|
requirements.uniq!
|
@@ -140,7 +140,7 @@ class Gem::Requirement
|
|
140
140
|
##
|
141
141
|
# Concatenates the +new+ requirements onto this requirement.
|
142
142
|
|
143
|
-
def concat
|
143
|
+
def concat(new)
|
144
144
|
new = new.flatten
|
145
145
|
new.compact!
|
146
146
|
new.uniq!
|
@@ -198,7 +198,7 @@ class Gem::Requirement
|
|
198
198
|
[@requirements]
|
199
199
|
end
|
200
200
|
|
201
|
-
def marshal_load
|
201
|
+
def marshal_load(array) # :nodoc:
|
202
202
|
@requirements = array[0]
|
203
203
|
|
204
204
|
fix_syck_default_key_in_requirements
|
@@ -213,7 +213,7 @@ class Gem::Requirement
|
|
213
213
|
fix_syck_default_key_in_requirements
|
214
214
|
end
|
215
215
|
|
216
|
-
def init_with
|
216
|
+
def init_with(coder) # :nodoc:
|
217
217
|
yaml_initialize coder.tag, coder.map
|
218
218
|
end
|
219
219
|
|
@@ -221,7 +221,7 @@ class Gem::Requirement
|
|
221
221
|
["@requirements"]
|
222
222
|
end
|
223
223
|
|
224
|
-
def encode_with
|
224
|
+
def encode_with(coder) # :nodoc:
|
225
225
|
coder.add 'requirements', @requirements
|
226
226
|
end
|
227
227
|
|
@@ -233,7 +233,7 @@ class Gem::Requirement
|
|
233
233
|
requirements.any? { |r| r.last.prerelease? }
|
234
234
|
end
|
235
235
|
|
236
|
-
def pretty_print
|
236
|
+
def pretty_print(q) # :nodoc:
|
237
237
|
q.group 1, 'Gem::Requirement.new(', ')' do
|
238
238
|
q.pp as_list
|
239
239
|
end
|
@@ -242,7 +242,7 @@ class Gem::Requirement
|
|
242
242
|
##
|
243
243
|
# True if +version+ satisfies this Requirement.
|
244
244
|
|
245
|
-
def satisfied_by?
|
245
|
+
def satisfied_by?(version)
|
246
246
|
raise ArgumentError, "Need a Gem::Version: #{version.inspect}" unless
|
247
247
|
Gem::Version === version
|
248
248
|
# #28965: syck has a bug with unquoted '=' YAML.loading as YAML::DefaultKey
|
@@ -265,7 +265,7 @@ class Gem::Requirement
|
|
265
265
|
as_list.join ", "
|
266
266
|
end
|
267
267
|
|
268
|
-
def ==
|
268
|
+
def ==(other) # :nodoc:
|
269
269
|
return unless Gem::Requirement === other
|
270
270
|
requirements == other.requirements
|
271
271
|
end
|
@@ -284,7 +284,7 @@ class Gem::Requirement
|
|
284
284
|
end
|
285
285
|
|
286
286
|
def sort_requirements! # :nodoc:
|
287
|
-
@requirements.sort! do |l, r|
|
287
|
+
@requirements.sort! do |l, r|
|
288
288
|
comp = l.last <=> r.last # first, sort by the requirement's version
|
289
289
|
next comp unless comp == 0
|
290
290
|
l.first <=> r.first # then, sort by the operator (for stability)
|
data/lib/rubygems/resolver.rb
CHANGED
@@ -59,7 +59,7 @@ class Gem::Resolver
|
|
59
59
|
# uniform manner. If one of the +sets+ is itself a ComposedSet its sets are
|
60
60
|
# flattened into the result ComposedSet.
|
61
61
|
|
62
|
-
def self.compose_sets
|
62
|
+
def self.compose_sets(*sets)
|
63
63
|
sets.compact!
|
64
64
|
|
65
65
|
sets = sets.map do |set|
|
@@ -87,7 +87,7 @@ class Gem::Resolver
|
|
87
87
|
# Creates a Resolver that queries only against the already installed gems
|
88
88
|
# for the +needed+ dependencies.
|
89
89
|
|
90
|
-
def self.for_current_gems
|
90
|
+
def self.for_current_gems(needed)
|
91
91
|
new needed, Gem::Resolver::CurrentSet.new
|
92
92
|
end
|
93
93
|
|
@@ -99,7 +99,7 @@ class Gem::Resolver
|
|
99
99
|
# satisfy the Dependencies. This defaults to IndexSet, which will query
|
100
100
|
# rubygems.org.
|
101
101
|
|
102
|
-
def initialize
|
102
|
+
def initialize(needed, set = nil)
|
103
103
|
@set = set || Gem::Resolver::IndexSet.new
|
104
104
|
@needed = needed
|
105
105
|
|
@@ -112,14 +112,14 @@ class Gem::Resolver
|
|
112
112
|
@stats = Gem::Resolver::Stats.new
|
113
113
|
end
|
114
114
|
|
115
|
-
def explain
|
115
|
+
def explain(stage, *data) # :nodoc:
|
116
116
|
return unless DEBUG_RESOLVER
|
117
117
|
|
118
118
|
d = data.map { |x| x.pretty_inspect }.join(", ")
|
119
119
|
$stderr.printf "%10s %s\n", stage.to_s.upcase, d
|
120
120
|
end
|
121
121
|
|
122
|
-
def explain_list
|
122
|
+
def explain_list(stage) # :nodoc:
|
123
123
|
return unless DEBUG_RESOLVER
|
124
124
|
|
125
125
|
data = yield
|
@@ -133,7 +133,7 @@ class Gem::Resolver
|
|
133
133
|
#
|
134
134
|
# Returns the Specification and the ActivationRequest
|
135
135
|
|
136
|
-
def activation_request
|
136
|
+
def activation_request(dep, possible) # :nodoc:
|
137
137
|
spec = possible.pop
|
138
138
|
|
139
139
|
explain :activate, [spec.full_name, possible.size]
|
@@ -145,7 +145,7 @@ class Gem::Resolver
|
|
145
145
|
return spec, activation_request
|
146
146
|
end
|
147
147
|
|
148
|
-
def requests
|
148
|
+
def requests(s, act, reqs=[]) # :nodoc:
|
149
149
|
return reqs if @ignore_dependencies
|
150
150
|
|
151
151
|
s.fetch_development_dependencies if @development
|
@@ -171,7 +171,7 @@ class Gem::Resolver
|
|
171
171
|
include Molinillo::UI
|
172
172
|
|
173
173
|
def output
|
174
|
-
@output ||= debug? ? $stdout : File.open(
|
174
|
+
@output ||= debug? ? $stdout : File.open(IO::NULL, 'w')
|
175
175
|
end
|
176
176
|
|
177
177
|
def debug?
|
@@ -197,7 +197,7 @@ class Gem::Resolver
|
|
197
197
|
# Extracts the specifications that may be able to fulfill +dependency+ and
|
198
198
|
# returns those that match the local platform and all those that match.
|
199
199
|
|
200
|
-
def find_possible
|
200
|
+
def find_possible(dependency) # :nodoc:
|
201
201
|
all = @set.find_all dependency
|
202
202
|
|
203
203
|
if (skip_dep_gems = skip_gems[dependency.name]) && !skip_dep_gems.empty?
|
@@ -216,7 +216,7 @@ class Gem::Resolver
|
|
216
216
|
##
|
217
217
|
# Returns the gems in +specs+ that match the local platform.
|
218
218
|
|
219
|
-
def select_local_platforms
|
219
|
+
def select_local_platforms(specs) # :nodoc:
|
220
220
|
specs.select do |spec|
|
221
221
|
Gem::Platform.installable? spec
|
222
222
|
end
|
@@ -314,11 +314,6 @@ class Gem::Resolver
|
|
314
314
|
|
315
315
|
end
|
316
316
|
|
317
|
-
##
|
318
|
-
# TODO remove in RubyGems 3
|
319
|
-
|
320
|
-
Gem::DependencyResolver = Gem::Resolver # :nodoc:
|
321
|
-
|
322
317
|
require 'rubygems/resolver/activation_request'
|
323
318
|
require 'rubygems/resolver/conflict'
|
324
319
|
require 'rubygems/resolver/dependency_request'
|
@@ -22,13 +22,13 @@ class Gem::Resolver::ActivationRequest
|
|
22
22
|
# +others_possible+ indicates that other specifications may also match this
|
23
23
|
# activation request.
|
24
24
|
|
25
|
-
def initialize
|
25
|
+
def initialize(spec, request, others_possible = true)
|
26
26
|
@spec = spec
|
27
27
|
@request = request
|
28
28
|
@others_possible = others_possible
|
29
29
|
end
|
30
30
|
|
31
|
-
def ==
|
31
|
+
def ==(other) # :nodoc:
|
32
32
|
case other
|
33
33
|
when Gem::Specification
|
34
34
|
@spec == other
|
@@ -49,7 +49,7 @@ class Gem::Resolver::ActivationRequest
|
|
49
49
|
##
|
50
50
|
# Downloads a gem at +path+ and returns the file path.
|
51
51
|
|
52
|
-
def download
|
52
|
+
def download(path)
|
53
53
|
Gem.ensure_gem_subdirectories path
|
54
54
|
|
55
55
|
if @spec.respond_to? :sources
|
@@ -97,7 +97,7 @@ class Gem::Resolver::ActivationRequest
|
|
97
97
|
when false then # TODO remove at RubyGems 3
|
98
98
|
nil
|
99
99
|
else
|
100
|
-
unless @others_possible.empty?
|
100
|
+
unless @others_possible.empty?
|
101
101
|
others = @others_possible.map { |s| s.full_name }
|
102
102
|
" (others possible: #{others.join ', '})"
|
103
103
|
end
|
@@ -152,7 +152,7 @@ class Gem::Resolver::ActivationRequest
|
|
152
152
|
@request.requester
|
153
153
|
end
|
154
154
|
|
155
|
-
def pretty_print
|
155
|
+
def pretty_print(q) # :nodoc:
|
156
156
|
q.group 2, '[Activation request', ']' do
|
157
157
|
q.breakable
|
158
158
|
q.pp @spec
|
@@ -167,7 +167,7 @@ class Gem::Resolver::ActivationRequest
|
|
167
167
|
q.breakable
|
168
168
|
q.text 'others possible'
|
169
169
|
else
|
170
|
-
unless @others_possible.empty?
|
170
|
+
unless @others_possible.empty?
|
171
171
|
q.breakable
|
172
172
|
q.text 'others '
|
173
173
|
q.pp @others_possible.map { |s| s.full_name }
|
@@ -25,7 +25,7 @@ class Gem::Resolver::APISet < Gem::Resolver::Set
|
|
25
25
|
# API URL +dep_uri+ which is described at
|
26
26
|
# http://guides.rubygems.org/rubygems-org-api
|
27
27
|
|
28
|
-
def initialize
|
28
|
+
def initialize(dep_uri = 'https://rubygems.org/api/v1/dependencies')
|
29
29
|
super()
|
30
30
|
|
31
31
|
dep_uri = URI dep_uri unless URI === dep_uri # for ruby 1.8
|
@@ -43,7 +43,7 @@ class Gem::Resolver::APISet < Gem::Resolver::Set
|
|
43
43
|
# Return an array of APISpecification objects matching
|
44
44
|
# DependencyRequest +req+.
|
45
45
|
|
46
|
-
def find_all
|
46
|
+
def find_all(req)
|
47
47
|
res = []
|
48
48
|
|
49
49
|
return res unless @remote
|
@@ -65,7 +65,7 @@ class Gem::Resolver::APISet < Gem::Resolver::Set
|
|
65
65
|
# A hint run by the resolver to allow the Set to fetch
|
66
66
|
# data for DependencyRequests +reqs+.
|
67
67
|
|
68
|
-
def prefetch
|
68
|
+
def prefetch(reqs)
|
69
69
|
return unless @remote
|
70
70
|
names = reqs.map { |r| r.dependency.name }
|
71
71
|
needed = names - @data.keys - @to_fetch
|
@@ -93,7 +93,7 @@ class Gem::Resolver::APISet < Gem::Resolver::Set
|
|
93
93
|
end
|
94
94
|
end
|
95
95
|
|
96
|
-
def pretty_print
|
96
|
+
def pretty_print(q) # :nodoc:
|
97
97
|
q.group 2, '[APISet', ']' do
|
98
98
|
q.breakable
|
99
99
|
q.text "URI: #{@dep_uri}"
|
@@ -107,7 +107,7 @@ class Gem::Resolver::APISet < Gem::Resolver::Set
|
|
107
107
|
##
|
108
108
|
# Return data for all versions of the gem +name+.
|
109
109
|
|
110
|
-
def versions
|
110
|
+
def versions(name) # :nodoc:
|
111
111
|
if @data.key?(name)
|
112
112
|
return @data[name]
|
113
113
|
end
|
@@ -123,4 +123,3 @@ class Gem::Resolver::APISet < Gem::Resolver::Set
|
|
123
123
|
end
|
124
124
|
|
125
125
|
end
|
126
|
-
|
@@ -27,7 +27,7 @@ class Gem::Resolver::APISpecification < Gem::Resolver::Specification
|
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
|
-
def ==
|
30
|
+
def ==(other) # :nodoc:
|
31
31
|
self.class === other and
|
32
32
|
@set == other.set and
|
33
33
|
@name == other.name and
|
@@ -46,7 +46,7 @@ class Gem::Resolver::APISpecification < Gem::Resolver::Specification
|
|
46
46
|
Gem::Platform.match @platform
|
47
47
|
end
|
48
48
|
|
49
|
-
def pretty_print
|
49
|
+
def pretty_print(q) # :nodoc:
|
50
50
|
q.group 2, '[APISpecification', ']' do
|
51
51
|
q.breakable
|
52
52
|
q.text "name: #{name}"
|
@@ -88,4 +88,3 @@ class Gem::Resolver::APISpecification < Gem::Resolver::Specification
|
|
88
88
|
end
|
89
89
|
|
90
90
|
end
|
91
|
-
|
@@ -10,7 +10,7 @@ class Gem::Resolver::BestSet < Gem::Resolver::ComposedSet
|
|
10
10
|
# Creates a BestSet for the given +sources+ or Gem::sources if none are
|
11
11
|
# specified. +sources+ must be a Gem::SourceList.
|
12
12
|
|
13
|
-
def initialize
|
13
|
+
def initialize(sources = Gem.sources)
|
14
14
|
super()
|
15
15
|
|
16
16
|
@sources = sources
|
@@ -25,7 +25,7 @@ class Gem::Resolver::BestSet < Gem::Resolver::ComposedSet
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
-
def find_all
|
28
|
+
def find_all(req) # :nodoc:
|
29
29
|
pick_sets if @remote and @sets.empty?
|
30
30
|
|
31
31
|
super
|
@@ -35,13 +35,13 @@ class Gem::Resolver::BestSet < Gem::Resolver::ComposedSet
|
|
35
35
|
retry
|
36
36
|
end
|
37
37
|
|
38
|
-
def prefetch
|
38
|
+
def prefetch(reqs) # :nodoc:
|
39
39
|
pick_sets if @remote and @sets.empty?
|
40
40
|
|
41
41
|
super
|
42
42
|
end
|
43
43
|
|
44
|
-
def pretty_print
|
44
|
+
def pretty_print(q) # :nodoc:
|
45
45
|
q.group 2, '[BestSet', ']' do
|
46
46
|
q.breakable
|
47
47
|
q.text 'sets:'
|
@@ -58,7 +58,7 @@ class Gem::Resolver::BestSet < Gem::Resolver::ComposedSet
|
|
58
58
|
#
|
59
59
|
# The calling method must retry the exception to repeat the lookup.
|
60
60
|
|
61
|
-
def replace_failed_api_set
|
61
|
+
def replace_failed_api_set(error) # :nodoc:
|
62
62
|
uri = error.uri
|
63
63
|
uri = URI uri unless URI === uri
|
64
64
|
uri.query = nil
|
@@ -76,4 +76,3 @@ class Gem::Resolver::BestSet < Gem::Resolver::ComposedSet
|
|
76
76
|
end
|
77
77
|
|
78
78
|
end
|
79
|
-
|