rubygems-update 3.3.18 → 3.3.22
Sign up to get free protection for your applications and to get access to all the features.
- 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
@@ -70,6 +70,7 @@ module Bundler
|
|
70
70
|
@unlock = unlock
|
71
71
|
@optional_groups = optional_groups
|
72
72
|
@remote = false
|
73
|
+
@prefer_local = false
|
73
74
|
@specs = nil
|
74
75
|
@ruby_version = ruby_version
|
75
76
|
@gemfiles = gemfiles
|
@@ -138,14 +139,12 @@ module Bundler
|
|
138
139
|
@unlock[:gems] ||= @dependencies.map(&:name)
|
139
140
|
else
|
140
141
|
eager_unlock = expand_dependencies(@unlock[:gems] || [], true)
|
141
|
-
@unlock[:gems] = @locked_specs.for(eager_unlock, false,
|
142
|
+
@unlock[:gems] = @locked_specs.for(eager_unlock, false, platforms).map(&:name)
|
142
143
|
end
|
143
144
|
|
144
145
|
@dependency_changes = converge_dependencies
|
145
146
|
@local_changes = converge_locals
|
146
147
|
|
147
|
-
@locked_specs_incomplete_for_platform = !@locked_specs.for(requested_dependencies & expand_dependencies(locked_dependencies), true, true)
|
148
|
-
|
149
148
|
@requires = compute_requires
|
150
149
|
end
|
151
150
|
|
@@ -170,6 +169,13 @@ module Bundler
|
|
170
169
|
resolve
|
171
170
|
end
|
172
171
|
|
172
|
+
def resolve_prefering_local!
|
173
|
+
@prefer_local = true
|
174
|
+
@remote = true
|
175
|
+
sources.remote!
|
176
|
+
resolve
|
177
|
+
end
|
178
|
+
|
173
179
|
def resolve_with_cache!
|
174
180
|
sources.cached!
|
175
181
|
resolve
|
@@ -210,6 +216,7 @@ module Bundler
|
|
210
216
|
true
|
211
217
|
rescue BundlerError => e
|
212
218
|
@resolve = nil
|
219
|
+
@resolver = nil
|
213
220
|
@specs = nil
|
214
221
|
@gem_version_promoter = nil
|
215
222
|
|
@@ -279,11 +286,8 @@ module Bundler
|
|
279
286
|
end
|
280
287
|
end
|
281
288
|
else
|
282
|
-
last_resolve = converge_locked_specs
|
283
|
-
# Run a resolve against the locally available gems
|
284
289
|
Bundler.ui.debug("Found changes from the lockfile, re-resolving dependencies because #{change_reason}")
|
285
|
-
expanded_dependencies
|
286
|
-
Resolver.resolve(expanded_dependencies, source_requirements, last_resolve, gem_version_promoter, additional_base_requirements_for_resolve, platforms)
|
290
|
+
resolver.start(expanded_dependencies)
|
287
291
|
end
|
288
292
|
end
|
289
293
|
|
@@ -468,7 +472,7 @@ module Bundler
|
|
468
472
|
private :sources
|
469
473
|
|
470
474
|
def nothing_changed?
|
471
|
-
!@source_changes && !@dependency_changes && !@new_platform && !@path_changes && !@local_changes
|
475
|
+
!@source_changes && !@dependency_changes && !@new_platform && !@path_changes && !@local_changes
|
472
476
|
end
|
473
477
|
|
474
478
|
def unlocking?
|
@@ -477,8 +481,20 @@ module Bundler
|
|
477
481
|
|
478
482
|
private
|
479
483
|
|
484
|
+
def resolver
|
485
|
+
@resolver ||= begin
|
486
|
+
last_resolve = converge_locked_specs
|
487
|
+
remove_ruby_from_platforms_if_necessary!(dependencies)
|
488
|
+
Resolver.new(source_requirements, last_resolve, gem_version_promoter, additional_base_requirements_for_resolve(last_resolve), platforms)
|
489
|
+
end
|
490
|
+
end
|
491
|
+
|
492
|
+
def expanded_dependencies
|
493
|
+
@expanded_dependencies ||= expand_dependencies(dependencies + metadata_dependencies, true)
|
494
|
+
end
|
495
|
+
|
480
496
|
def filter_specs(specs, deps)
|
481
|
-
SpecSet.new(specs).for(expand_dependencies(deps, true), false,
|
497
|
+
SpecSet.new(specs).for(expand_dependencies(deps, true), false, platforms)
|
482
498
|
end
|
483
499
|
|
484
500
|
def materialize(dependencies)
|
@@ -495,14 +511,25 @@ module Bundler
|
|
495
511
|
"removed in order to install."
|
496
512
|
end
|
497
513
|
|
498
|
-
|
514
|
+
missing_specs_list = missing_specs.group_by(&:source).map do |source, missing_specs_for_source|
|
515
|
+
"#{missing_specs_for_source.map(&:full_name).join(", ")} in #{source}"
|
516
|
+
end
|
517
|
+
|
518
|
+
raise GemNotFound, "Could not find #{missing_specs_list.join(" nor ")}"
|
499
519
|
end
|
500
520
|
|
501
|
-
|
502
|
-
|
503
|
-
|
521
|
+
loop do
|
522
|
+
incomplete_specs = specs.incomplete_specs
|
523
|
+
break if incomplete_specs.empty?
|
524
|
+
|
525
|
+
Bundler.ui.debug("The lockfile does not have all gems needed for the current platform though, Bundler will still re-resolve dependencies")
|
526
|
+
@resolve = resolver.start(expanded_dependencies, :exclude_specs => incomplete_specs)
|
527
|
+
specs = resolve.materialize(dependencies)
|
504
528
|
end
|
505
529
|
|
530
|
+
bundler = sources.metadata_source.specs.search(Gem::Dependency.new("bundler", VERSION)).last
|
531
|
+
specs["bundler"] = bundler
|
532
|
+
|
506
533
|
specs
|
507
534
|
end
|
508
535
|
|
@@ -510,6 +537,19 @@ module Bundler
|
|
510
537
|
@remote && sources.non_global_rubygems_sources.all?(&:dependency_api_available?) && !sources.aggregate_global_source?
|
511
538
|
end
|
512
539
|
|
540
|
+
def pin_locally_available_names(source_requirements)
|
541
|
+
source_requirements.each_with_object({}) do |(name, original_source), new_source_requirements|
|
542
|
+
local_source = original_source.dup
|
543
|
+
local_source.local_only!
|
544
|
+
|
545
|
+
new_source_requirements[name] = if local_source.specs.search(name).any?
|
546
|
+
local_source
|
547
|
+
else
|
548
|
+
original_source
|
549
|
+
end
|
550
|
+
end
|
551
|
+
end
|
552
|
+
|
513
553
|
def current_ruby_platform_locked?
|
514
554
|
return false unless generic_local_platform == Gem::Platform::RUBY
|
515
555
|
return false if Bundler.settings[:force_ruby_platform] && !@platforms.include?(Gem::Platform::RUBY)
|
@@ -545,7 +585,6 @@ module Bundler
|
|
545
585
|
[@new_platform, "you added a new platform to your gemfile"],
|
546
586
|
[@path_changes, "the gemspecs for path gems changed"],
|
547
587
|
[@local_changes, "the gemspecs for git local gems changed"],
|
548
|
-
[@locked_specs_incomplete_for_platform, "the lockfile does not have all gems needed for the current platform"],
|
549
588
|
].select(&:first).map(&:last).join(", ")
|
550
589
|
end
|
551
590
|
|
@@ -678,7 +717,9 @@ module Bundler
|
|
678
717
|
# commonly happen if the Gemfile has changed since the lockfile was last
|
679
718
|
# generated
|
680
719
|
def converge_locked_specs
|
681
|
-
|
720
|
+
converged = converge_specs(@locked_specs)
|
721
|
+
|
722
|
+
resolve = SpecSet.new(converged.reject {|s| @unlock[:gems].include?(s.name) })
|
682
723
|
|
683
724
|
diff = nil
|
684
725
|
|
@@ -702,16 +743,24 @@ module Bundler
|
|
702
743
|
specs[dep].any? {|s| s.satisfies?(dep) && (!dep.source || s.source.include?(dep.source)) }
|
703
744
|
end
|
704
745
|
|
746
|
+
@specs_that_changed_sources = []
|
747
|
+
|
705
748
|
specs.each do |s|
|
706
|
-
# Replace the locked dependency's source with the equivalent source from the Gemfile
|
707
749
|
dep = @dependencies.find {|d| s.satisfies?(d) }
|
708
750
|
|
709
|
-
s
|
751
|
+
# Replace the locked dependency's source with the equivalent source from the Gemfile
|
752
|
+
s.source = if dep && dep.source
|
753
|
+
gemfile_source = dep.source
|
754
|
+
lockfile_source = s.source
|
710
755
|
|
711
|
-
|
756
|
+
@specs_that_changed_sources << s if gemfile_source != lockfile_source
|
757
|
+
|
758
|
+
gemfile_source
|
759
|
+
else
|
760
|
+
sources.get_with_fallback(s.source)
|
761
|
+
end
|
712
762
|
|
713
|
-
|
714
|
-
# then we unlock it.
|
763
|
+
next if @unlock[:sources].include?(s.source.name)
|
715
764
|
|
716
765
|
# Path sources have special logic
|
717
766
|
if s.source.instance_of?(Source::Path) || s.source.instance_of?(Source::Gemspec)
|
@@ -721,7 +770,7 @@ module Bundler
|
|
721
770
|
# if we won't need the source (according to the lockfile),
|
722
771
|
# don't error if the path/git source isn't available
|
723
772
|
next if specs.
|
724
|
-
for(requested_dependencies, false
|
773
|
+
for(requested_dependencies, false).
|
725
774
|
none? {|locked_spec| locked_spec.source == s.source }
|
726
775
|
|
727
776
|
raise
|
@@ -743,12 +792,12 @@ module Bundler
|
|
743
792
|
end
|
744
793
|
end
|
745
794
|
|
746
|
-
|
795
|
+
filter_specs(converged, deps)
|
747
796
|
end
|
748
797
|
|
749
798
|
def metadata_dependencies
|
750
799
|
@metadata_dependencies ||= [
|
751
|
-
Dependency.new("Ruby\0",
|
800
|
+
Dependency.new("Ruby\0", Gem.ruby_version),
|
752
801
|
Dependency.new("RubyGems\0", Gem::VERSION),
|
753
802
|
]
|
754
803
|
end
|
@@ -775,7 +824,9 @@ module Bundler
|
|
775
824
|
# specs will be available later when the resolver knows where to
|
776
825
|
# look for that gemspec (or its dependencies)
|
777
826
|
source_requirements = if precompute_source_requirements_for_indirect_dependencies?
|
778
|
-
|
827
|
+
all_requirements = source_map.all_requirements
|
828
|
+
all_requirements = pin_locally_available_names(all_requirements) if @prefer_local
|
829
|
+
{ :default => sources.default_source }.merge(all_requirements)
|
779
830
|
else
|
780
831
|
{ :default => Source::RubygemsAggregate.new(sources, source_map) }.merge(source_map.direct_requirements)
|
781
832
|
end
|
@@ -785,11 +836,22 @@ module Bundler
|
|
785
836
|
end
|
786
837
|
source_requirements[:default_bundler] = source_requirements["bundler"] || sources.default_source
|
787
838
|
source_requirements["bundler"] = sources.metadata_source # needs to come last to override
|
839
|
+
verify_changed_sources!
|
788
840
|
source_requirements
|
789
841
|
end
|
790
842
|
|
843
|
+
def verify_changed_sources!
|
844
|
+
@specs_that_changed_sources.each do |s|
|
845
|
+
if s.source.specs.search(s.name).empty?
|
846
|
+
raise GemNotFound, "Could not find gem '#{s.name}' in #{s.source}"
|
847
|
+
end
|
848
|
+
end
|
849
|
+
end
|
850
|
+
|
791
851
|
def requested_groups
|
792
|
-
groups - Bundler.settings[:without] - @optional_groups + Bundler.settings[:with]
|
852
|
+
values = groups - Bundler.settings[:without] - @optional_groups + Bundler.settings[:with]
|
853
|
+
values &= Bundler.settings[:only] unless Bundler.settings[:only].empty?
|
854
|
+
values
|
793
855
|
end
|
794
856
|
|
795
857
|
def lockfiles_equal?(current, proposed, preserve_unknown_sections)
|
@@ -816,13 +878,22 @@ module Bundler
|
|
816
878
|
end
|
817
879
|
end
|
818
880
|
|
819
|
-
def additional_base_requirements_for_resolve
|
881
|
+
def additional_base_requirements_for_resolve(last_resolve)
|
820
882
|
return [] unless @locked_gems && unlocking? && !sources.expired_sources?(@locked_gems.sources)
|
821
|
-
converge_specs(@originally_locked_specs).map do |locked_spec|
|
822
|
-
name
|
823
|
-
|
824
|
-
|
825
|
-
|
883
|
+
converge_specs(@originally_locked_specs - last_resolve).map do |locked_spec|
|
884
|
+
Dependency.new(locked_spec.name, ">= #{locked_spec.version}")
|
885
|
+
end.uniq
|
886
|
+
end
|
887
|
+
|
888
|
+
def remove_ruby_from_platforms_if_necessary!(dependencies)
|
889
|
+
return if Bundler.frozen_bundle? ||
|
890
|
+
Bundler.local_platform == Gem::Platform::RUBY ||
|
891
|
+
!platforms.include?(Gem::Platform::RUBY) ||
|
892
|
+
(@new_platform && platforms.last == Gem::Platform::RUBY) ||
|
893
|
+
!@originally_locked_specs.incomplete_ruby_specs?(expand_dependencies(dependencies))
|
894
|
+
|
895
|
+
remove_platform(Gem::Platform::RUBY)
|
896
|
+
add_current_platform
|
826
897
|
end
|
827
898
|
|
828
899
|
def source_map
|
@@ -7,92 +7,24 @@ require_relative "rubygems_ext"
|
|
7
7
|
module Bundler
|
8
8
|
class Dependency < Gem::Dependency
|
9
9
|
attr_reader :autorequire
|
10
|
-
attr_reader :groups, :platforms, :gemfile, :git, :github, :branch, :ref, :force_ruby_platform
|
10
|
+
attr_reader :groups, :platforms, :gemfile, :path, :git, :github, :branch, :ref, :force_ruby_platform
|
11
11
|
|
12
|
-
|
12
|
+
ALL_RUBY_VERSIONS = ((18..27).to_a + (30..31).to_a).freeze
|
13
13
|
PLATFORM_MAP = {
|
14
|
-
:ruby
|
15
|
-
:
|
16
|
-
:
|
17
|
-
:
|
18
|
-
:
|
19
|
-
:
|
20
|
-
:
|
21
|
-
:
|
22
|
-
:
|
23
|
-
:
|
24
|
-
|
25
|
-
|
26
|
-
:
|
27
|
-
|
28
|
-
:mri_18 => Gem::Platform::RUBY,
|
29
|
-
:mri_19 => Gem::Platform::RUBY,
|
30
|
-
:mri_20 => Gem::Platform::RUBY,
|
31
|
-
:mri_21 => Gem::Platform::RUBY,
|
32
|
-
:mri_22 => Gem::Platform::RUBY,
|
33
|
-
:mri_23 => Gem::Platform::RUBY,
|
34
|
-
:mri_24 => Gem::Platform::RUBY,
|
35
|
-
:mri_25 => Gem::Platform::RUBY,
|
36
|
-
:mri_26 => Gem::Platform::RUBY,
|
37
|
-
:mri_27 => Gem::Platform::RUBY,
|
38
|
-
:mri_30 => Gem::Platform::RUBY,
|
39
|
-
:mri_31 => Gem::Platform::RUBY,
|
40
|
-
:rbx => Gem::Platform::RUBY,
|
41
|
-
:truffleruby => Gem::Platform::RUBY,
|
42
|
-
:jruby => Gem::Platform::JAVA,
|
43
|
-
:jruby_18 => Gem::Platform::JAVA,
|
44
|
-
:jruby_19 => Gem::Platform::JAVA,
|
45
|
-
:mswin => Gem::Platform::MSWIN,
|
46
|
-
:mswin_18 => Gem::Platform::MSWIN,
|
47
|
-
:mswin_19 => Gem::Platform::MSWIN,
|
48
|
-
:mswin_20 => Gem::Platform::MSWIN,
|
49
|
-
:mswin_21 => Gem::Platform::MSWIN,
|
50
|
-
:mswin_22 => Gem::Platform::MSWIN,
|
51
|
-
:mswin_23 => Gem::Platform::MSWIN,
|
52
|
-
:mswin_24 => Gem::Platform::MSWIN,
|
53
|
-
:mswin_25 => Gem::Platform::MSWIN,
|
54
|
-
:mswin_26 => Gem::Platform::MSWIN,
|
55
|
-
:mswin_27 => Gem::Platform::MSWIN,
|
56
|
-
:mswin_30 => Gem::Platform::MSWIN,
|
57
|
-
:mswin_31 => Gem::Platform::MSWIN,
|
58
|
-
:mswin64 => Gem::Platform::MSWIN64,
|
59
|
-
:mswin64_19 => Gem::Platform::MSWIN64,
|
60
|
-
:mswin64_20 => Gem::Platform::MSWIN64,
|
61
|
-
:mswin64_21 => Gem::Platform::MSWIN64,
|
62
|
-
:mswin64_22 => Gem::Platform::MSWIN64,
|
63
|
-
:mswin64_23 => Gem::Platform::MSWIN64,
|
64
|
-
:mswin64_24 => Gem::Platform::MSWIN64,
|
65
|
-
:mswin64_25 => Gem::Platform::MSWIN64,
|
66
|
-
:mswin64_26 => Gem::Platform::MSWIN64,
|
67
|
-
:mswin64_27 => Gem::Platform::MSWIN64,
|
68
|
-
:mswin64_30 => Gem::Platform::MSWIN64,
|
69
|
-
:mswin64_31 => Gem::Platform::MSWIN64,
|
70
|
-
:mingw => Gem::Platform::MINGW,
|
71
|
-
:mingw_18 => Gem::Platform::MINGW,
|
72
|
-
:mingw_19 => Gem::Platform::MINGW,
|
73
|
-
:mingw_20 => Gem::Platform::MINGW,
|
74
|
-
:mingw_21 => Gem::Platform::MINGW,
|
75
|
-
:mingw_22 => Gem::Platform::MINGW,
|
76
|
-
:mingw_23 => Gem::Platform::MINGW,
|
77
|
-
:mingw_24 => Gem::Platform::MINGW,
|
78
|
-
:mingw_25 => Gem::Platform::MINGW,
|
79
|
-
:mingw_26 => Gem::Platform::MINGW,
|
80
|
-
:mingw_27 => Gem::Platform::MINGW,
|
81
|
-
:mingw_30 => Gem::Platform::MINGW,
|
82
|
-
:mingw_31 => Gem::Platform::MINGW,
|
83
|
-
:x64_mingw => Gem::Platform::X64_MINGW,
|
84
|
-
:x64_mingw_20 => Gem::Platform::X64_MINGW,
|
85
|
-
:x64_mingw_21 => Gem::Platform::X64_MINGW,
|
86
|
-
:x64_mingw_22 => Gem::Platform::X64_MINGW,
|
87
|
-
:x64_mingw_23 => Gem::Platform::X64_MINGW,
|
88
|
-
:x64_mingw_24 => Gem::Platform::X64_MINGW,
|
89
|
-
:x64_mingw_25 => Gem::Platform::X64_MINGW,
|
90
|
-
:x64_mingw_26 => Gem::Platform::X64_MINGW,
|
91
|
-
:x64_mingw_27 => Gem::Platform::X64_MINGW,
|
92
|
-
:x64_mingw_30 => Gem::Platform::X64_MINGW,
|
93
|
-
:x64_mingw_31 => Gem::Platform::X64_MINGW,
|
94
|
-
}.freeze
|
95
|
-
# rubocop:enable Naming/VariableNumber
|
14
|
+
:ruby => [Gem::Platform::RUBY, ALL_RUBY_VERSIONS],
|
15
|
+
:mri => [Gem::Platform::RUBY, ALL_RUBY_VERSIONS],
|
16
|
+
:rbx => [Gem::Platform::RUBY],
|
17
|
+
:truffleruby => [Gem::Platform::RUBY],
|
18
|
+
:jruby => [Gem::Platform::JAVA, [18, 19]],
|
19
|
+
:windows => [Gem::Platform::WINDOWS, ALL_RUBY_VERSIONS],
|
20
|
+
:mswin => [Gem::Platform::MSWIN, ALL_RUBY_VERSIONS],
|
21
|
+
:mswin64 => [Gem::Platform::MSWIN64, ALL_RUBY_VERSIONS - [18]],
|
22
|
+
:mingw => [Gem::Platform::MINGW, ALL_RUBY_VERSIONS],
|
23
|
+
:x64_mingw => [Gem::Platform::X64_MINGW, ALL_RUBY_VERSIONS - [18, 19]],
|
24
|
+
}.each_with_object({}) do |(platform, spec), hash|
|
25
|
+
hash[platform] = spec[0]
|
26
|
+
spec[1]&.each {|version| hash[:"#{platform}_#{version}"] = spec[0] }
|
27
|
+
end.freeze
|
96
28
|
|
97
29
|
def initialize(name, version, options = {}, &blk)
|
98
30
|
type = options["type"] || :runtime
|
@@ -101,6 +33,7 @@ module Bundler
|
|
101
33
|
@autorequire = nil
|
102
34
|
@groups = Array(options["group"] || :default).map(&:to_sym)
|
103
35
|
@source = options["source"]
|
36
|
+
@path = options["path"]
|
104
37
|
@git = options["git"]
|
105
38
|
@github = options["github"]
|
106
39
|
@branch = options["branch"]
|
@@ -151,7 +84,7 @@ module Bundler
|
|
151
84
|
def to_lock
|
152
85
|
out = super
|
153
86
|
out << "!" if source
|
154
|
-
out
|
87
|
+
out
|
155
88
|
end
|
156
89
|
|
157
90
|
def specific?
|
data/bundler/lib/bundler/dsl.rb
CHANGED
@@ -465,12 +465,12 @@ module Bundler
|
|
465
465
|
|
466
466
|
def multiple_global_source_warning
|
467
467
|
if Bundler.feature_flag.bundler_3_mode?
|
468
|
-
msg = "This Gemfile contains multiple
|
468
|
+
msg = "This Gemfile contains multiple global sources. " \
|
469
469
|
"Each source after the first must include a block to indicate which gems " \
|
470
470
|
"should come from that source"
|
471
471
|
raise GemfileEvalError, msg
|
472
472
|
else
|
473
|
-
Bundler::SharedHelpers.major_deprecation 2, "Your Gemfile contains multiple
|
473
|
+
Bundler::SharedHelpers.major_deprecation 2, "Your Gemfile contains multiple global sources. " \
|
474
474
|
"Using `source` more than once without a block is a security risk, and " \
|
475
475
|
"may result in installing unexpected gems. To resolve this warning, use " \
|
476
476
|
"a block to indicate which gems should come from the secondary source."
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module Bundler
|
4
4
|
# used for Creating Specifications from the Gemcutter Endpoint
|
5
5
|
class EndpointSpecification < Gem::Specification
|
6
|
-
include
|
6
|
+
include MatchRemoteMetadata
|
7
7
|
|
8
8
|
attr_reader :name, :version, :platform, :checksum
|
9
9
|
attr_accessor :source, :remote, :dependencies
|
@@ -12,7 +12,7 @@ module Bundler
|
|
12
12
|
super()
|
13
13
|
@name = name
|
14
14
|
@version = Gem::Version.create version
|
15
|
-
@platform = platform
|
15
|
+
@platform = Gem::Platform.new(platform)
|
16
16
|
@spec_fetcher = spec_fetcher
|
17
17
|
@dependencies = dependencies.map {|dep, reqs| build_dependency(dep, reqs) }
|
18
18
|
|
@@ -22,17 +22,6 @@ module Bundler
|
|
22
22
|
parse_metadata(metadata)
|
23
23
|
end
|
24
24
|
|
25
|
-
def required_ruby_version
|
26
|
-
@required_ruby_version ||= _remote_specification.required_ruby_version
|
27
|
-
end
|
28
|
-
|
29
|
-
# A fallback is included because the original version of the specification
|
30
|
-
# API didn't include that field, so some marshalled specs in the index have it
|
31
|
-
# set to +nil+.
|
32
|
-
def required_rubygems_version
|
33
|
-
@required_rubygems_version ||= _remote_specification.required_rubygems_version || Gem::Requirement.default
|
34
|
-
end
|
35
|
-
|
36
25
|
def fetch_platform
|
37
26
|
@platform
|
38
27
|
end
|
@@ -39,7 +39,6 @@ module Bundler
|
|
39
39
|
settings_flag(:setup_makes_kernel_gem_public) { !bundler_3_mode? }
|
40
40
|
settings_flag(:suppress_install_using_messages) { bundler_3_mode? }
|
41
41
|
settings_flag(:update_requires_all_flag) { bundler_4_mode? }
|
42
|
-
settings_flag(:use_gem_version_promoter_for_major_updates) { bundler_3_mode? }
|
43
42
|
|
44
43
|
settings_option(:default_cli_command) { bundler_3_mode? ? :cli_help : :install }
|
45
44
|
|
@@ -240,8 +240,8 @@ module Bundler
|
|
240
240
|
def connection
|
241
241
|
@connection ||= begin
|
242
242
|
needs_ssl = remote_uri.scheme == "https" ||
|
243
|
-
|
244
|
-
|
243
|
+
Bundler.settings[:ssl_verify_mode] ||
|
244
|
+
Bundler.settings[:ssl_client_cert]
|
245
245
|
raise SSLError if needs_ssl && !defined?(OpenSSL::SSL)
|
246
246
|
|
247
247
|
con = PersistentHTTP.new :name => "bundler", :proxy => :ENV
|
@@ -256,8 +256,8 @@ module Bundler
|
|
256
256
|
end
|
257
257
|
|
258
258
|
ssl_client_cert = Bundler.settings[:ssl_client_cert] ||
|
259
|
-
|
260
|
-
|
259
|
+
(Gem.configuration.ssl_client_cert if
|
260
|
+
Gem.configuration.respond_to?(:ssl_client_cert))
|
261
261
|
if ssl_client_cert
|
262
262
|
pem = File.read(ssl_client_cert)
|
263
263
|
con.cert = OpenSSL::X509::Certificate.new(pem)
|
@@ -288,8 +288,8 @@ module Bundler
|
|
288
288
|
def bundler_cert_store
|
289
289
|
store = OpenSSL::X509::Store.new
|
290
290
|
ssl_ca_cert = Bundler.settings[:ssl_ca_cert] ||
|
291
|
-
|
292
|
-
|
291
|
+
(Gem.configuration.ssl_ca_cert if
|
292
|
+
Gem.configuration.respond_to?(:ssl_ca_cert))
|
293
293
|
if ssl_ca_cert
|
294
294
|
if File.directory? ssl_ca_cert
|
295
295
|
store.add_path ssl_ca_cert
|
@@ -44,6 +44,12 @@ module Bundler
|
|
44
44
|
|
45
45
|
def select_best_platform_match(specs, platform)
|
46
46
|
matching = specs.select {|spec| spec.match_platform(platform) }
|
47
|
+
|
48
|
+
sort_best_platform_match(matching, platform)
|
49
|
+
end
|
50
|
+
module_function :select_best_platform_match
|
51
|
+
|
52
|
+
def sort_best_platform_match(matching, platform)
|
47
53
|
exact = matching.select {|spec| spec.platform == platform }
|
48
54
|
return exact if exact.any?
|
49
55
|
|
@@ -52,7 +58,7 @@ module Bundler
|
|
52
58
|
|
53
59
|
sorted_matching.take_while {|spec| same_specificity(platform, spec, exemplary_spec) && same_deps(spec, exemplary_spec) }
|
54
60
|
end
|
55
|
-
module_function :
|
61
|
+
module_function :sort_best_platform_match
|
56
62
|
|
57
63
|
class PlatformMatch
|
58
64
|
def self.specificity_score(spec_platform, user_platform)
|
@@ -55,19 +55,17 @@ module Bundler
|
|
55
55
|
@level = v
|
56
56
|
end
|
57
57
|
|
58
|
-
# Given a Dependency and an Array of
|
59
|
-
# gem, this method will return the Array of
|
58
|
+
# Given a Dependency and an Array of Specifications of available versions for a
|
59
|
+
# gem, this method will return the Array of Specifications sorted (and possibly
|
60
60
|
# truncated if strict is true) in an order to give preference to the current
|
61
61
|
# level (:major, :minor or :patch) when resolution is deciding what versions
|
62
62
|
# best resolve all dependencies in the bundle.
|
63
63
|
# @param dep [Dependency] The Dependency of the gem.
|
64
|
-
# @param spec_groups [
|
64
|
+
# @param spec_groups [Specification] An array of Specifications for the same gem
|
65
65
|
# named in the @dep param.
|
66
|
-
# @return [
|
66
|
+
# @return [Specification] A new instance of the Specification Array sorted and
|
67
67
|
# possibly filtered.
|
68
68
|
def sort_versions(dep, spec_groups)
|
69
|
-
before_result = "before sort_versions: #{debug_format_result(dep, spec_groups).inspect}" if DEBUG
|
70
|
-
|
71
69
|
@sort_versions[dep] ||= begin
|
72
70
|
gem_name = dep.name
|
73
71
|
|
@@ -79,15 +77,14 @@ module Bundler
|
|
79
77
|
filter_dep_specs(spec_groups, locked_spec)
|
80
78
|
else
|
81
79
|
sort_dep_specs(spec_groups, locked_spec)
|
82
|
-
end.tap do |specs|
|
83
|
-
if DEBUG
|
84
|
-
puts before_result
|
85
|
-
puts " after sort_versions: #{debug_format_result(dep, specs).inspect}"
|
86
|
-
end
|
87
80
|
end
|
88
81
|
end
|
89
82
|
end
|
90
83
|
|
84
|
+
def reset
|
85
|
+
@sort_versions = {}
|
86
|
+
end
|
87
|
+
|
91
88
|
# @return [bool] Convenience method for testing value of level variable.
|
92
89
|
def major?
|
93
90
|
level == :major
|
@@ -179,12 +176,5 @@ module Bundler
|
|
179
176
|
move, keep = result.partition {|s| s.version.to_s == version.to_s }
|
180
177
|
keep.concat(move)
|
181
178
|
end
|
182
|
-
|
183
|
-
def debug_format_result(dep, spec_groups)
|
184
|
-
a = [dep.to_s,
|
185
|
-
spec_groups.map {|sg| [sg.version, sg.dependencies_for_activated_platforms.map {|dp| [dp.name, dp.requirement.to_s] }] }]
|
186
|
-
last_map = a.last.map {|sg_data| [sg_data.first.version, sg_data.last.map {|aa| aa.join(" ") }] }
|
187
|
-
[a.first, last_map, level, strict ? :strict : :not_strict]
|
188
|
-
end
|
189
179
|
end
|
190
180
|
end
|
@@ -56,17 +56,17 @@ module Bundler
|
|
56
56
|
|
57
57
|
# Search this index's specs, and any source indexes that this index knows
|
58
58
|
# about, returning all of the results.
|
59
|
-
def search(query
|
60
|
-
sort_specs(unsorted_search(query
|
59
|
+
def search(query)
|
60
|
+
sort_specs(unsorted_search(query))
|
61
61
|
end
|
62
62
|
|
63
|
-
def unsorted_search(query
|
64
|
-
results = local_search(query
|
63
|
+
def unsorted_search(query)
|
64
|
+
results = local_search(query)
|
65
65
|
|
66
66
|
seen = results.map(&:full_name).uniq unless @sources.empty?
|
67
67
|
|
68
68
|
@sources.each do |source|
|
69
|
-
source.unsorted_search(query
|
69
|
+
source.unsorted_search(query).each do |spec|
|
70
70
|
next if seen.include?(spec.full_name)
|
71
71
|
|
72
72
|
seen << spec.full_name
|
@@ -89,12 +89,12 @@ module Bundler
|
|
89
89
|
self.class.sort_specs(specs)
|
90
90
|
end
|
91
91
|
|
92
|
-
def local_search(query
|
92
|
+
def local_search(query)
|
93
93
|
case query
|
94
94
|
when Gem::Specification, RemoteSpecification, LazySpecification, EndpointSpecification then search_by_spec(query)
|
95
95
|
when String then specs_by_name(query)
|
96
|
-
when Gem::Dependency then search_by_dependency(query
|
97
|
-
when DepProxy then search_by_dependency(query.dep
|
96
|
+
when Gem::Dependency then search_by_dependency(query)
|
97
|
+
when DepProxy then search_by_dependency(query.dep)
|
98
98
|
else
|
99
99
|
raise "You can't search for a #{query.inspect}."
|
100
100
|
end
|
@@ -185,11 +185,9 @@ module Bundler
|
|
185
185
|
@specs[name].values
|
186
186
|
end
|
187
187
|
|
188
|
-
def search_by_dependency(dependency
|
189
|
-
@cache[
|
190
|
-
@cache[base || false][dependency] ||= begin
|
188
|
+
def search_by_dependency(dependency)
|
189
|
+
@cache[dependency] ||= begin
|
191
190
|
specs = specs_by_name(dependency.name)
|
192
|
-
specs += base if base
|
193
191
|
found = specs.select do |spec|
|
194
192
|
next true if spec.source.is_a?(Source::Gemspec)
|
195
193
|
dependency.matches_spec?(spec)
|
@@ -115,13 +115,14 @@ module Bundler
|
|
115
115
|
end
|
116
116
|
|
117
117
|
source = ", :source => \"#{d.source}\"" unless d.source.nil?
|
118
|
+
path = ", :path => \"#{d.path}\"" unless d.path.nil?
|
118
119
|
git = ", :git => \"#{d.git}\"" unless d.git.nil?
|
119
120
|
github = ", :github => \"#{d.github}\"" unless d.github.nil?
|
120
121
|
branch = ", :branch => \"#{d.branch}\"" unless d.branch.nil?
|
121
122
|
ref = ", :ref => \"#{d.ref}\"" unless d.ref.nil?
|
122
123
|
require_path = ", :require => #{convert_autorequire(d.autorequire)}" unless d.autorequire.nil?
|
123
124
|
|
124
|
-
%(gem #{name}#{requirement}#{group}#{source}#{git}#{github}#{branch}#{ref}#{require_path})
|
125
|
+
%(gem #{name}#{requirement}#{group}#{source}#{path}#{git}#{github}#{branch}#{ref}#{require_path})
|
125
126
|
end.join("\n")
|
126
127
|
end
|
127
128
|
|
@@ -54,7 +54,7 @@ def gemfile(install = false, options = {}, &gemfile)
|
|
54
54
|
|
55
55
|
Bundler.ui = install ? ui : Bundler::UI::Silent.new
|
56
56
|
if install || definition.missing_specs?
|
57
|
-
Bundler.settings.temporary(:inline => true) do
|
57
|
+
Bundler.settings.temporary(:inline => true, :no_install => false) do
|
58
58
|
installer = Bundler::Installer.install(Bundler.root, definition, :system => true)
|
59
59
|
installer.post_install_messages.each do |name, message|
|
60
60
|
Bundler.ui.info "Post-install message from #{name}:\n#{message}"
|