rubygems-update 2.6.14 → 2.7.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rubygems-update might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.travis.yml +10 -7
- data/CONTRIBUTING.rdoc +53 -54
- data/History.txt +173 -9
- data/Manifest.txt +39 -11
- data/POLICIES.rdoc +3 -3
- data/README.md +72 -0
- data/Rakefile +30 -5
- data/appveyor.yml +29 -1
- data/bin/gem +1 -1
- data/bin/update_rubygems +2 -2
- data/bundler/CHANGELOG.md +269 -9
- data/bundler/CODE_OF_CONDUCT.md +1 -1
- data/bundler/CONTRIBUTING.md +10 -29
- data/bundler/README.md +22 -10
- data/bundler/exe/bundle +5 -7
- data/bundler/exe/bundle_ruby +4 -3
- data/bundler/lib/bundler.rb +94 -74
- data/bundler/lib/bundler/build_metadata.rb +36 -0
- data/bundler/lib/bundler/capistrano.rb +5 -0
- data/bundler/lib/bundler/cli.rb +229 -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 +3 -2
- data/bundler/lib/bundler/cli/gem.rb +36 -15
- data/bundler/lib/bundler/cli/info.rb +50 -0
- data/bundler/lib/bundler/cli/init.rb +20 -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 +32 -11
- 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 +26 -7
- data/bundler/lib/bundler/compatibility_guard.rb +14 -0
- data/bundler/lib/bundler/constants.rb +1 -0
- data/bundler/lib/bundler/current_ruby.rb +8 -7
- data/bundler/lib/bundler/definition.rb +231 -159
- data/bundler/lib/bundler/dep_proxy.rb +2 -0
- data/bundler/lib/bundler/dependency.rb +6 -7
- data/bundler/lib/bundler/deployment.rb +1 -1
- data/bundler/lib/bundler/deprecate.rb +14 -3
- data/bundler/lib/bundler/dsl.rb +103 -62
- data/bundler/lib/bundler/endpoint_specification.rb +12 -2
- data/bundler/lib/bundler/env.rb +97 -36
- 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 +15 -8
- 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 +4 -2
- data/bundler/lib/bundler/fetcher/index.rb +1 -0
- data/bundler/lib/bundler/friendly_errors.rb +5 -2
- data/bundler/lib/bundler/gem_helper.rb +23 -9
- 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 +1 -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 +51 -27
- data/bundler/lib/bundler/inline.rb +10 -10
- data/bundler/lib/bundler/installer.rb +104 -50
- data/bundler/lib/bundler/installer/gem_installer.rb +5 -2
- 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 +8 -3
- data/bundler/lib/bundler/plugin.rb +6 -1
- data/bundler/lib/bundler/plugin/api/source.rb +16 -3
- data/bundler/lib/bundler/plugin/index.rb +2 -0
- 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 +171 -192
- data/bundler/lib/bundler/resolver/spec_group.rb +111 -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 +6 -1
- 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 +157 -66
- data/bundler/lib/bundler/runtime.rb +28 -18
- 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 +129 -25
- 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 +49 -21
- data/bundler/lib/bundler/source/git/git_proxy.rb +17 -12
- 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 +154 -82
- data/bundler/lib/bundler/source/rubygems/remote.rb +8 -1
- data/bundler/lib/bundler/source_list.rb +75 -15
- data/bundler/lib/bundler/spec_set.rb +34 -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/Executable +5 -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 +13 -10
- 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/ui.rb +1 -0
- data/bundler/lib/bundler/ui/rg_proxy.rb +1 -0
- data/bundler/lib/bundler/ui/shell.rb +24 -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 +5 -4
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +69 -6
- 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 +14 -0
- data/bundler/man/bundle-check.ronn +26 -0
- data/bundler/man/bundle-clean.ronn +18 -0
- data/bundler/man/bundle-config.ronn +180 -60
- data/bundler/man/bundle-exec.ronn +7 -0
- data/bundler/man/bundle-gem.ronn +3 -2
- data/bundler/man/bundle-info.ronn +17 -0
- data/bundler/man/bundle-init.ronn +18 -0
- data/bundler/man/bundle-inject.ronn +22 -0
- data/bundler/man/bundle-install.ronn +32 -32
- data/bundler/man/bundle-list.ronn +15 -0
- data/bundler/man/bundle-open.ronn +19 -0
- data/bundler/man/bundle-outdated.ronn +1 -1
- data/bundler/man/bundle-package.ronn +5 -0
- data/bundler/man/bundle-pristine.ronn +34 -0
- data/bundler/man/bundle-show.ronn +20 -0
- data/bundler/man/bundle-update.ronn +6 -3
- data/bundler/man/bundle-viz.ronn +30 -0
- data/bundler/man/bundle.ronn +11 -20
- data/bundler/man/gemfile.5.ronn +55 -64
- data/lib/rubygems.rb +79 -36
- data/lib/rubygems/basic_specification.rb +8 -4
- data/lib/rubygems/bundler_version_finder.rb +112 -0
- data/lib/rubygems/command.rb +1 -1
- data/lib/rubygems/command_manager.rb +3 -1
- data/lib/rubygems/commands/cert_command.rb +31 -6
- data/lib/rubygems/commands/cleanup_command.rb +1 -1
- data/lib/rubygems/commands/help_command.rb +1 -1
- data/lib/rubygems/commands/owner_command.rb +3 -1
- data/lib/rubygems/commands/pristine_command.rb +11 -8
- data/lib/rubygems/commands/push_command.rb +2 -1
- data/lib/rubygems/commands/query_command.rb +13 -14
- data/lib/rubygems/commands/setup_command.rb +124 -69
- data/lib/rubygems/commands/signin_command.rb +33 -0
- data/lib/rubygems/commands/signout_command.rb +33 -0
- data/lib/rubygems/commands/uninstall_command.rb +4 -3
- data/lib/rubygems/commands/unpack_command.rb +16 -4
- 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 +13 -24
- data/lib/rubygems/core_ext/kernel_require.rb +10 -9
- data/lib/rubygems/dependency.rb +2 -0
- data/lib/rubygems/dependency_installer.rb +4 -0
- data/lib/rubygems/errors.rb +3 -0
- data/lib/rubygems/exceptions.rb +6 -0
- data/lib/rubygems/ext/builder.rb +1 -1
- 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/install_update_options.rb +5 -28
- data/lib/rubygems/installer.rb +12 -7
- data/lib/rubygems/installer_test_case.rb +6 -3
- data/lib/rubygems/package/old.rb +1 -1
- data/lib/rubygems/request.rb +1 -1
- data/lib/rubygems/request_set.rb +20 -3
- data/lib/rubygems/request_set/gem_dependency_api.rb +3 -3
- data/lib/rubygems/requirement.rb +5 -1
- data/lib/rubygems/resolver.rb +24 -3
- data/lib/rubygems/resolver/installer_set.rb +4 -6
- data/lib/rubygems/safe_yaml.rb +4 -1
- data/lib/rubygems/security.rb +10 -3
- data/lib/rubygems/security_option.rb +43 -0
- data/lib/rubygems/server.rb +4 -12
- data/lib/rubygems/source.rb +7 -4
- 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 +281 -231
- data/lib/rubygems/stub_specification.rb +2 -3
- data/lib/rubygems/test_case.rb +14 -1
- data/lib/rubygems/user_interaction.rb +15 -13
- data/lib/rubygems/util.rb +6 -17
- data/lib/rubygems/version.rb +17 -3
- data/lib/rubygems/version_option.rb +6 -1
- 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_config.rb +1 -1
- data/test/rubygems/test_gem.rb +72 -14
- data/test/rubygems/test_gem_bundler_version_finder.rb +125 -0
- data/test/rubygems/test_gem_command.rb +1 -1
- data/test/rubygems/test_gem_commands_build_command.rb +27 -1
- data/test/rubygems/test_gem_commands_cert_command.rb +64 -0
- data/test/rubygems/test_gem_commands_install_command.rb +35 -2
- data/test/rubygems/test_gem_commands_pristine_command.rb +1 -1
- data/test/rubygems/test_gem_commands_query_command.rb +19 -0
- data/test/rubygems/test_gem_commands_setup_command.rb +17 -0
- data/test/rubygems/test_gem_commands_signin_command.rb +95 -0
- data/test/rubygems/test_gem_commands_signout_command.rb +37 -0
- data/test/rubygems/test_gem_commands_sources_command.rb +1 -1
- data/test/rubygems/test_gem_commands_uninstall_command.rb +12 -0
- data/test/rubygems/test_gem_commands_update_command.rb +1 -1
- 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_ext_builder.rb +2 -2
- data/test/rubygems/test_gem_ext_rake_builder.rb +2 -2
- data/test/rubygems/test_gem_install_update_options.rb +2 -1
- data/test/rubygems/test_gem_installer.rb +29 -27
- data/test/rubygems/test_gem_package.rb +5 -5
- data/test/rubygems/test_gem_remote_fetcher.rb +2 -2
- data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +3 -3
- data/test/rubygems/test_gem_requirement.rb +6 -0
- data/test/rubygems/test_gem_resolver.rb +26 -0
- data/test/rubygems/test_gem_resolver_conflict.rb +1 -1
- data/test/rubygems/test_gem_security.rb +5 -0
- data/test/rubygems/test_gem_security_policy.rb +24 -24
- 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 +18 -1
- data/test/rubygems/test_gem_source.rb +9 -0
- data/test/rubygems/test_gem_spec_fetcher.rb +20 -0
- data/test/rubygems/test_gem_specification.rb +85 -10
- data/test/rubygems/test_gem_stream_ui.rb +6 -6
- data/test/rubygems/test_gem_stub_specification.rb +19 -1
- data/test/rubygems/test_gem_util.rb +1 -0
- data/test/rubygems/test_gem_version.rb +28 -7
- data/test/rubygems/test_gem_version_option.rb +15 -0
- data/test/rubygems/test_kernel.rb +30 -0
- data/test/rubygems/test_require.rb +44 -0
- metadata +47 -46
- 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
@@ -0,0 +1,111 @@
|
|
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
|
+
@required_by = []
|
18
|
+
@activated_platforms = []
|
19
|
+
@dependencies = nil
|
20
|
+
@specs = Hash.new do |specs, platform|
|
21
|
+
specs[platform] = select_best_platform_match(all_specs, platform)
|
22
|
+
end
|
23
|
+
@ignores_bundler_dependencies = true
|
24
|
+
end
|
25
|
+
|
26
|
+
def to_specs
|
27
|
+
@activated_platforms.map do |p|
|
28
|
+
next unless s = @specs[p]
|
29
|
+
lazy_spec = LazySpecification.new(name, version, s.platform, source)
|
30
|
+
lazy_spec.dependencies.replace s.dependencies
|
31
|
+
lazy_spec
|
32
|
+
end.compact
|
33
|
+
end
|
34
|
+
|
35
|
+
def activate_platform!(platform)
|
36
|
+
return unless for?(platform)
|
37
|
+
return if @activated_platforms.include?(platform)
|
38
|
+
@activated_platforms << platform
|
39
|
+
end
|
40
|
+
|
41
|
+
def for?(platform)
|
42
|
+
spec = @specs[platform]
|
43
|
+
!spec.nil?
|
44
|
+
end
|
45
|
+
|
46
|
+
def to_s
|
47
|
+
@to_s ||= "#{name} (#{version})"
|
48
|
+
end
|
49
|
+
|
50
|
+
def dependencies_for_activated_platforms
|
51
|
+
dependencies = @activated_platforms.map {|p| __dependencies[p] }
|
52
|
+
metadata_dependencies = @activated_platforms.map do |platform|
|
53
|
+
metadata_dependencies(@specs[platform], platform)
|
54
|
+
end
|
55
|
+
dependencies.concat(metadata_dependencies).flatten
|
56
|
+
end
|
57
|
+
|
58
|
+
def platforms_for_dependency_named(dependency)
|
59
|
+
__dependencies.select {|_, deps| deps.map(&:name).include? dependency }.keys
|
60
|
+
end
|
61
|
+
|
62
|
+
def ==(other)
|
63
|
+
return unless other.is_a?(SpecGroup)
|
64
|
+
name == other.name &&
|
65
|
+
version == other.version &&
|
66
|
+
source == other.source
|
67
|
+
end
|
68
|
+
|
69
|
+
def eql?(other)
|
70
|
+
name.eql?(other.name) &&
|
71
|
+
version.eql?(other.version) &&
|
72
|
+
source.eql?(other.source)
|
73
|
+
end
|
74
|
+
|
75
|
+
def hash
|
76
|
+
to_s.hash ^ source.hash
|
77
|
+
end
|
78
|
+
|
79
|
+
private
|
80
|
+
|
81
|
+
def __dependencies
|
82
|
+
@dependencies = Hash.new do |dependencies, platform|
|
83
|
+
dependencies[platform] = []
|
84
|
+
if spec = @specs[platform]
|
85
|
+
spec.dependencies.each do |dep|
|
86
|
+
next if dep.type == :development
|
87
|
+
next if @ignores_bundler_dependencies && dep.name == "bundler".freeze
|
88
|
+
dependencies[platform] << DepProxy.new(dep, platform)
|
89
|
+
end
|
90
|
+
end
|
91
|
+
dependencies[platform]
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
def metadata_dependencies(spec, platform)
|
96
|
+
return [] unless spec
|
97
|
+
# Only allow endpoint specifications since they won't hit the network to
|
98
|
+
# fetch the full gemspec when calling required_ruby_version
|
99
|
+
return [] if !spec.is_a?(EndpointSpecification) && !spec.is_a?(Gem::Specification)
|
100
|
+
dependencies = []
|
101
|
+
if !spec.required_ruby_version.nil? && !spec.required_ruby_version.none?
|
102
|
+
dependencies << DepProxy.new(Gem::Dependency.new("ruby\0", spec.required_ruby_version), platform)
|
103
|
+
end
|
104
|
+
if !spec.required_rubygems_version.nil? && !spec.required_rubygems_version.none?
|
105
|
+
dependencies << DepProxy.new(Gem::Dependency.new("rubygems\0", spec.required_rubygems_version), platform)
|
106
|
+
end
|
107
|
+
dependencies
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
111
|
+
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"
|
@@ -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
|
@@ -150,6 +172,10 @@ module Bundler
|
|
150
172
|
Gem.post_reset_hooks
|
151
173
|
end
|
152
174
|
|
175
|
+
def suffix_pattern
|
176
|
+
Gem.suffix_pattern
|
177
|
+
end
|
178
|
+
|
153
179
|
def gem_cache
|
154
180
|
gem_path.map {|p| File.expand_path("cache", p) }
|
155
181
|
end
|
@@ -157,7 +183,7 @@ module Bundler
|
|
157
183
|
def spec_cache_dirs
|
158
184
|
@spec_cache_dirs ||= begin
|
159
185
|
dirs = gem_path.map {|dir| File.join(dir, "specifications") }
|
160
|
-
dirs << Gem.spec_cache_dir if Gem.respond_to?(:spec_cache_dir) # Not in
|
186
|
+
dirs << Gem.spec_cache_dir if Gem.respond_to?(:spec_cache_dir) # Not in RubyGems 2.0.3 or earlier
|
161
187
|
dirs.uniq.select {|dir| File.directory? dir }
|
162
188
|
end
|
163
189
|
end
|
@@ -171,7 +197,7 @@ module Bundler
|
|
171
197
|
end
|
172
198
|
|
173
199
|
def repository_subdirectories
|
174
|
-
%w
|
200
|
+
%w[cache doc gems specifications]
|
175
201
|
end
|
176
202
|
|
177
203
|
def clear_paths
|
@@ -182,8 +208,12 @@ module Bundler
|
|
182
208
|
Gem.bin_path(gem, bin, ver)
|
183
209
|
end
|
184
210
|
|
211
|
+
def path_separator
|
212
|
+
File::PATH_SEPARATOR
|
213
|
+
end
|
214
|
+
|
185
215
|
def preserve_paths
|
186
|
-
# this is a no-op outside of
|
216
|
+
# this is a no-op outside of RubyGems 1.8
|
187
217
|
yield
|
188
218
|
end
|
189
219
|
|
@@ -204,6 +234,10 @@ module Bundler
|
|
204
234
|
Gem.load_plugins if Gem.respond_to?(:load_plugins)
|
205
235
|
end
|
206
236
|
|
237
|
+
def load_plugin_files(files)
|
238
|
+
Gem.load_plugin_files(files) if Gem.respond_to?(:load_plugin_files)
|
239
|
+
end
|
240
|
+
|
207
241
|
def ui=(obj)
|
208
242
|
Gem::DefaultUserInteraction.ui = obj
|
209
243
|
end
|
@@ -213,6 +247,7 @@ module Bundler
|
|
213
247
|
end
|
214
248
|
|
215
249
|
def fetch_specs(all, pre, &blk)
|
250
|
+
require "rubygems/spec_fetcher"
|
216
251
|
specs = Gem::SpecFetcher.new.list(all, pre)
|
217
252
|
specs.each { yield } if block_given?
|
218
253
|
specs
|
@@ -224,9 +259,9 @@ module Bundler
|
|
224
259
|
{} # if we can't download them, there aren't any
|
225
260
|
end
|
226
261
|
|
227
|
-
# TODO: This is for older versions of
|
262
|
+
# TODO: This is for older versions of RubyGems... should we support the
|
228
263
|
# X-Gemfile-Source header on these old versions?
|
229
|
-
# Maybe the newer implementation will work on older
|
264
|
+
# Maybe the newer implementation will work on older RubyGems?
|
230
265
|
# It seems difficult to keep this implementation and still send the header.
|
231
266
|
def fetch_all_remote_specs(remote)
|
232
267
|
old_sources = Bundler.rubygems.sources
|
@@ -264,6 +299,7 @@ module Bundler
|
|
264
299
|
|
265
300
|
def spec_from_gem(path, policy = nil)
|
266
301
|
require "rubygems/security"
|
302
|
+
require "bundler/psyched_yaml"
|
267
303
|
gem_from_path(path, security_policies[policy]).spec
|
268
304
|
rescue Gem::Package::FormatError
|
269
305
|
raise GemspecError, "Could not read gem at #{path}. It may be corrupted."
|
@@ -291,13 +327,13 @@ module Bundler
|
|
291
327
|
def download_gem(spec, uri, path)
|
292
328
|
uri = Bundler.settings.mirror_for(uri)
|
293
329
|
fetcher = Gem::RemoteFetcher.new(configuration[:http_proxy])
|
294
|
-
Bundler::Retry.new("download gem #{uri}"
|
330
|
+
Bundler::Retry.new("download gem from #{uri}").attempts do
|
295
331
|
fetcher.download(spec, uri, path)
|
296
332
|
end
|
297
333
|
end
|
298
334
|
|
299
335
|
def security_policy_keys
|
300
|
-
%w
|
336
|
+
%w[High Medium Low AlmostNo No].map {|level| "#{level}Security" }
|
301
337
|
end
|
302
338
|
|
303
339
|
def security_policies
|
@@ -319,53 +355,57 @@ module Bundler
|
|
319
355
|
end
|
320
356
|
end
|
321
357
|
|
322
|
-
def
|
358
|
+
def binstubs_call_gem?
|
359
|
+
true
|
360
|
+
end
|
361
|
+
|
362
|
+
def stubs_provide_full_functionality?
|
363
|
+
false
|
364
|
+
end
|
365
|
+
|
366
|
+
def replace_gem(specs, specs_by_name)
|
323
367
|
reverse_rubygems_kernel_mixin
|
324
368
|
|
325
|
-
executables =
|
369
|
+
executables = nil
|
326
370
|
|
327
371
|
kernel = (class << ::Kernel; self; end)
|
328
372
|
[kernel, ::Kernel].each do |kernel_class|
|
329
373
|
redefine_method(kernel_class, :gem) do |dep, *reqs|
|
330
|
-
|
374
|
+
executables ||= specs.map(&:executables).flatten if ::Bundler.rubygems.binstubs_call_gem?
|
375
|
+
if executables && executables.include?(File.basename(caller.first.split(":").first))
|
331
376
|
break
|
332
377
|
end
|
378
|
+
|
333
379
|
reqs.pop if reqs.last.is_a?(Hash)
|
334
380
|
|
335
381
|
unless dep.respond_to?(:name) && dep.respond_to?(:requirement)
|
336
382
|
dep = Gem::Dependency.new(dep, reqs)
|
337
383
|
end
|
338
384
|
|
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
|
385
|
+
if spec = specs_by_name[dep.name]
|
386
|
+
return true if dep.matches_spec?(spec)
|
361
387
|
end
|
362
388
|
|
363
|
-
|
389
|
+
message = if spec.nil?
|
390
|
+
"#{dep.name} is not part of the bundle." \
|
391
|
+
" Add it to your #{Bundler.default_gemfile.basename}."
|
392
|
+
else
|
393
|
+
"can't activate #{dep}, already activated #{spec.full_name}. " \
|
394
|
+
"Make sure all dependencies are added to Gemfile."
|
395
|
+
end
|
396
|
+
|
397
|
+
e = Gem::LoadError.new(message)
|
398
|
+
e.name = dep.name
|
399
|
+
if e.respond_to?(:requirement=)
|
400
|
+
e.requirement = dep.requirement
|
401
|
+
elsif e.respond_to?(:version_requirement=)
|
402
|
+
e.version_requirement = dep.requirement
|
403
|
+
end
|
404
|
+
raise e
|
364
405
|
end
|
365
406
|
|
366
|
-
#
|
367
|
-
|
368
|
-
kernel_class.send(:public, :gem)
|
407
|
+
# backwards compatibility shim, see https://github.com/bundler/bundler/issues/5102
|
408
|
+
kernel_class.send(:public, :gem) if Bundler.feature_flag.setup_makes_kernel_gem_public?
|
369
409
|
end
|
370
410
|
end
|
371
411
|
|
@@ -392,23 +432,37 @@ module Bundler
|
|
392
432
|
# Used to make bin stubs that are not created by bundler work
|
393
433
|
# under bundler. The new Gem.bin_path only considers gems in
|
394
434
|
# +specs+
|
395
|
-
def replace_bin_path(specs)
|
435
|
+
def replace_bin_path(specs, specs_by_name)
|
396
436
|
gem_class = (class << Gem; self; end)
|
397
437
|
|
398
438
|
redefine_method(gem_class, :find_spec_for_exe) do |gem_name, *args|
|
399
439
|
exec_name = args.first
|
400
440
|
|
441
|
+
spec_with_name = specs_by_name[gem_name]
|
401
442
|
spec = if exec_name
|
402
|
-
|
443
|
+
if spec_with_name && spec_with_name.executables.include?(exec_name)
|
444
|
+
spec_with_name
|
445
|
+
else
|
403
446
|
specs.find {|s| s.executables.include?(exec_name) }
|
447
|
+
end
|
404
448
|
else
|
405
|
-
|
449
|
+
spec_with_name
|
450
|
+
end
|
451
|
+
|
452
|
+
unless spec
|
453
|
+
message = "can't find executable #{exec_name} for gem #{gem_name}"
|
454
|
+
if !exec_name || spec_with_name.nil?
|
455
|
+
message += ". #{gem_name} is not currently included in the bundle, " \
|
456
|
+
"perhaps you meant to add it to your #{Bundler.default_gemfile.basename}?"
|
457
|
+
end
|
458
|
+
raise Gem::Exception, message
|
406
459
|
end
|
407
|
-
|
460
|
+
|
408
461
|
raise Gem::Exception, "no default executable for #{spec.full_name}" unless exec_name ||= spec.default_executable
|
409
|
-
|
410
|
-
|
411
|
-
|
462
|
+
|
463
|
+
unless spec.name == gem_name
|
464
|
+
Bundler::SharedHelpers.major_deprecation 2,
|
465
|
+
"Bundler is using a binstub that was created for a different gem (#{spec.name}).\n" \
|
412
466
|
"You should run `bundle binstub #{gem_name}` " \
|
413
467
|
"to work around a system/bundle conflict."
|
414
468
|
end
|
@@ -422,8 +476,10 @@ module Bundler
|
|
422
476
|
# Copy of Rubygems activate_bin_path impl
|
423
477
|
requirement = args.last
|
424
478
|
spec = find_spec_for_exe name, exec_name, [requirement]
|
425
|
-
|
426
|
-
spec.
|
479
|
+
|
480
|
+
gem_bin = File.join(spec.full_gem_path, spec.bindir, exec_name)
|
481
|
+
gem_from_path_bin = File.join(File.dirname(spec.loaded_from), spec.bindir, exec_name)
|
482
|
+
File.exist?(gem_bin) ? gem_bin : gem_from_path_bin
|
427
483
|
end
|
428
484
|
|
429
485
|
redefine_method(gem_class, :bin_path) do |name, *args|
|
@@ -446,21 +502,24 @@ module Bundler
|
|
446
502
|
redefine_method(gem_class, :refresh) {}
|
447
503
|
end
|
448
504
|
|
449
|
-
# Replace or hook into
|
505
|
+
# Replace or hook into RubyGems to provide a bundlerized view
|
450
506
|
# of the world.
|
451
507
|
def replace_entrypoints(specs)
|
452
|
-
|
508
|
+
specs_by_name = specs.reduce({}) do |h, s|
|
509
|
+
h[s.name] = s
|
510
|
+
h
|
511
|
+
end
|
453
512
|
|
513
|
+
replace_gem(specs, specs_by_name)
|
454
514
|
stub_rubygems(specs)
|
455
|
-
|
456
|
-
replace_bin_path(specs)
|
515
|
+
replace_bin_path(specs, specs_by_name)
|
457
516
|
replace_refresh
|
458
517
|
|
459
518
|
Gem.clear_paths
|
460
519
|
end
|
461
520
|
|
462
|
-
# This backports the correct segment generation code from
|
463
|
-
# by monkeypatching it into the method in
|
521
|
+
# This backports the correct segment generation code from RubyGems 1.4+
|
522
|
+
# by monkeypatching it into the method in RubyGems 1.3.6 and 1.3.7.
|
464
523
|
def backport_segment_generation
|
465
524
|
redefine_method(Gem::Version, :segments) do
|
466
525
|
@segments ||= @version.scan(/[0-9]+|[a-z]+/i).map do |s|
|
@@ -479,7 +538,7 @@ module Bundler
|
|
479
538
|
end
|
480
539
|
|
481
540
|
# This backports base_dir which replaces installation path
|
482
|
-
#
|
541
|
+
# RubyGems 1.8+
|
483
542
|
def backport_base_dir
|
484
543
|
redefine_method(Gem::Specification, :base_dir) do
|
485
544
|
return Gem.dir unless loaded_from
|
@@ -548,7 +607,7 @@ module Bundler
|
|
548
607
|
end
|
549
608
|
end
|
550
609
|
|
551
|
-
#
|
610
|
+
# RubyGems 1.4 through 1.6
|
552
611
|
class Legacy < RubygemsIntegration
|
553
612
|
def initialize
|
554
613
|
super
|
@@ -559,7 +618,7 @@ module Bundler
|
|
559
618
|
end
|
560
619
|
|
561
620
|
def stub_rubygems(specs)
|
562
|
-
#
|
621
|
+
# RubyGems versions lower than 1.7 use SourceIndex#from_gems_in
|
563
622
|
source_index_class = (class << Gem::SourceIndex; self; end)
|
564
623
|
redefine_method(source_index_class, :from_gems_in) do |*args|
|
565
624
|
Gem::SourceIndex.new.tap do |source_index|
|
@@ -591,7 +650,7 @@ module Bundler
|
|
591
650
|
end
|
592
651
|
end
|
593
652
|
|
594
|
-
#
|
653
|
+
# RubyGems versions 1.3.6 and 1.3.7
|
595
654
|
class Ancient < Legacy
|
596
655
|
def initialize
|
597
656
|
super
|
@@ -599,7 +658,7 @@ module Bundler
|
|
599
658
|
end
|
600
659
|
end
|
601
660
|
|
602
|
-
#
|
661
|
+
# RubyGems 1.7
|
603
662
|
class Transitional < Legacy
|
604
663
|
def stub_rubygems(specs)
|
605
664
|
stub_source_index(specs)
|
@@ -613,7 +672,7 @@ module Bundler
|
|
613
672
|
end
|
614
673
|
end
|
615
674
|
|
616
|
-
#
|
675
|
+
# RubyGems 1.8.5-1.8.19
|
617
676
|
class Modern < RubygemsIntegration
|
618
677
|
def stub_rubygems(specs)
|
619
678
|
Gem::Specification.all = specs
|
@@ -634,9 +693,9 @@ module Bundler
|
|
634
693
|
end
|
635
694
|
end
|
636
695
|
|
637
|
-
#
|
696
|
+
# RubyGems 1.8.0 to 1.8.4
|
638
697
|
class AlmostModern < Modern
|
639
|
-
#
|
698
|
+
# RubyGems [>= 1.8.0, < 1.8.5] has a bug that changes Gem.dir whenever
|
640
699
|
# you call Gem::Installer#install with an :install_dir set. We have to
|
641
700
|
# change it back for our sudo mode to work.
|
642
701
|
def preserve_paths
|
@@ -647,9 +706,9 @@ module Bundler
|
|
647
706
|
end
|
648
707
|
end
|
649
708
|
|
650
|
-
#
|
709
|
+
# RubyGems 1.8.20+
|
651
710
|
class MoreModern < Modern
|
652
|
-
#
|
711
|
+
# RubyGems 1.8.20 and adds the skip_validation parameter, so that's
|
653
712
|
# when we start passing it through.
|
654
713
|
def build(spec, skip_validation = false)
|
655
714
|
require "rubygems/builder"
|
@@ -657,7 +716,7 @@ module Bundler
|
|
657
716
|
end
|
658
717
|
end
|
659
718
|
|
660
|
-
#
|
719
|
+
# RubyGems 2.0
|
661
720
|
class Future < RubygemsIntegration
|
662
721
|
def stub_rubygems(specs)
|
663
722
|
Gem::Specification.all = specs
|
@@ -665,6 +724,10 @@ module Bundler
|
|
665
724
|
Gem.post_reset do
|
666
725
|
Gem::Specification.all = specs
|
667
726
|
end
|
727
|
+
|
728
|
+
redefine_method((class << Gem; self; end), :finish_resolve) do |*|
|
729
|
+
[]
|
730
|
+
end
|
668
731
|
end
|
669
732
|
|
670
733
|
def all_specs
|
@@ -699,7 +762,9 @@ module Bundler
|
|
699
762
|
uri = Bundler.settings.mirror_for(uri)
|
700
763
|
fetcher = gem_remote_fetcher
|
701
764
|
fetcher.headers = { "X-Gemfile-Source" => spec.remote.original_uri.to_s } if spec.remote.original_uri
|
702
|
-
|
765
|
+
Bundler::Retry.new("download gem from #{uri}").attempts do
|
766
|
+
fetcher.download(spec, uri, path)
|
767
|
+
end
|
703
768
|
end
|
704
769
|
|
705
770
|
def gem_remote_fetcher
|
@@ -728,6 +793,10 @@ module Bundler
|
|
728
793
|
def install_with_build_args(args)
|
729
794
|
yield
|
730
795
|
end
|
796
|
+
|
797
|
+
def path_separator
|
798
|
+
Gem.path_separator
|
799
|
+
end
|
731
800
|
end
|
732
801
|
|
733
802
|
# RubyGems 2.1.0
|
@@ -745,7 +814,13 @@ module Bundler
|
|
745
814
|
end
|
746
815
|
|
747
816
|
def backport_ext_builder_monitor
|
748
|
-
|
817
|
+
# So we can avoid requiring "rubygems/ext" in its entirety
|
818
|
+
Gem.module_eval <<-RB, __FILE__, __LINE__ + 1
|
819
|
+
module Ext
|
820
|
+
end
|
821
|
+
RB
|
822
|
+
|
823
|
+
require "rubygems/ext/builder"
|
749
824
|
|
750
825
|
Gem::Ext::Builder.class_eval do
|
751
826
|
unless const_defined?(:CHDIR_MONITOR)
|
@@ -771,11 +846,27 @@ module Bundler
|
|
771
846
|
|
772
847
|
def use_gemdeps(gemfile)
|
773
848
|
ENV["BUNDLE_GEMFILE"] ||= File.expand_path(gemfile)
|
849
|
+
require "bundler/gemdeps"
|
774
850
|
runtime = Bundler.setup
|
775
851
|
Bundler.ui = nil
|
776
852
|
activated_spec_names = runtime.requested_specs.map(&:to_spec).sort_by(&:name)
|
777
853
|
[Gemdeps.new(runtime), activated_spec_names]
|
778
854
|
end
|
855
|
+
|
856
|
+
if provides?(">= 2.5.2")
|
857
|
+
# RubyGems-generated binstubs call Kernel#gem
|
858
|
+
def binstubs_call_gem?
|
859
|
+
false
|
860
|
+
end
|
861
|
+
|
862
|
+
# only 2.5.2+ has all of the stub methods we want to use, and since this
|
863
|
+
# is a performance optimization _only_,
|
864
|
+
# we'll restrict ourselves to the most
|
865
|
+
# recent RG versions instead of all versions that have stubs
|
866
|
+
def stubs_provide_full_functionality?
|
867
|
+
true
|
868
|
+
end
|
869
|
+
end
|
779
870
|
end
|
780
871
|
end
|
781
872
|
|
@@ -794,7 +885,7 @@ module Bundler
|
|
794
885
|
RubygemsIntegration::Transitional.new
|
795
886
|
elsif RubygemsIntegration.provides?(">= 1.4.0")
|
796
887
|
RubygemsIntegration::Legacy.new
|
797
|
-
else #
|
888
|
+
else # RubyGems 1.3.6 and 1.3.7
|
798
889
|
RubygemsIntegration::Ancient.new
|
799
890
|
end
|
800
891
|
end
|