rubygems-update 2.6.11 → 2.7.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +8 -22
- data/CONTRIBUTING.rdoc +53 -54
- data/History.txt +405 -0
- data/Manifest.txt +46 -15
- data/POLICIES.rdoc +3 -3
- data/README.md +72 -0
- data/Rakefile +55 -12
- data/appveyor.yml +29 -1
- data/bin/gem +1 -1
- data/bin/update_rubygems +2 -2
- data/bundler/CHANGELOG.md +412 -9
- data/bundler/CODE_OF_CONDUCT.md +1 -1
- data/bundler/CONTRIBUTING.md +10 -29
- data/bundler/README.md +27 -11
- data/bundler/bundler.gemspec +58 -0
- data/bundler/exe/bundle +5 -7
- data/bundler/exe/bundle_ruby +4 -3
- data/bundler/lib/bundler.rb +103 -79
- data/bundler/lib/bundler/build_metadata.rb +53 -0
- data/bundler/lib/bundler/capistrano.rb +5 -0
- data/bundler/lib/bundler/cli.rb +231 -66
- data/bundler/lib/bundler/cli/add.rb +25 -0
- data/bundler/lib/bundler/cli/binstubs.rb +9 -7
- data/bundler/lib/bundler/cli/cache.rb +5 -4
- data/bundler/lib/bundler/cli/check.rb +3 -5
- data/bundler/lib/bundler/cli/clean.rb +5 -6
- data/bundler/lib/bundler/cli/common.rb +18 -2
- data/bundler/lib/bundler/cli/config.rb +26 -7
- data/bundler/lib/bundler/cli/console.rb +2 -1
- data/bundler/lib/bundler/cli/doctor.rb +1 -0
- data/bundler/lib/bundler/cli/exec.rb +6 -5
- data/bundler/lib/bundler/cli/gem.rb +42 -18
- data/bundler/lib/bundler/cli/info.rb +50 -0
- data/bundler/lib/bundler/cli/init.rb +21 -7
- data/bundler/lib/bundler/cli/inject.rb +13 -4
- data/bundler/lib/bundler/cli/install.rb +61 -77
- data/bundler/lib/bundler/cli/issue.rb +40 -0
- data/bundler/lib/bundler/cli/list.rb +22 -0
- data/bundler/lib/bundler/cli/lock.rb +4 -2
- data/bundler/lib/bundler/cli/open.rb +2 -2
- data/bundler/lib/bundler/cli/outdated.rb +30 -28
- data/bundler/lib/bundler/cli/package.rb +9 -6
- data/bundler/lib/bundler/cli/platform.rb +1 -0
- data/bundler/lib/bundler/cli/plugin.rb +1 -0
- data/bundler/lib/bundler/cli/pristine.rb +43 -0
- data/bundler/lib/bundler/cli/show.rb +1 -1
- data/bundler/lib/bundler/cli/update.rb +36 -13
- data/bundler/lib/bundler/cli/viz.rb +5 -1
- data/bundler/lib/bundler/compact_index_client.rb +1 -0
- data/bundler/lib/bundler/compact_index_client/cache.rb +1 -2
- data/bundler/lib/bundler/compact_index_client/updater.rb +36 -8
- data/bundler/lib/bundler/compatibility_guard.rb +14 -0
- data/bundler/lib/bundler/constants.rb +1 -0
- data/bundler/lib/bundler/current_ruby.rb +16 -8
- data/bundler/lib/bundler/definition.rb +252 -170
- data/bundler/lib/bundler/dep_proxy.rb +3 -1
- data/bundler/lib/bundler/dependency.rb +7 -7
- data/bundler/lib/bundler/deployment.rb +1 -1
- data/bundler/lib/bundler/deprecate.rb +15 -3
- data/bundler/lib/bundler/dsl.rb +103 -62
- data/bundler/lib/bundler/endpoint_specification.rb +13 -3
- data/bundler/lib/bundler/env.rb +101 -38
- data/bundler/lib/bundler/environment_preserver.rb +27 -6
- data/bundler/lib/bundler/errors.rb +3 -1
- data/bundler/lib/bundler/feature_flag.rb +39 -4
- data/bundler/lib/bundler/fetcher.rb +18 -11
- data/bundler/lib/bundler/fetcher/base.rb +1 -0
- data/bundler/lib/bundler/fetcher/compact_index.rb +2 -12
- data/bundler/lib/bundler/fetcher/dependency.rb +2 -1
- data/bundler/lib/bundler/fetcher/downloader.rb +14 -7
- data/bundler/lib/bundler/fetcher/index.rb +3 -2
- data/bundler/lib/bundler/friendly_errors.rb +7 -2
- data/bundler/lib/bundler/gem_helper.rb +24 -10
- data/bundler/lib/bundler/gem_helpers.rb +1 -0
- data/bundler/lib/bundler/gem_remote_fetcher.rb +1 -0
- data/bundler/lib/bundler/gem_tasks.rb +1 -0
- data/bundler/lib/bundler/gem_version_promoter.rb +13 -0
- data/bundler/lib/bundler/gemdeps.rb +1 -0
- data/bundler/lib/bundler/graph.rb +1 -0
- data/bundler/lib/bundler/index.rb +19 -11
- data/bundler/lib/bundler/injector.rb +54 -30
- data/bundler/lib/bundler/inline.rb +10 -10
- data/bundler/lib/bundler/installer.rb +114 -52
- data/bundler/lib/bundler/installer/gem_installer.rb +14 -4
- data/bundler/lib/bundler/installer/parallel_installer.rb +91 -42
- data/bundler/lib/bundler/installer/standalone.rb +1 -0
- data/bundler/lib/bundler/lazy_specification.rb +17 -4
- data/bundler/lib/bundler/lockfile_generator.rb +95 -0
- data/bundler/lib/bundler/lockfile_parser.rb +49 -35
- data/bundler/lib/bundler/match_platform.rb +1 -0
- data/bundler/lib/bundler/mirror.rb +10 -5
- data/bundler/lib/bundler/plugin.rb +8 -3
- data/bundler/lib/bundler/plugin/api/source.rb +16 -3
- data/bundler/lib/bundler/plugin/index.rb +9 -2
- data/bundler/lib/bundler/plugin/installer.rb +7 -6
- data/bundler/lib/bundler/plugin/source_list.rb +7 -8
- data/bundler/lib/bundler/process_lock.rb +24 -0
- data/bundler/lib/bundler/psyched_yaml.rb +10 -0
- data/bundler/lib/bundler/remote_specification.rb +25 -1
- data/bundler/lib/bundler/resolver.rb +176 -193
- data/bundler/lib/bundler/resolver/spec_group.rb +106 -0
- data/bundler/lib/bundler/retry.rb +1 -0
- data/bundler/lib/bundler/ruby_dsl.rb +1 -0
- data/bundler/lib/bundler/ruby_version.rb +7 -2
- data/bundler/lib/bundler/rubygems_ext.rb +18 -8
- data/bundler/lib/bundler/rubygems_gem_installer.rb +25 -2
- data/bundler/lib/bundler/rubygems_integration.rb +166 -69
- data/bundler/lib/bundler/runtime.rb +29 -19
- data/bundler/lib/bundler/settings.rb +202 -87
- data/bundler/lib/bundler/settings/validator.rb +79 -0
- data/bundler/lib/bundler/setup.rb +4 -7
- data/bundler/lib/bundler/shared_helpers.rb +143 -27
- data/bundler/lib/bundler/similarity_detector.rb +1 -0
- data/bundler/lib/bundler/source.rb +53 -1
- data/bundler/lib/bundler/source/gemspec.rb +1 -0
- data/bundler/lib/bundler/source/git.rb +51 -22
- data/bundler/lib/bundler/source/git/git_proxy.rb +23 -13
- data/bundler/lib/bundler/source/metadata.rb +63 -0
- data/bundler/lib/bundler/source/path.rb +38 -17
- data/bundler/lib/bundler/source/path/installer.rb +4 -2
- data/bundler/lib/bundler/source/rubygems.rb +161 -82
- data/bundler/lib/bundler/source/rubygems/remote.rb +12 -2
- data/bundler/lib/bundler/source_list.rb +75 -15
- data/bundler/lib/bundler/spec_set.rb +37 -21
- data/bundler/lib/bundler/ssl_certs/certificate_manager.rb +2 -1
- data/bundler/lib/bundler/stub_specification.rb +86 -2
- data/bundler/lib/bundler/templates/.document +1 -0
- data/bundler/lib/bundler/templates/Executable +13 -1
- data/bundler/lib/bundler/templates/Executable.bundler +105 -0
- data/bundler/lib/bundler/templates/Executable.standalone +5 -5
- data/bundler/lib/bundler/templates/Gemfile +3 -0
- data/bundler/lib/bundler/templates/gems.rb +8 -0
- data/bundler/lib/bundler/templates/newgem/Gemfile.tt +4 -2
- data/bundler/lib/bundler/templates/newgem/LICENSE.txt.tt +1 -1
- data/bundler/lib/bundler/templates/newgem/README.md.tt +14 -8
- data/bundler/lib/bundler/templates/newgem/Rakefile.tt +5 -5
- data/bundler/lib/bundler/templates/newgem/ext/newgem/newgem.c.tt +4 -4
- data/bundler/lib/bundler/templates/newgem/ext/newgem/newgem.h.tt +3 -3
- data/bundler/lib/bundler/templates/newgem/gitignore.tt +0 -1
- data/bundler/lib/bundler/templates/newgem/lib/newgem.rb.tt +6 -6
- data/bundler/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +4 -4
- data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +21 -12
- data/bundler/lib/bundler/templates/newgem/rspec.tt +1 -0
- data/bundler/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +0 -2
- data/bundler/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +3 -0
- data/bundler/lib/bundler/templates/newgem/test/newgem_test.rb.tt +1 -1
- data/bundler/lib/bundler/templates/newgem/test/test_helper.rb.tt +3 -3
- data/bundler/lib/bundler/templates/newgem/{.travis.yml.tt → travis.yml.tt} +2 -0
- data/bundler/lib/bundler/ui.rb +1 -0
- data/bundler/lib/bundler/ui/rg_proxy.rb +1 -0
- data/bundler/lib/bundler/ui/shell.rb +26 -10
- data/bundler/lib/bundler/ui/silent.rb +12 -1
- data/bundler/lib/bundler/uri_credentials_filter.rb +1 -0
- data/bundler/lib/bundler/vendor/fileutils/lib/fileutils.rb +1638 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo.rb +2 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb +26 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +7 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +1 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +16 -5
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +1 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +10 -2
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +1 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +1 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +1 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +1 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +1 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +1 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +16 -5
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +75 -7
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +2 -1
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +1 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb +3 -1
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +501 -138
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +1 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +8 -4
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +3 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor.rb +46 -21
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions.rb +24 -22
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +2 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +2 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +2 -2
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb +16 -8
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +66 -18
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +17 -15
- data/bundler/lib/bundler/vendor/thor/lib/thor/base.rb +55 -32
- data/bundler/lib/bundler/vendor/thor/lib/thor/command.rb +13 -11
- data/bundler/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +21 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb +7 -5
- data/bundler/lib/bundler/vendor/thor/lib/thor/core_ext/ordered_hash.rb +94 -63
- data/bundler/lib/bundler/vendor/thor/lib/thor/error.rb +3 -3
- data/bundler/lib/bundler/vendor/thor/lib/thor/group.rb +13 -13
- data/bundler/lib/bundler/vendor/thor/lib/thor/invocation.rb +4 -5
- data/bundler/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb +2 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +4 -7
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +16 -16
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/option.rb +42 -21
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/options.rb +13 -10
- data/bundler/lib/bundler/vendor/thor/lib/thor/runner.rb +31 -29
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +49 -33
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/color.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/html.rb +4 -4
- data/bundler/lib/bundler/vendor/thor/lib/thor/util.rb +8 -7
- data/bundler/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/bundler/lib/bundler/vendored_fileutils.rb +9 -0
- data/bundler/lib/bundler/vendored_molinillo.rb +1 -0
- data/bundler/lib/bundler/vendored_persistent.rb +35 -0
- data/bundler/lib/bundler/vendored_thor.rb +6 -2
- data/bundler/lib/bundler/version.rb +19 -2
- data/bundler/lib/bundler/version_ranges.rb +76 -0
- data/bundler/lib/bundler/vlad.rb +5 -0
- data/bundler/lib/bundler/worker.rb +3 -1
- data/bundler/lib/bundler/yaml_serializer.rb +3 -3
- data/bundler/man/bundle-add.ronn +29 -0
- data/bundler/man/bundle-binstubs.ronn +15 -1
- data/bundler/man/bundle-check.ronn +26 -0
- data/bundler/man/bundle-clean.ronn +18 -0
- data/bundler/man/bundle-config.ronn +193 -69
- data/bundler/man/bundle-doctor.ronn +33 -0
- data/bundler/man/bundle-exec.ronn +10 -3
- data/bundler/man/bundle-gem.ronn +3 -2
- data/bundler/man/bundle-info.ronn +17 -0
- data/bundler/man/bundle-init.ronn +29 -0
- data/bundler/man/bundle-inject.ronn +22 -0
- data/bundler/man/bundle-install.ronn +44 -35
- data/bundler/man/bundle-list.ronn +15 -0
- data/bundler/man/bundle-lock.ronn +1 -1
- data/bundler/man/bundle-open.ronn +19 -0
- data/bundler/man/bundle-outdated.ronn +2 -2
- data/bundler/man/bundle-package.ronn +7 -2
- data/bundler/man/bundle-pristine.ronn +34 -0
- data/bundler/man/bundle-show.ronn +21 -0
- data/bundler/man/bundle-update.ronn +24 -17
- data/bundler/man/bundle-viz.ronn +30 -0
- data/bundler/man/bundle.ronn +36 -45
- data/bundler/man/gemfile.5.ronn +77 -71
- data/lib/rubygems.rb +102 -46
- data/lib/rubygems/basic_specification.rb +8 -4
- data/lib/rubygems/bundler_version_finder.rb +99 -0
- data/lib/rubygems/command.rb +10 -2
- data/lib/rubygems/command_manager.rb +8 -4
- data/lib/rubygems/commands/cert_command.rb +31 -6
- data/lib/rubygems/commands/cleanup_command.rb +10 -3
- data/lib/rubygems/commands/generate_index_command.rb +1 -1
- data/lib/rubygems/commands/help_command.rb +1 -1
- data/lib/rubygems/commands/install_command.rb +7 -0
- data/lib/rubygems/commands/open_command.rb +1 -1
- data/lib/rubygems/commands/owner_command.rb +7 -2
- data/lib/rubygems/commands/pristine_command.rb +11 -8
- data/lib/rubygems/commands/push_command.rb +39 -5
- data/lib/rubygems/commands/query_command.rb +17 -17
- data/lib/rubygems/commands/setup_command.rb +174 -69
- data/lib/rubygems/commands/signin_command.rb +33 -0
- data/lib/rubygems/commands/signout_command.rb +33 -0
- data/lib/rubygems/commands/sources_command.rb +1 -1
- data/lib/rubygems/commands/uninstall_command.rb +5 -4
- data/lib/rubygems/commands/unpack_command.rb +19 -7
- data/lib/rubygems/commands/update_command.rb +1 -1
- data/lib/rubygems/commands/which_command.rb +1 -1
- data/lib/rubygems/commands/yank_command.rb +4 -11
- data/lib/rubygems/config_file.rb +15 -26
- data/lib/rubygems/core_ext/kernel_require.rb +12 -16
- data/lib/rubygems/dependency.rb +3 -0
- data/lib/rubygems/dependency_installer.rb +8 -2
- data/lib/rubygems/dependency_list.rb +1 -1
- data/lib/rubygems/errors.rb +3 -0
- data/lib/rubygems/exceptions.rb +11 -1
- data/lib/rubygems/ext/builder.rb +2 -2
- data/lib/rubygems/ext/ext_conf_builder.rb +2 -4
- data/lib/rubygems/ext/rake_builder.rb +1 -1
- data/lib/rubygems/gem_runner.rb +5 -1
- data/lib/rubygems/gemcutter_utilities.rb +5 -2
- data/lib/rubygems/indexer.rb +6 -5
- data/lib/rubygems/install_update_options.rb +6 -29
- data/lib/rubygems/installer.rb +60 -13
- data/lib/rubygems/installer_test_case.rb +6 -3
- data/lib/rubygems/package.rb +55 -8
- data/lib/rubygems/package/file_source.rb +2 -2
- data/lib/rubygems/package/old.rb +3 -3
- data/lib/rubygems/package/tar_header.rb +17 -10
- data/lib/rubygems/package/tar_writer.rb +4 -3
- data/lib/rubygems/platform.rb +1 -1
- data/lib/rubygems/remote_fetcher.rb +2 -2
- data/lib/rubygems/request.rb +1 -1
- data/lib/rubygems/request_set.rb +47 -19
- data/lib/rubygems/request_set/gem_dependency_api.rb +3 -3
- data/lib/rubygems/request_set/lockfile.rb +1 -1
- data/lib/rubygems/requirement.rb +19 -4
- data/lib/rubygems/resolver.rb +24 -3
- data/lib/rubygems/resolver/api_specification.rb +5 -0
- data/lib/rubygems/resolver/installer_set.rb +4 -6
- data/lib/rubygems/safe_yaml.rb +51 -0
- data/lib/rubygems/security.rb +18 -6
- data/lib/rubygems/security/trust_dir.rb +1 -1
- data/lib/rubygems/security_option.rb +43 -0
- data/lib/rubygems/server.rb +21 -17
- data/lib/rubygems/source.rb +9 -6
- data/lib/rubygems/source/git.rb +2 -1
- data/lib/rubygems/source/local.rb +38 -35
- data/lib/rubygems/source/lock.rb +4 -1
- data/lib/rubygems/source_local.rb +3 -1
- data/lib/rubygems/source_specific_file.rb +3 -2
- data/lib/rubygems/spec_fetcher.rb +7 -3
- data/lib/rubygems/specification.rb +315 -249
- data/lib/rubygems/ssl_certs/{index.rubygems.org → rubygems.org}/GlobalSignRootCA.pem +0 -0
- data/lib/rubygems/ssl_certs/rubygems.org/GlobalSignRootCA_R3.pem +21 -0
- data/lib/rubygems/stub_specification.rb +4 -3
- data/lib/rubygems/test_case.rb +51 -11
- data/lib/rubygems/test_utilities.rb +2 -2
- data/lib/rubygems/text.rb +14 -1
- data/lib/rubygems/user_interaction.rb +24 -15
- data/lib/rubygems/util.rb +6 -16
- data/lib/rubygems/util/licenses.rb +72 -4
- data/lib/rubygems/validator.rb +3 -3
- data/lib/rubygems/version.rb +24 -4
- data/lib/rubygems/version_option.rb +6 -1
- data/lib/ubygems.rb +3 -0
- data/setup.rb +1 -1
- data/test/rubygems/private3072_key.pem +40 -0
- data/test/rubygems/public3072_cert.pem +25 -0
- data/test/rubygems/test_bundled_ca.rb +7 -4
- data/test/rubygems/test_config.rb +1 -1
- data/test/rubygems/test_gem.rb +158 -39
- data/test/rubygems/test_gem_bundler_version_finder.rb +126 -0
- data/test/rubygems/test_gem_command.rb +7 -1
- data/test/rubygems/test_gem_command_manager.rb +2 -2
- data/test/rubygems/test_gem_commands_build_command.rb +29 -1
- data/test/rubygems/test_gem_commands_cert_command.rb +64 -0
- data/test/rubygems/test_gem_commands_cleanup_command.rb +44 -1
- data/test/rubygems/test_gem_commands_install_command.rb +73 -2
- data/test/rubygems/test_gem_commands_open_command.rb +2 -1
- data/test/rubygems/test_gem_commands_owner_command.rb +25 -0
- data/test/rubygems/test_gem_commands_pristine_command.rb +1 -1
- data/test/rubygems/test_gem_commands_push_command.rb +25 -5
- data/test/rubygems/test_gem_commands_query_command.rb +154 -1
- data/test/rubygems/test_gem_commands_setup_command.rb +140 -10
- data/test/rubygems/test_gem_commands_signin_command.rb +98 -0
- data/test/rubygems/test_gem_commands_signout_command.rb +37 -0
- data/test/rubygems/test_gem_commands_sources_command.rb +52 -0
- data/test/rubygems/test_gem_commands_uninstall_command.rb +15 -3
- data/test/rubygems/test_gem_commands_update_command.rb +1 -7
- data/test/rubygems/test_gem_commands_which_command.rb +3 -3
- data/test/rubygems/test_gem_dependency.rb +28 -0
- data/test/rubygems/test_gem_dependency_installer.rb +1 -1
- data/test/rubygems/test_gem_doctor.rb +2 -2
- data/test/rubygems/test_gem_ext_builder.rb +8 -8
- data/test/rubygems/test_gem_ext_configure_builder.rb +1 -1
- data/test/rubygems/test_gem_ext_rake_builder.rb +2 -6
- data/test/rubygems/test_gem_gemcutter_utilities.rb +4 -4
- data/test/rubygems/test_gem_indexer.rb +1 -2
- data/test/rubygems/test_gem_install_update_options.rb +6 -1
- data/test/rubygems/test_gem_installer.rb +168 -31
- data/test/rubygems/test_gem_package.rb +183 -26
- data/test/rubygems/test_gem_package_old.rb +1 -1
- data/test/rubygems/test_gem_package_tar_header.rb +21 -0
- data/test/rubygems/test_gem_rdoc.rb +2 -0
- data/test/rubygems/test_gem_remote_fetcher.rb +24 -5
- data/test/rubygems/test_gem_request.rb +5 -2
- data/test/rubygems/test_gem_request_connection_pools.rb +6 -7
- data/test/rubygems/test_gem_request_set.rb +7 -7
- data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +3 -3
- data/test/rubygems/test_gem_request_set_lockfile.rb +4 -4
- data/test/rubygems/test_gem_request_set_lockfile_parser.rb +1 -1
- data/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb +1 -1
- data/test/rubygems/test_gem_requirement.rb +12 -0
- data/test/rubygems/test_gem_resolver.rb +26 -0
- data/test/rubygems/test_gem_resolver_api_specification.rb +24 -0
- data/test/rubygems/test_gem_resolver_conflict.rb +1 -1
- data/test/rubygems/test_gem_resolver_git_specification.rb +1 -1
- data/test/rubygems/test_gem_resolver_installer_set.rb +1 -1
- data/test/rubygems/test_gem_security.rb +5 -0
- data/test/rubygems/test_gem_security_policy.rb +27 -27
- data/test/rubygems/test_gem_security_signer.rb +6 -6
- data/test/rubygems/test_gem_security_trust_dir.rb +2 -2
- data/test/rubygems/test_gem_server.rb +194 -12
- data/test/rubygems/test_gem_source.rb +12 -3
- data/test/rubygems/test_gem_source_git.rb +1 -1
- data/test/rubygems/test_gem_spec_fetcher.rb +20 -0
- data/test/rubygems/test_gem_specification.rb +180 -42
- data/test/rubygems/test_gem_stream_ui.rb +8 -8
- data/test/rubygems/test_gem_stub_specification.rb +26 -8
- data/test/rubygems/test_gem_text.rb +16 -0
- data/test/rubygems/test_gem_util.rb +26 -0
- data/test/rubygems/test_gem_version.rb +68 -9
- data/test/rubygems/test_gem_version_option.rb +15 -0
- data/test/rubygems/test_kernel.rb +30 -0
- data/test/rubygems/test_require.rb +70 -21
- data/util/ci +1 -0
- data/util/generate_spdx_license_list.rb +16 -6
- data/util/update_bundled_ca_certificates.rb +1 -3
- metadata +61 -57
- data/README.rdoc +0 -54
- data/bundler/DEVELOPMENT.md +0 -150
- data/bundler/ISSUES.md +0 -117
- data/bundler/lib/bundler/postit_trampoline.rb +0 -73
- data/bundler/lib/bundler/vendor/postit/lib/postit.rb +0 -15
- data/bundler/lib/bundler/vendor/postit/lib/postit/environment.rb +0 -44
- data/bundler/lib/bundler/vendor/postit/lib/postit/installer.rb +0 -28
- data/bundler/lib/bundler/vendor/postit/lib/postit/parser.rb +0 -21
- data/bundler/lib/bundler/vendor/postit/lib/postit/setup.rb +0 -12
- data/bundler/lib/bundler/vendor/postit/lib/postit/version.rb +0 -3
- data/bundler/man/index.txt +0 -8
- data/lib/rubygems/ssl_certs/rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem +0 -23
- data/lib/rubygems/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem +0 -25
@@ -0,0 +1,106 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bundler
|
4
|
+
class Resolver
|
5
|
+
class SpecGroup
|
6
|
+
include GemHelpers
|
7
|
+
|
8
|
+
attr_accessor :name, :version, :source
|
9
|
+
attr_accessor :ignores_bundler_dependencies
|
10
|
+
|
11
|
+
def initialize(all_specs)
|
12
|
+
raise ArgumentError, "cannot initialize with an empty value" unless exemplary_spec = all_specs.first
|
13
|
+
@name = exemplary_spec.name
|
14
|
+
@version = exemplary_spec.version
|
15
|
+
@source = exemplary_spec.source
|
16
|
+
|
17
|
+
@activated_platforms = []
|
18
|
+
@dependencies = nil
|
19
|
+
@specs = Hash.new do |specs, platform|
|
20
|
+
specs[platform] = select_best_platform_match(all_specs, platform)
|
21
|
+
end
|
22
|
+
@ignores_bundler_dependencies = true
|
23
|
+
end
|
24
|
+
|
25
|
+
def to_specs
|
26
|
+
@activated_platforms.map do |p|
|
27
|
+
next unless s = @specs[p]
|
28
|
+
lazy_spec = LazySpecification.new(name, version, s.platform, source)
|
29
|
+
lazy_spec.dependencies.replace s.dependencies
|
30
|
+
lazy_spec
|
31
|
+
end.compact
|
32
|
+
end
|
33
|
+
|
34
|
+
def activate_platform!(platform)
|
35
|
+
return unless for?(platform)
|
36
|
+
return if @activated_platforms.include?(platform)
|
37
|
+
@activated_platforms << platform
|
38
|
+
end
|
39
|
+
|
40
|
+
def for?(platform)
|
41
|
+
spec = @specs[platform]
|
42
|
+
!spec.nil?
|
43
|
+
end
|
44
|
+
|
45
|
+
def to_s
|
46
|
+
@to_s ||= "#{name} (#{version})"
|
47
|
+
end
|
48
|
+
|
49
|
+
def dependencies_for_activated_platforms
|
50
|
+
dependencies = @activated_platforms.map {|p| __dependencies[p] }
|
51
|
+
metadata_dependencies = @activated_platforms.map do |platform|
|
52
|
+
metadata_dependencies(@specs[platform], platform)
|
53
|
+
end
|
54
|
+
dependencies.concat(metadata_dependencies).flatten
|
55
|
+
end
|
56
|
+
|
57
|
+
def ==(other)
|
58
|
+
return unless other.is_a?(SpecGroup)
|
59
|
+
name == other.name &&
|
60
|
+
version == other.version &&
|
61
|
+
source == other.source
|
62
|
+
end
|
63
|
+
|
64
|
+
def eql?(other)
|
65
|
+
name.eql?(other.name) &&
|
66
|
+
version.eql?(other.version) &&
|
67
|
+
source.eql?(other.source)
|
68
|
+
end
|
69
|
+
|
70
|
+
def hash
|
71
|
+
to_s.hash ^ source.hash
|
72
|
+
end
|
73
|
+
|
74
|
+
private
|
75
|
+
|
76
|
+
def __dependencies
|
77
|
+
@dependencies = Hash.new do |dependencies, platform|
|
78
|
+
dependencies[platform] = []
|
79
|
+
if spec = @specs[platform]
|
80
|
+
spec.dependencies.each do |dep|
|
81
|
+
next if dep.type == :development
|
82
|
+
next if @ignores_bundler_dependencies && dep.name == "bundler".freeze
|
83
|
+
dependencies[platform] << DepProxy.new(dep, platform)
|
84
|
+
end
|
85
|
+
end
|
86
|
+
dependencies[platform]
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
def metadata_dependencies(spec, platform)
|
91
|
+
return [] unless spec
|
92
|
+
# Only allow endpoint specifications since they won't hit the network to
|
93
|
+
# fetch the full gemspec when calling required_ruby_version
|
94
|
+
return [] if !spec.is_a?(EndpointSpecification) && !spec.is_a?(Gem::Specification)
|
95
|
+
dependencies = []
|
96
|
+
if !spec.required_ruby_version.nil? && !spec.required_ruby_version.none?
|
97
|
+
dependencies << DepProxy.new(Gem::Dependency.new("ruby\0", spec.required_ruby_version), platform)
|
98
|
+
end
|
99
|
+
if !spec.required_rubygems_version.nil? && !spec.required_rubygems_version.none?
|
100
|
+
dependencies << DepProxy.new(Gem::Dependency.new("rubygems\0", spec.required_rubygems_version), platform)
|
101
|
+
end
|
102
|
+
dependencies
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
module Bundler
|
3
4
|
class RubyVersion
|
4
5
|
attr_reader :versions,
|
@@ -21,7 +22,11 @@ module Bundler
|
|
21
22
|
# must not be specified, or the engine version
|
22
23
|
# specified must match the version.
|
23
24
|
|
24
|
-
@versions
|
25
|
+
@versions = Array(versions).map do |v|
|
26
|
+
op, v = Gem::Requirement.parse(v)
|
27
|
+
op == "=" ? v.to_s : "#{op} #{v}"
|
28
|
+
end
|
29
|
+
|
25
30
|
@gem_version = Gem::Requirement.create(@versions.first).requirements.first.last
|
26
31
|
@input_engine = engine && engine.to_s
|
27
32
|
@engine = engine && engine.to_s || "ruby"
|
@@ -113,7 +118,7 @@ module Bundler
|
|
113
118
|
when "jruby"
|
114
119
|
JRUBY_VERSION.dup
|
115
120
|
else
|
116
|
-
|
121
|
+
RUBY_ENGINE_VERSION.dup
|
117
122
|
end
|
118
123
|
patchlevel = RUBY_PATCHLEVEL.to_s
|
119
124
|
|
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require "pathname"
|
3
4
|
|
4
5
|
if defined?(Gem::QuickLoader)
|
@@ -14,7 +15,7 @@ begin
|
|
14
15
|
# shouldn't be deferred.
|
15
16
|
require "rubygems/source"
|
16
17
|
rescue LoadError
|
17
|
-
# Not available before
|
18
|
+
# Not available before RubyGems 2.0.0, ignore
|
18
19
|
nil
|
19
20
|
end
|
20
21
|
|
@@ -42,7 +43,11 @@ module Gem
|
|
42
43
|
attr_writer :full_gem_path unless instance_methods.include?(:full_gem_path=)
|
43
44
|
|
44
45
|
def full_gem_path
|
45
|
-
|
46
|
+
# this cannot check source.is_a?(Bundler::Plugin::API::Source)
|
47
|
+
# because that _could_ trip the autoload, and if there are unresolved
|
48
|
+
# gems at that time, this method could be called inside another require,
|
49
|
+
# thus raising with that constant being undefined. Better to check a method
|
50
|
+
if source.respond_to?(:path) || (source.respond_to?(:bundler_plugin_api_source?) && source.bundler_plugin_api_source?)
|
46
51
|
Pathname.new(loaded_from).dirname.expand_path(source.root).to_s.untaint
|
47
52
|
else
|
48
53
|
rg_full_gem_path
|
@@ -131,7 +136,7 @@ module Gem
|
|
131
136
|
end
|
132
137
|
|
133
138
|
class Dependency
|
134
|
-
attr_accessor :source, :groups
|
139
|
+
attr_accessor :source, :groups, :all_sources
|
135
140
|
|
136
141
|
alias_method :eql?, :==
|
137
142
|
|
@@ -142,19 +147,19 @@ module Gem
|
|
142
147
|
end
|
143
148
|
|
144
149
|
def to_yaml_properties
|
145
|
-
instance_variables.reject {|p| ["@source", "@groups"].include?(p.to_s) }
|
150
|
+
instance_variables.reject {|p| ["@source", "@groups", "@all_sources"].include?(p.to_s) }
|
146
151
|
end
|
147
152
|
|
148
153
|
def to_lock
|
149
154
|
out = String.new(" #{name}")
|
150
|
-
unless requirement
|
155
|
+
unless requirement.none?
|
151
156
|
reqs = requirement.requirements.map {|o, v| "#{o} #{v}" }.sort.reverse
|
152
157
|
out << " (#{reqs.join(", ")})"
|
153
158
|
end
|
154
159
|
out
|
155
160
|
end
|
156
161
|
|
157
|
-
# Backport of performance enhancement added to
|
162
|
+
# Backport of performance enhancement added to RubyGems 1.4
|
158
163
|
def matches_spec?(spec)
|
159
164
|
# name can be a Regexp, so use ===
|
160
165
|
return false unless name === spec.name
|
@@ -165,11 +170,16 @@ module Gem
|
|
165
170
|
end
|
166
171
|
|
167
172
|
class Requirement
|
168
|
-
# Backport of performance enhancement added to
|
173
|
+
# Backport of performance enhancement added to RubyGems 1.4
|
169
174
|
def none?
|
170
|
-
|
175
|
+
# note that it might be tempting to replace with with RubyGems 2.0's
|
176
|
+
# improved implementation. Don't. It requires `DefaultRequirement` to be
|
177
|
+
# defined, and more importantantly, these overrides are not used when the
|
178
|
+
# running RubyGems defines these methods
|
179
|
+
to_s == ">= 0"
|
171
180
|
end unless allocate.respond_to?(:none?)
|
172
181
|
|
182
|
+
# Backport of performance enhancement added to RubyGems 2.2
|
173
183
|
def exact?
|
174
184
|
return false unless @requirements.size == 1
|
175
185
|
@requirements[0][0] == "="
|
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require "rubygems/installer"
|
3
4
|
|
4
5
|
module Bundler
|
@@ -17,6 +18,28 @@ module Bundler
|
|
17
18
|
super && validate_bundler_checksum(options[:bundler_expected_checksum])
|
18
19
|
end
|
19
20
|
|
21
|
+
def build_extensions
|
22
|
+
extension_cache_path = options[:bundler_extension_cache_path]
|
23
|
+
return super unless extension_cache_path && extension_dir = Bundler.rubygems.spec_extension_dir(spec)
|
24
|
+
|
25
|
+
extension_dir = Pathname.new(extension_dir)
|
26
|
+
build_complete = SharedHelpers.filesystem_access(extension_cache_path.join("gem.build_complete"), :read, &:file?)
|
27
|
+
if build_complete && !options[:force]
|
28
|
+
SharedHelpers.filesystem_access(extension_dir.parent, &:mkpath)
|
29
|
+
SharedHelpers.filesystem_access(extension_cache_path) do
|
30
|
+
FileUtils.cp_r extension_cache_path, spec.extension_dir
|
31
|
+
end
|
32
|
+
else
|
33
|
+
super
|
34
|
+
if extension_dir.directory? # not made for gems without extensions
|
35
|
+
SharedHelpers.filesystem_access(extension_cache_path.parent, &:mkpath)
|
36
|
+
SharedHelpers.filesystem_access(extension_cache_path) do
|
37
|
+
FileUtils.cp_r extension_dir, extension_cache_path
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
20
43
|
private
|
21
44
|
|
22
45
|
def validate_bundler_checksum(checksum)
|
@@ -25,7 +48,7 @@ module Bundler
|
|
25
48
|
return true unless source = @package.instance_variable_get(:@gem)
|
26
49
|
return true unless source.respond_to?(:with_read_io)
|
27
50
|
digest = source.with_read_io do |io|
|
28
|
-
digest =
|
51
|
+
digest = SharedHelpers.digest(:SHA256).new
|
29
52
|
digest << io.read(16_384) until io.eof?
|
30
53
|
io.rewind
|
31
54
|
send(checksum_type(checksum), digest)
|
@@ -43,7 +66,7 @@ module Bundler
|
|
43
66
|
|
44
67
|
If you wish to continue installing the downloaded gem, and are certain it does not pose a \
|
45
68
|
security issue despite the mismatching checksum, do the following:
|
46
|
-
1. run `bundle config
|
69
|
+
1. run `bundle config disable_checksum_validation true` to turn off checksum verification
|
47
70
|
2. run `bundle install`
|
48
71
|
|
49
72
|
(More info: The expected SHA256 checksum was #{checksum.inspect}, but the \
|
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require "monitor"
|
3
4
|
require "rubygems"
|
4
5
|
require "rubygems/config_file"
|
@@ -74,12 +75,33 @@ module Bundler
|
|
74
75
|
def spec_missing_extensions?(spec, default = true)
|
75
76
|
return spec.missing_extensions? if spec.respond_to?(:missing_extensions?)
|
76
77
|
|
77
|
-
return false if
|
78
|
+
return false if spec_default_gem?(spec)
|
78
79
|
return false if spec.extensions.empty?
|
79
80
|
|
80
81
|
default
|
81
82
|
end
|
82
83
|
|
84
|
+
def spec_default_gem?(spec)
|
85
|
+
spec.respond_to?(:default_gem?) && spec.default_gem?
|
86
|
+
end
|
87
|
+
|
88
|
+
def spec_matches_for_glob(spec, glob)
|
89
|
+
return spec.matches_for_glob(glob) if spec.respond_to?(:matches_for_glob)
|
90
|
+
|
91
|
+
spec.load_paths.map do |lp|
|
92
|
+
Dir["#{lp}/#{glob}#{suffix_pattern}"]
|
93
|
+
end.flatten(1)
|
94
|
+
end
|
95
|
+
|
96
|
+
def spec_extension_dir(spec)
|
97
|
+
return unless spec.respond_to?(:extension_dir)
|
98
|
+
spec.extension_dir
|
99
|
+
end
|
100
|
+
|
101
|
+
def stub_set_spec(stub, spec)
|
102
|
+
stub.instance_variable_set(:@spec, spec)
|
103
|
+
end
|
104
|
+
|
83
105
|
def path(obj)
|
84
106
|
obj.to_s
|
85
107
|
end
|
@@ -110,7 +132,11 @@ module Bundler
|
|
110
132
|
end
|
111
133
|
|
112
134
|
def inflate(obj)
|
113
|
-
Gem
|
135
|
+
if defined?(Gem::Util)
|
136
|
+
Gem::Util.inflate(obj)
|
137
|
+
else
|
138
|
+
Gem.inflate(obj)
|
139
|
+
end
|
114
140
|
end
|
115
141
|
|
116
142
|
def sources=(val)
|
@@ -150,6 +176,10 @@ module Bundler
|
|
150
176
|
Gem.post_reset_hooks
|
151
177
|
end
|
152
178
|
|
179
|
+
def suffix_pattern
|
180
|
+
Gem.suffix_pattern
|
181
|
+
end
|
182
|
+
|
153
183
|
def gem_cache
|
154
184
|
gem_path.map {|p| File.expand_path("cache", p) }
|
155
185
|
end
|
@@ -157,7 +187,7 @@ module Bundler
|
|
157
187
|
def spec_cache_dirs
|
158
188
|
@spec_cache_dirs ||= begin
|
159
189
|
dirs = gem_path.map {|dir| File.join(dir, "specifications") }
|
160
|
-
dirs << Gem.spec_cache_dir if Gem.respond_to?(:spec_cache_dir) # Not in
|
190
|
+
dirs << Gem.spec_cache_dir if Gem.respond_to?(:spec_cache_dir) # Not in RubyGems 2.0.3 or earlier
|
161
191
|
dirs.uniq.select {|dir| File.directory? dir }
|
162
192
|
end
|
163
193
|
end
|
@@ -171,7 +201,7 @@ module Bundler
|
|
171
201
|
end
|
172
202
|
|
173
203
|
def repository_subdirectories
|
174
|
-
%w
|
204
|
+
%w[cache doc gems specifications]
|
175
205
|
end
|
176
206
|
|
177
207
|
def clear_paths
|
@@ -182,8 +212,12 @@ module Bundler
|
|
182
212
|
Gem.bin_path(gem, bin, ver)
|
183
213
|
end
|
184
214
|
|
215
|
+
def path_separator
|
216
|
+
File::PATH_SEPARATOR
|
217
|
+
end
|
218
|
+
|
185
219
|
def preserve_paths
|
186
|
-
# this is a no-op outside of
|
220
|
+
# this is a no-op outside of RubyGems 1.8
|
187
221
|
yield
|
188
222
|
end
|
189
223
|
|
@@ -204,6 +238,10 @@ module Bundler
|
|
204
238
|
Gem.load_plugins if Gem.respond_to?(:load_plugins)
|
205
239
|
end
|
206
240
|
|
241
|
+
def load_plugin_files(files)
|
242
|
+
Gem.load_plugin_files(files) if Gem.respond_to?(:load_plugin_files)
|
243
|
+
end
|
244
|
+
|
207
245
|
def ui=(obj)
|
208
246
|
Gem::DefaultUserInteraction.ui = obj
|
209
247
|
end
|
@@ -213,6 +251,7 @@ module Bundler
|
|
213
251
|
end
|
214
252
|
|
215
253
|
def fetch_specs(all, pre, &blk)
|
254
|
+
require "rubygems/spec_fetcher"
|
216
255
|
specs = Gem::SpecFetcher.new.list(all, pre)
|
217
256
|
specs.each { yield } if block_given?
|
218
257
|
specs
|
@@ -224,9 +263,9 @@ module Bundler
|
|
224
263
|
{} # if we can't download them, there aren't any
|
225
264
|
end
|
226
265
|
|
227
|
-
# TODO: This is for older versions of
|
266
|
+
# TODO: This is for older versions of RubyGems... should we support the
|
228
267
|
# X-Gemfile-Source header on these old versions?
|
229
|
-
# Maybe the newer implementation will work on older
|
268
|
+
# Maybe the newer implementation will work on older RubyGems?
|
230
269
|
# It seems difficult to keep this implementation and still send the header.
|
231
270
|
def fetch_all_remote_specs(remote)
|
232
271
|
old_sources = Bundler.rubygems.sources
|
@@ -264,6 +303,7 @@ module Bundler
|
|
264
303
|
|
265
304
|
def spec_from_gem(path, policy = nil)
|
266
305
|
require "rubygems/security"
|
306
|
+
require "bundler/psyched_yaml"
|
267
307
|
gem_from_path(path, security_policies[policy]).spec
|
268
308
|
rescue Gem::Package::FormatError
|
269
309
|
raise GemspecError, "Could not read gem at #{path}. It may be corrupted."
|
@@ -291,13 +331,13 @@ module Bundler
|
|
291
331
|
def download_gem(spec, uri, path)
|
292
332
|
uri = Bundler.settings.mirror_for(uri)
|
293
333
|
fetcher = Gem::RemoteFetcher.new(configuration[:http_proxy])
|
294
|
-
Bundler::Retry.new("download gem #{uri}"
|
334
|
+
Bundler::Retry.new("download gem from #{uri}").attempts do
|
295
335
|
fetcher.download(spec, uri, path)
|
296
336
|
end
|
297
337
|
end
|
298
338
|
|
299
339
|
def security_policy_keys
|
300
|
-
%w
|
340
|
+
%w[High Medium Low AlmostNo No].map {|level| "#{level}Security" }
|
301
341
|
end
|
302
342
|
|
303
343
|
def security_policies
|
@@ -319,53 +359,57 @@ module Bundler
|
|
319
359
|
end
|
320
360
|
end
|
321
361
|
|
322
|
-
def
|
362
|
+
def binstubs_call_gem?
|
363
|
+
true
|
364
|
+
end
|
365
|
+
|
366
|
+
def stubs_provide_full_functionality?
|
367
|
+
false
|
368
|
+
end
|
369
|
+
|
370
|
+
def replace_gem(specs, specs_by_name)
|
323
371
|
reverse_rubygems_kernel_mixin
|
324
372
|
|
325
|
-
executables =
|
373
|
+
executables = nil
|
326
374
|
|
327
375
|
kernel = (class << ::Kernel; self; end)
|
328
376
|
[kernel, ::Kernel].each do |kernel_class|
|
329
377
|
redefine_method(kernel_class, :gem) do |dep, *reqs|
|
330
|
-
|
378
|
+
executables ||= specs.map(&:executables).flatten if ::Bundler.rubygems.binstubs_call_gem?
|
379
|
+
if executables && executables.include?(File.basename(caller.first.split(":").first))
|
331
380
|
break
|
332
381
|
end
|
382
|
+
|
333
383
|
reqs.pop if reqs.last.is_a?(Hash)
|
334
384
|
|
335
385
|
unless dep.respond_to?(:name) && dep.respond_to?(:requirement)
|
336
386
|
dep = Gem::Dependency.new(dep, reqs)
|
337
387
|
end
|
338
388
|
|
339
|
-
spec =
|
340
|
-
|
341
|
-
if spec.nil?
|
342
|
-
|
343
|
-
e = Gem::LoadError.new "#{dep.name} is not part of the bundle. Add it to Gemfile."
|
344
|
-
e.name = dep.name
|
345
|
-
if e.respond_to?(:requirement=)
|
346
|
-
e.requirement = dep.requirement
|
347
|
-
else
|
348
|
-
e.version_requirement = dep.requirement
|
349
|
-
end
|
350
|
-
raise e
|
351
|
-
elsif dep !~ spec
|
352
|
-
e = Gem::LoadError.new "can't activate #{dep}, already activated #{spec.full_name}. " \
|
353
|
-
"Make sure all dependencies are added to Gemfile."
|
354
|
-
e.name = dep.name
|
355
|
-
if e.respond_to?(:requirement=)
|
356
|
-
e.requirement = dep.requirement
|
357
|
-
else
|
358
|
-
e.version_requirement = dep.requirement
|
359
|
-
end
|
360
|
-
raise e
|
389
|
+
if spec = specs_by_name[dep.name]
|
390
|
+
return true if dep.matches_spec?(spec)
|
361
391
|
end
|
362
392
|
|
363
|
-
|
393
|
+
message = if spec.nil?
|
394
|
+
"#{dep.name} is not part of the bundle." \
|
395
|
+
" Add it to your #{Bundler.default_gemfile.basename}."
|
396
|
+
else
|
397
|
+
"can't activate #{dep}, already activated #{spec.full_name}. " \
|
398
|
+
"Make sure all dependencies are added to Gemfile."
|
399
|
+
end
|
400
|
+
|
401
|
+
e = Gem::LoadError.new(message)
|
402
|
+
e.name = dep.name
|
403
|
+
if e.respond_to?(:requirement=)
|
404
|
+
e.requirement = dep.requirement
|
405
|
+
elsif e.respond_to?(:version_requirement=)
|
406
|
+
e.version_requirement = dep.requirement
|
407
|
+
end
|
408
|
+
raise e
|
364
409
|
end
|
365
410
|
|
366
|
-
#
|
367
|
-
|
368
|
-
kernel_class.send(:public, :gem)
|
411
|
+
# backwards compatibility shim, see https://github.com/bundler/bundler/issues/5102
|
412
|
+
kernel_class.send(:public, :gem) if Bundler.feature_flag.setup_makes_kernel_gem_public?
|
369
413
|
end
|
370
414
|
end
|
371
415
|
|
@@ -392,23 +436,37 @@ module Bundler
|
|
392
436
|
# Used to make bin stubs that are not created by bundler work
|
393
437
|
# under bundler. The new Gem.bin_path only considers gems in
|
394
438
|
# +specs+
|
395
|
-
def replace_bin_path(specs)
|
439
|
+
def replace_bin_path(specs, specs_by_name)
|
396
440
|
gem_class = (class << Gem; self; end)
|
397
441
|
|
398
442
|
redefine_method(gem_class, :find_spec_for_exe) do |gem_name, *args|
|
399
443
|
exec_name = args.first
|
400
444
|
|
445
|
+
spec_with_name = specs_by_name[gem_name]
|
401
446
|
spec = if exec_name
|
402
|
-
|
447
|
+
if spec_with_name && spec_with_name.executables.include?(exec_name)
|
448
|
+
spec_with_name
|
449
|
+
else
|
403
450
|
specs.find {|s| s.executables.include?(exec_name) }
|
451
|
+
end
|
404
452
|
else
|
405
|
-
|
453
|
+
spec_with_name
|
454
|
+
end
|
455
|
+
|
456
|
+
unless spec
|
457
|
+
message = "can't find executable #{exec_name} for gem #{gem_name}"
|
458
|
+
if !exec_name || spec_with_name.nil?
|
459
|
+
message += ". #{gem_name} is not currently included in the bundle, " \
|
460
|
+
"perhaps you meant to add it to your #{Bundler.default_gemfile.basename}?"
|
461
|
+
end
|
462
|
+
raise Gem::Exception, message
|
406
463
|
end
|
407
|
-
|
464
|
+
|
408
465
|
raise Gem::Exception, "no default executable for #{spec.full_name}" unless exec_name ||= spec.default_executable
|
409
|
-
|
410
|
-
|
411
|
-
|
466
|
+
|
467
|
+
unless spec.name == gem_name
|
468
|
+
Bundler::SharedHelpers.major_deprecation 2,
|
469
|
+
"Bundler is using a binstub that was created for a different gem (#{spec.name}).\n" \
|
412
470
|
"You should run `bundle binstub #{gem_name}` " \
|
413
471
|
"to work around a system/bundle conflict."
|
414
472
|
end
|
@@ -422,8 +480,10 @@ module Bundler
|
|
422
480
|
# Copy of Rubygems activate_bin_path impl
|
423
481
|
requirement = args.last
|
424
482
|
spec = find_spec_for_exe name, exec_name, [requirement]
|
425
|
-
|
426
|
-
spec.
|
483
|
+
|
484
|
+
gem_bin = File.join(spec.full_gem_path, spec.bindir, exec_name)
|
485
|
+
gem_from_path_bin = File.join(File.dirname(spec.loaded_from), spec.bindir, exec_name)
|
486
|
+
File.exist?(gem_bin) ? gem_bin : gem_from_path_bin
|
427
487
|
end
|
428
488
|
|
429
489
|
redefine_method(gem_class, :bin_path) do |name, *args|
|
@@ -446,21 +506,24 @@ module Bundler
|
|
446
506
|
redefine_method(gem_class, :refresh) {}
|
447
507
|
end
|
448
508
|
|
449
|
-
# Replace or hook into
|
509
|
+
# Replace or hook into RubyGems to provide a bundlerized view
|
450
510
|
# of the world.
|
451
511
|
def replace_entrypoints(specs)
|
452
|
-
|
512
|
+
specs_by_name = specs.reduce({}) do |h, s|
|
513
|
+
h[s.name] = s
|
514
|
+
h
|
515
|
+
end
|
453
516
|
|
517
|
+
replace_gem(specs, specs_by_name)
|
454
518
|
stub_rubygems(specs)
|
455
|
-
|
456
|
-
replace_bin_path(specs)
|
519
|
+
replace_bin_path(specs, specs_by_name)
|
457
520
|
replace_refresh
|
458
521
|
|
459
522
|
Gem.clear_paths
|
460
523
|
end
|
461
524
|
|
462
|
-
# This backports the correct segment generation code from
|
463
|
-
# by monkeypatching it into the method in
|
525
|
+
# This backports the correct segment generation code from RubyGems 1.4+
|
526
|
+
# by monkeypatching it into the method in RubyGems 1.3.6 and 1.3.7.
|
464
527
|
def backport_segment_generation
|
465
528
|
redefine_method(Gem::Version, :segments) do
|
466
529
|
@segments ||= @version.scan(/[0-9]+|[a-z]+/i).map do |s|
|
@@ -479,7 +542,7 @@ module Bundler
|
|
479
542
|
end
|
480
543
|
|
481
544
|
# This backports base_dir which replaces installation path
|
482
|
-
#
|
545
|
+
# RubyGems 1.8+
|
483
546
|
def backport_base_dir
|
484
547
|
redefine_method(Gem::Specification, :base_dir) do
|
485
548
|
return Gem.dir unless loaded_from
|
@@ -511,8 +574,10 @@ module Bundler
|
|
511
574
|
@replaced_methods.each do |(sym, klass), method|
|
512
575
|
redefine_method(klass, sym, method)
|
513
576
|
end
|
514
|
-
|
515
|
-
proc.binding.
|
577
|
+
if Binding.public_method_defined?(:source_location)
|
578
|
+
post_reset_hooks.reject! {|proc| proc.binding.source_location[0] == __FILE__ }
|
579
|
+
else
|
580
|
+
post_reset_hooks.reject! {|proc| proc.binding.eval("__FILE__") == __FILE__ }
|
516
581
|
end
|
517
582
|
@replaced_methods.clear
|
518
583
|
end
|
@@ -548,7 +613,7 @@ module Bundler
|
|
548
613
|
end
|
549
614
|
end
|
550
615
|
|
551
|
-
#
|
616
|
+
# RubyGems 1.4 through 1.6
|
552
617
|
class Legacy < RubygemsIntegration
|
553
618
|
def initialize
|
554
619
|
super
|
@@ -559,7 +624,7 @@ module Bundler
|
|
559
624
|
end
|
560
625
|
|
561
626
|
def stub_rubygems(specs)
|
562
|
-
#
|
627
|
+
# RubyGems versions lower than 1.7 use SourceIndex#from_gems_in
|
563
628
|
source_index_class = (class << Gem::SourceIndex; self; end)
|
564
629
|
redefine_method(source_index_class, :from_gems_in) do |*args|
|
565
630
|
Gem::SourceIndex.new.tap do |source_index|
|
@@ -591,7 +656,7 @@ module Bundler
|
|
591
656
|
end
|
592
657
|
end
|
593
658
|
|
594
|
-
#
|
659
|
+
# RubyGems versions 1.3.6 and 1.3.7
|
595
660
|
class Ancient < Legacy
|
596
661
|
def initialize
|
597
662
|
super
|
@@ -599,7 +664,7 @@ module Bundler
|
|
599
664
|
end
|
600
665
|
end
|
601
666
|
|
602
|
-
#
|
667
|
+
# RubyGems 1.7
|
603
668
|
class Transitional < Legacy
|
604
669
|
def stub_rubygems(specs)
|
605
670
|
stub_source_index(specs)
|
@@ -613,7 +678,7 @@ module Bundler
|
|
613
678
|
end
|
614
679
|
end
|
615
680
|
|
616
|
-
#
|
681
|
+
# RubyGems 1.8.5-1.8.19
|
617
682
|
class Modern < RubygemsIntegration
|
618
683
|
def stub_rubygems(specs)
|
619
684
|
Gem::Specification.all = specs
|
@@ -634,9 +699,9 @@ module Bundler
|
|
634
699
|
end
|
635
700
|
end
|
636
701
|
|
637
|
-
#
|
702
|
+
# RubyGems 1.8.0 to 1.8.4
|
638
703
|
class AlmostModern < Modern
|
639
|
-
#
|
704
|
+
# RubyGems [>= 1.8.0, < 1.8.5] has a bug that changes Gem.dir whenever
|
640
705
|
# you call Gem::Installer#install with an :install_dir set. We have to
|
641
706
|
# change it back for our sudo mode to work.
|
642
707
|
def preserve_paths
|
@@ -647,9 +712,9 @@ module Bundler
|
|
647
712
|
end
|
648
713
|
end
|
649
714
|
|
650
|
-
#
|
715
|
+
# RubyGems 1.8.20+
|
651
716
|
class MoreModern < Modern
|
652
|
-
#
|
717
|
+
# RubyGems 1.8.20 and adds the skip_validation parameter, so that's
|
653
718
|
# when we start passing it through.
|
654
719
|
def build(spec, skip_validation = false)
|
655
720
|
require "rubygems/builder"
|
@@ -657,7 +722,7 @@ module Bundler
|
|
657
722
|
end
|
658
723
|
end
|
659
724
|
|
660
|
-
#
|
725
|
+
# RubyGems 2.0
|
661
726
|
class Future < RubygemsIntegration
|
662
727
|
def stub_rubygems(specs)
|
663
728
|
Gem::Specification.all = specs
|
@@ -665,6 +730,10 @@ module Bundler
|
|
665
730
|
Gem.post_reset do
|
666
731
|
Gem::Specification.all = specs
|
667
732
|
end
|
733
|
+
|
734
|
+
redefine_method((class << Gem; self; end), :finish_resolve) do |*|
|
735
|
+
[]
|
736
|
+
end
|
668
737
|
end
|
669
738
|
|
670
739
|
def all_specs
|
@@ -699,7 +768,9 @@ module Bundler
|
|
699
768
|
uri = Bundler.settings.mirror_for(uri)
|
700
769
|
fetcher = gem_remote_fetcher
|
701
770
|
fetcher.headers = { "X-Gemfile-Source" => spec.remote.original_uri.to_s } if spec.remote.original_uri
|
702
|
-
|
771
|
+
Bundler::Retry.new("download gem from #{uri}").attempts do
|
772
|
+
fetcher.download(spec, uri, path)
|
773
|
+
end
|
703
774
|
end
|
704
775
|
|
705
776
|
def gem_remote_fetcher
|
@@ -728,6 +799,10 @@ module Bundler
|
|
728
799
|
def install_with_build_args(args)
|
729
800
|
yield
|
730
801
|
end
|
802
|
+
|
803
|
+
def path_separator
|
804
|
+
Gem.path_separator
|
805
|
+
end
|
731
806
|
end
|
732
807
|
|
733
808
|
# RubyGems 2.1.0
|
@@ -745,7 +820,13 @@ module Bundler
|
|
745
820
|
end
|
746
821
|
|
747
822
|
def backport_ext_builder_monitor
|
748
|
-
|
823
|
+
# So we can avoid requiring "rubygems/ext" in its entirety
|
824
|
+
Gem.module_eval <<-RB, __FILE__, __LINE__ + 1
|
825
|
+
module Ext
|
826
|
+
end
|
827
|
+
RB
|
828
|
+
|
829
|
+
require "rubygems/ext/builder"
|
749
830
|
|
750
831
|
Gem::Ext::Builder.class_eval do
|
751
832
|
unless const_defined?(:CHDIR_MONITOR)
|
@@ -771,11 +852,27 @@ module Bundler
|
|
771
852
|
|
772
853
|
def use_gemdeps(gemfile)
|
773
854
|
ENV["BUNDLE_GEMFILE"] ||= File.expand_path(gemfile)
|
855
|
+
require "bundler/gemdeps"
|
774
856
|
runtime = Bundler.setup
|
775
857
|
Bundler.ui = nil
|
776
858
|
activated_spec_names = runtime.requested_specs.map(&:to_spec).sort_by(&:name)
|
777
859
|
[Gemdeps.new(runtime), activated_spec_names]
|
778
860
|
end
|
861
|
+
|
862
|
+
if provides?(">= 2.5.2")
|
863
|
+
# RubyGems-generated binstubs call Kernel#gem
|
864
|
+
def binstubs_call_gem?
|
865
|
+
false
|
866
|
+
end
|
867
|
+
|
868
|
+
# only 2.5.2+ has all of the stub methods we want to use, and since this
|
869
|
+
# is a performance optimization _only_,
|
870
|
+
# we'll restrict ourselves to the most
|
871
|
+
# recent RG versions instead of all versions that have stubs
|
872
|
+
def stubs_provide_full_functionality?
|
873
|
+
true
|
874
|
+
end
|
875
|
+
end
|
779
876
|
end
|
780
877
|
end
|
781
878
|
|
@@ -794,7 +891,7 @@ module Bundler
|
|
794
891
|
RubygemsIntegration::Transitional.new
|
795
892
|
elsif RubygemsIntegration.provides?(">= 1.4.0")
|
796
893
|
RubygemsIntegration::Legacy.new
|
797
|
-
else #
|
894
|
+
else # RubyGems 1.3.6 and 1.3.7
|
798
895
|
RubygemsIntegration::Ancient.new
|
799
896
|
end
|
800
897
|
end
|