rubygems-update 3.5.3 → 3.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1410 -686
- data/CODE_OF_CONDUCT.md +79 -28
- data/CONTRIBUTING.md +4 -226
- data/Manifest.txt +107 -83
- data/README.md +16 -11
- data/SECURITY.md +7 -0
- data/bundler/CHANGELOG.md +1525 -931
- data/bundler/README.md +9 -9
- data/bundler/bundler.gemspec +2 -2
- data/bundler/lib/bundler/build_metadata.rb +10 -11
- data/bundler/lib/bundler/checksum.rb +22 -12
- data/bundler/lib/bundler/cli/add.rb +3 -1
- data/bundler/lib/bundler/cli/binstubs.rb +1 -1
- data/bundler/lib/bundler/cli/check.rb +3 -3
- data/bundler/lib/bundler/cli/common.rb +1 -1
- data/bundler/lib/bundler/cli/config.rb +2 -2
- data/bundler/lib/bundler/cli/console.rb +8 -10
- data/bundler/lib/bundler/cli/doctor/diagnose.rb +167 -0
- data/bundler/lib/bundler/cli/doctor/ssl.rb +249 -0
- data/bundler/lib/bundler/cli/doctor.rb +27 -151
- data/bundler/lib/bundler/cli/exec.rb +1 -0
- data/bundler/lib/bundler/cli/fund.rb +1 -1
- data/bundler/lib/bundler/cli/gem.rb +74 -46
- data/bundler/lib/bundler/cli/info.rb +6 -6
- data/bundler/lib/bundler/cli/inject.rb +3 -3
- data/bundler/lib/bundler/cli/install.rb +19 -10
- data/bundler/lib/bundler/cli/issue.rb +3 -3
- data/bundler/lib/bundler/cli/lock.rb +32 -11
- data/bundler/lib/bundler/cli/outdated.rb +23 -23
- data/bundler/lib/bundler/cli/plugin.rb +3 -2
- data/bundler/lib/bundler/cli/pristine.rb +1 -1
- data/bundler/lib/bundler/cli/show.rb +3 -3
- data/bundler/lib/bundler/cli/update.rb +3 -3
- data/bundler/lib/bundler/cli.rb +75 -145
- data/bundler/lib/bundler/compact_index_client/cache.rb +48 -73
- data/bundler/lib/bundler/compact_index_client/cache_file.rb +0 -5
- data/bundler/lib/bundler/compact_index_client/parser.rb +84 -0
- data/bundler/lib/bundler/compact_index_client/updater.rb +6 -16
- data/bundler/lib/bundler/compact_index_client.rb +52 -85
- data/bundler/lib/bundler/constants.rb +8 -1
- data/bundler/lib/bundler/current_ruby.rb +48 -34
- data/bundler/lib/bundler/definition.rb +501 -328
- data/bundler/lib/bundler/dependency.rb +93 -47
- data/bundler/lib/bundler/dsl.rb +147 -103
- data/bundler/lib/bundler/endpoint_specification.rb +30 -3
- data/bundler/lib/bundler/env.rb +1 -1
- data/bundler/lib/bundler/environment_preserver.rb +5 -23
- data/bundler/lib/bundler/errors.rb +53 -5
- data/bundler/lib/bundler/feature_flag.rb +18 -18
- data/bundler/lib/bundler/fetcher/compact_index.rb +16 -25
- data/bundler/lib/bundler/fetcher/dependency.rb +2 -1
- data/bundler/lib/bundler/fetcher/downloader.rb +34 -8
- data/bundler/lib/bundler/fetcher.rb +63 -26
- data/bundler/lib/bundler/force_platform.rb +0 -2
- data/bundler/lib/bundler/friendly_errors.rb +3 -2
- data/bundler/lib/bundler/gem_helper.rb +1 -1
- data/bundler/lib/bundler/gem_version_promoter.rb +42 -40
- data/bundler/lib/bundler/index.rb +7 -2
- data/bundler/lib/bundler/injector.rb +14 -16
- data/bundler/lib/bundler/inline.rb +42 -17
- data/bundler/lib/bundler/installer/gem_installer.rb +4 -3
- data/bundler/lib/bundler/installer/parallel_installer.rb +3 -2
- data/bundler/lib/bundler/installer/standalone.rb +2 -5
- data/bundler/lib/bundler/installer.rb +22 -45
- data/bundler/lib/bundler/lazy_specification.rb +121 -48
- data/bundler/lib/bundler/lockfile_generator.rb +1 -1
- data/bundler/lib/bundler/lockfile_parser.rb +36 -9
- data/bundler/lib/bundler/man/bundle-add.1 +44 -27
- data/bundler/lib/bundler/man/bundle-add.1.ronn +52 -23
- data/bundler/lib/bundler/man/bundle-binstubs.1 +9 -6
- data/bundler/lib/bundler/man/bundle-binstubs.1.ronn +6 -3
- data/bundler/lib/bundler/man/bundle-cache.1 +32 -4
- data/bundler/lib/bundler/man/bundle-cache.1.ronn +31 -2
- data/bundler/lib/bundler/man/bundle-check.1 +7 -5
- data/bundler/lib/bundler/man/bundle-check.1.ronn +7 -2
- data/bundler/lib/bundler/man/bundle-clean.1 +3 -3
- data/bundler/lib/bundler/man/bundle-config.1 +180 -138
- data/bundler/lib/bundler/man/bundle-config.1.ronn +96 -99
- data/bundler/lib/bundler/man/bundle-console.1 +4 -6
- data/bundler/lib/bundler/man/bundle-console.1.ronn +2 -7
- data/bundler/lib/bundler/man/bundle-doctor.1 +46 -7
- data/bundler/lib/bundler/man/bundle-doctor.1.ronn +49 -5
- data/bundler/lib/bundler/man/bundle-env.1 +9 -0
- data/bundler/lib/bundler/man/bundle-env.1.ronn +10 -0
- data/bundler/lib/bundler/man/bundle-exec.1 +9 -6
- data/bundler/lib/bundler/man/bundle-exec.1.ronn +6 -3
- data/bundler/lib/bundler/man/bundle-fund.1 +22 -0
- data/bundler/lib/bundler/man/bundle-fund.1.ronn +25 -0
- data/bundler/lib/bundler/man/bundle-gem.1 +69 -28
- data/bundler/lib/bundler/man/bundle-gem.1.ronn +42 -6
- data/bundler/lib/bundler/man/bundle-help.1 +3 -3
- data/bundler/lib/bundler/man/bundle-info.1 +7 -4
- data/bundler/lib/bundler/man/bundle-info.1.ronn +6 -2
- data/bundler/lib/bundler/man/bundle-init.1 +5 -5
- data/bundler/lib/bundler/man/bundle-init.1.ronn +3 -2
- data/bundler/lib/bundler/man/bundle-inject.1 +13 -5
- data/bundler/lib/bundler/man/bundle-inject.1.ronn +10 -2
- data/bundler/lib/bundler/man/bundle-install.1 +20 -17
- data/bundler/lib/bundler/man/bundle-install.1.ronn +26 -23
- data/bundler/lib/bundler/man/bundle-issue.1 +45 -0
- data/bundler/lib/bundler/man/bundle-issue.1.ronn +37 -0
- data/bundler/lib/bundler/man/bundle-licenses.1 +9 -0
- data/bundler/lib/bundler/man/bundle-licenses.1.ronn +10 -0
- data/bundler/lib/bundler/man/bundle-list.1 +3 -3
- data/bundler/lib/bundler/man/bundle-list.1.ronn +4 -1
- data/bundler/lib/bundler/man/bundle-lock.1 +23 -8
- data/bundler/lib/bundler/man/bundle-lock.1.ronn +25 -4
- data/bundler/lib/bundler/man/bundle-open.1 +4 -4
- data/bundler/lib/bundler/man/bundle-open.1.ronn +2 -1
- data/bundler/lib/bundler/man/bundle-outdated.1 +10 -7
- data/bundler/lib/bundler/man/bundle-outdated.1.ronn +8 -4
- data/bundler/lib/bundler/man/bundle-platform.1 +3 -3
- data/bundler/lib/bundler/man/bundle-plugin.1 +9 -6
- data/bundler/lib/bundler/man/bundle-plugin.1.ronn +7 -3
- data/bundler/lib/bundler/man/bundle-pristine.1 +3 -3
- data/bundler/lib/bundler/man/bundle-pristine.1.ronn +1 -1
- data/bundler/lib/bundler/man/bundle-remove.1 +3 -3
- data/bundler/lib/bundler/man/bundle-remove.1.ronn +1 -1
- data/bundler/lib/bundler/man/bundle-show.1 +7 -4
- data/bundler/lib/bundler/man/bundle-show.1.ronn +4 -0
- data/bundler/lib/bundler/man/bundle-update.1 +17 -11
- data/bundler/lib/bundler/man/bundle-update.1.ronn +17 -9
- data/bundler/lib/bundler/man/bundle-version.1 +3 -3
- data/bundler/lib/bundler/man/bundle-viz.1 +6 -6
- data/bundler/lib/bundler/man/bundle-viz.1.ronn +7 -3
- data/bundler/lib/bundler/man/bundle.1 +3 -3
- data/bundler/lib/bundler/man/gemfile.5 +7 -5
- data/bundler/lib/bundler/man/gemfile.5.ronn +8 -2
- data/bundler/lib/bundler/man/index.txt +4 -0
- data/bundler/lib/bundler/match_metadata.rb +13 -0
- data/bundler/lib/bundler/match_platform.rb +31 -12
- data/bundler/lib/bundler/materialization.rb +59 -0
- data/bundler/lib/bundler/mirror.rb +3 -3
- data/bundler/lib/bundler/plugin/api/source.rb +5 -4
- data/bundler/lib/bundler/plugin/events.rb +24 -0
- data/bundler/lib/bundler/plugin/index.rb +5 -1
- data/bundler/lib/bundler/plugin/installer/path.rb +26 -0
- data/bundler/lib/bundler/plugin/installer.rb +37 -17
- data/bundler/lib/bundler/plugin/source_list.rb +4 -4
- data/bundler/lib/bundler/plugin.rb +21 -2
- data/bundler/lib/bundler/process_lock.rb +10 -14
- data/bundler/lib/bundler/remote_specification.rb +6 -1
- data/bundler/lib/bundler/resolver/base.rb +14 -3
- data/bundler/lib/bundler/resolver/candidate.rb +18 -27
- data/bundler/lib/bundler/resolver/package.rb +20 -3
- data/bundler/lib/bundler/resolver/spec_group.rb +22 -27
- data/bundler/lib/bundler/resolver/strategy.rb +40 -0
- data/bundler/lib/bundler/resolver.rb +114 -52
- data/bundler/lib/bundler/retry.rb +1 -1
- data/bundler/lib/bundler/ruby_dsl.rb +12 -3
- data/bundler/lib/bundler/ruby_version.rb +7 -1
- data/bundler/lib/bundler/rubygems_ext.rb +303 -150
- data/bundler/lib/bundler/rubygems_gem_installer.rb +40 -5
- data/bundler/lib/bundler/rubygems_integration.rb +40 -73
- data/bundler/lib/bundler/runtime.rb +48 -35
- data/bundler/lib/bundler/self_manager.rb +36 -26
- data/bundler/lib/bundler/settings/validator.rb +0 -23
- data/bundler/lib/bundler/settings.rb +36 -27
- data/bundler/lib/bundler/setup.rb +6 -0
- data/bundler/lib/bundler/shared_helpers.rb +45 -25
- data/bundler/lib/bundler/source/gemspec.rb +1 -4
- data/bundler/lib/bundler/source/git/git_proxy.rb +26 -9
- data/bundler/lib/bundler/source/git.rb +113 -41
- data/bundler/lib/bundler/source/metadata.rb +4 -3
- data/bundler/lib/bundler/source/path.rb +14 -18
- data/bundler/lib/bundler/source/rubygems/remote.rb +12 -4
- data/bundler/lib/bundler/source/rubygems.rb +54 -48
- data/bundler/lib/bundler/source.rb +2 -0
- data/bundler/lib/bundler/source_list.rb +54 -12
- data/bundler/lib/bundler/source_map.rb +1 -1
- data/bundler/lib/bundler/spec_set.rb +227 -103
- data/bundler/lib/bundler/stub_specification.rb +29 -2
- data/bundler/lib/bundler/templates/Executable +0 -11
- data/bundler/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +77 -29
- data/bundler/lib/bundler/templates/newgem/Gemfile.tt +1 -3
- data/bundler/lib/bundler/templates/newgem/README.md.tt +7 -3
- data/bundler/lib/bundler/templates/newgem/github/workflows/main.yml.tt +17 -15
- data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +14 -12
- data/bundler/lib/bundler/templates/newgem/rubocop.yml.tt +0 -5
- data/bundler/lib/bundler/ui/shell.rb +26 -4
- data/bundler/lib/bundler/ui/silent.rb +12 -1
- data/bundler/lib/bundler/uri_credentials_filter.rb +3 -3
- data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +53 -3
- data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +1 -1
- data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +11 -0
- data/bundler/lib/bundler/vendor/fileutils/lib/fileutils.rb +15 -13
- data/bundler/lib/bundler/vendor/net-http-persistent/README.rdoc +1 -1
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +2 -1
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +134 -57
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/basic_package_source.rb +4 -24
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/static_package_source.rb +1 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/strategy.rb +42 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_range.rb +20 -8
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb +17 -29
- data/bundler/lib/bundler/vendor/securerandom/COPYING +56 -0
- data/bundler/lib/bundler/vendor/securerandom/lib/securerandom.rb +102 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +3 -5
- data/bundler/lib/bundler/vendor/thor/lib/thor/group.rb +11 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +1 -4
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/option.rb +2 -2
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/options.rb +2 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +9 -9
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/html.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/table_printer.rb +5 -21
- data/bundler/lib/bundler/vendor/thor/lib/thor/util.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor.rb +11 -0
- data/bundler/lib/bundler/vendor/uri/COPYING +56 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/common.rb +43 -16
- data/bundler/lib/bundler/vendor/uri/lib/uri/file.rb +3 -3
- data/bundler/lib/bundler/vendor/uri/lib/uri/ftp.rb +1 -1
- data/bundler/lib/bundler/vendor/uri/lib/uri/generic.rb +28 -37
- data/bundler/lib/bundler/vendor/uri/lib/uri/http.rb +2 -2
- data/bundler/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +16 -9
- data/bundler/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +26 -3
- data/bundler/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
- data/bundler/lib/bundler/vendor/uri/lib/uri.rb +9 -9
- data/bundler/lib/bundler/vendored_net_http.rb +20 -5
- data/bundler/lib/bundler/vendored_securerandom.rb +12 -0
- data/bundler/lib/bundler/vendored_timeout.rb +7 -3
- data/bundler/lib/bundler/vendored_uri.rb +18 -1
- data/bundler/lib/bundler/version.rb +10 -2
- data/bundler/lib/bundler/worker.rb +1 -1
- data/bundler/lib/bundler/yaml_serializer.rb +12 -7
- data/bundler/lib/bundler.rb +101 -61
- data/{bundler → doc/bundler}/UPGRADING.md +132 -127
- data/doc/rubygems/CONTRIBUTING.md +227 -0
- data/{POLICIES.md → doc/rubygems/POLICIES.md} +86 -17
- data/exe/update_rubygems +1 -1
- data/lib/rubygems/basic_specification.rb +50 -10
- data/lib/rubygems/bundler_version_finder.rb +1 -1
- data/lib/rubygems/command.rb +1 -4
- data/lib/rubygems/command_manager.rb +5 -6
- data/lib/rubygems/commands/build_command.rb +2 -11
- data/lib/rubygems/commands/cleanup_command.rb +3 -13
- data/lib/rubygems/commands/contents_command.rb +17 -10
- data/lib/rubygems/commands/environment_command.rb +5 -0
- data/lib/rubygems/commands/exec_command.rb +18 -11
- data/lib/rubygems/commands/fetch_command.rb +14 -0
- data/lib/rubygems/commands/help_command.rb +2 -2
- data/lib/rubygems/commands/install_command.rb +0 -4
- data/lib/rubygems/commands/pristine_command.rb +29 -19
- data/lib/rubygems/commands/push_command.rb +31 -6
- data/lib/rubygems/commands/rdoc_command.rb +3 -10
- data/lib/rubygems/commands/rebuild_command.rb +262 -0
- data/lib/rubygems/commands/setup_command.rb +13 -18
- data/lib/rubygems/commands/sources_command.rb +2 -2
- data/lib/rubygems/commands/uninstall_command.rb +9 -4
- data/lib/rubygems/commands/unpack_command.rb +0 -6
- data/lib/rubygems/commands/update_command.rb +13 -22
- data/lib/rubygems/config_file.rb +45 -16
- data/lib/rubygems/core_ext/kernel_require.rb +15 -3
- data/lib/rubygems/core_ext/kernel_warn.rb +2 -6
- data/lib/rubygems/defaults.rb +7 -7
- data/lib/rubygems/dependency.rb +12 -16
- data/lib/rubygems/dependency_list.rb +1 -1
- data/lib/rubygems/deprecate.rb +79 -77
- data/lib/rubygems/errors.rb +2 -1
- data/lib/rubygems/exceptions.rb +2 -9
- data/lib/rubygems/ext/builder.rb +21 -8
- data/lib/rubygems/ext/cargo_builder.rb +16 -26
- data/lib/rubygems/ext/cmake_builder.rb +7 -2
- data/lib/rubygems/ext/configure_builder.rb +7 -2
- data/lib/rubygems/ext/ext_conf_builder.rb +9 -5
- data/lib/rubygems/ext/rake_builder.rb +7 -4
- data/lib/rubygems/gem_runner.rb +9 -0
- data/lib/rubygems/gemcutter_utilities/webauthn_listener.rb +11 -4
- data/lib/rubygems/gemcutter_utilities/webauthn_poller.rb +3 -1
- data/lib/rubygems/gemcutter_utilities.rb +52 -26
- data/lib/rubygems/gemspec_helpers.rb +19 -0
- data/lib/rubygems/install_update_options.rb +5 -0
- data/lib/rubygems/installer.rb +76 -90
- data/lib/rubygems/local_remote_options.rb +8 -8
- data/lib/rubygems/package/tar_header.rb +31 -4
- data/lib/rubygems/package/tar_reader/entry.rb +1 -5
- data/lib/rubygems/package/tar_writer.rb +5 -4
- data/lib/rubygems/package.rb +13 -8
- data/lib/rubygems/platform.rb +148 -43
- data/lib/rubygems/psych_tree.rb +4 -0
- data/lib/rubygems/query_utils.rb +2 -2
- data/lib/rubygems/rdoc.rb +16 -3
- data/lib/rubygems/remote_fetcher.rb +6 -7
- data/lib/rubygems/request.rb +5 -5
- data/lib/rubygems/request_set/gem_dependency_api.rb +1 -1
- data/lib/rubygems/request_set.rb +4 -7
- data/lib/rubygems/requirement.rb +16 -12
- data/lib/rubygems/resolver/activation_request.rb +1 -1
- data/lib/rubygems/resolver/api_set/gem_parser.rb +2 -5
- data/lib/rubygems/resolver/api_set.rb +13 -8
- data/lib/rubygems/resolver/best_set.rb +1 -29
- data/lib/rubygems/resolver/composed_set.rb +3 -3
- data/lib/rubygems/resolver/git_set.rb +0 -1
- data/lib/rubygems/resolver/index_set.rb +2 -2
- data/lib/rubygems/resolver/source_set.rb +1 -1
- data/lib/rubygems/resolver/spec_specification.rb +7 -0
- data/lib/rubygems/resolver.rb +8 -8
- data/lib/rubygems/s3_uri_signer.rb +8 -6
- data/lib/rubygems/safe_marshal/reader.rb +31 -14
- data/lib/rubygems/safe_marshal/visitors/to_ruby.rb +29 -16
- data/lib/rubygems/safe_yaml.rb +10 -1
- data/lib/rubygems/security.rb +1 -1
- data/lib/rubygems/source/git.rb +22 -17
- data/lib/rubygems/source/installed.rb +3 -1
- data/lib/rubygems/source/local.rb +8 -4
- data/lib/rubygems/source/specific_file.rb +5 -3
- data/lib/rubygems/source.rb +37 -29
- data/lib/rubygems/source_list.rb +1 -1
- data/lib/rubygems/spec_fetcher.rb +47 -15
- data/lib/rubygems/specification.rb +110 -183
- data/lib/rubygems/specification_policy.rb +33 -13
- data/lib/rubygems/specification_record.rb +212 -0
- data/lib/rubygems/stub_specification.rb +32 -10
- data/lib/rubygems/target_rbconfig.rb +50 -0
- data/lib/rubygems/uninstaller.rb +42 -22
- data/lib/rubygems/uri.rb +6 -6
- data/lib/rubygems/uri_formatter.rb +2 -1
- data/lib/rubygems/util/licenses.rb +118 -1
- data/lib/rubygems/util.rb +1 -1
- data/lib/rubygems/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +57 -0
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/delegates/specification_provider.rb +11 -11
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/action.rb +1 -1
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +1 -1
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +1 -1
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +1 -1
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +1 -1
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/log.rb +1 -1
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/set_payload.rb +1 -1
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/tag.rb +1 -1
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/vertex.rb +1 -1
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph.rb +2 -2
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/errors.rb +1 -1
- data/lib/rubygems/vendor/molinillo/lib/molinillo/gem_metadata.rb +6 -0
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/modules/specification_provider.rb +2 -2
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/modules/ui.rb +1 -1
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/resolution.rb +4 -4
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/resolver.rb +1 -1
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/state.rb +1 -1
- data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo.rb +2 -2
- data/lib/rubygems/vendor/net-http/COPYING +56 -0
- data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/generic_request.rb +9 -9
- data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/header.rb +3 -3
- data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/request.rb +3 -3
- data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/requests.rb +35 -30
- data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/response.rb +2 -2
- data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/responses.rb +6 -6
- data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/status.rb +1 -1
- data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http.rb +149 -70
- data/lib/rubygems/{net-http → vendor/net-http}/lib/net/https.rb +1 -1
- data/lib/rubygems/vendor/optparse/COPYING +56 -0
- data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse/ac.rb +16 -0
- data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse/kwargs.rb +8 -3
- data/lib/rubygems/vendor/optparse/lib/optparse/uri.rb +7 -0
- data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse/version.rb +9 -0
- data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse.rb +158 -62
- data/lib/rubygems/vendor/resolv/COPYING +56 -0
- data/lib/rubygems/{resolv → vendor/resolv}/lib/resolv.rb +165 -69
- data/lib/rubygems/vendor/securerandom/COPYING +56 -0
- data/lib/rubygems/vendor/securerandom/lib/securerandom.rb +102 -0
- data/lib/rubygems/vendor/timeout/COPYING +56 -0
- data/lib/rubygems/{timeout → vendor/timeout}/lib/timeout.rb +10 -11
- data/lib/rubygems/{tsort → vendor/tsort}/lib/tsort.rb +2 -2
- data/lib/rubygems/vendor/uri/COPYING +56 -0
- data/lib/rubygems/vendor/uri/lib/uri/common.rb +880 -0
- data/lib/rubygems/vendor/uri/lib/uri/file.rb +100 -0
- data/lib/rubygems/vendor/uri/lib/uri/ftp.rb +267 -0
- data/lib/rubygems/vendor/uri/lib/uri/generic.rb +1579 -0
- data/lib/rubygems/vendor/uri/lib/uri/http.rb +125 -0
- data/lib/rubygems/vendor/uri/lib/uri/https.rb +23 -0
- data/lib/rubygems/vendor/uri/lib/uri/ldap.rb +261 -0
- data/lib/rubygems/vendor/uri/lib/uri/ldaps.rb +22 -0
- data/lib/rubygems/vendor/uri/lib/uri/mailto.rb +293 -0
- data/lib/rubygems/vendor/uri/lib/uri/rfc2396_parser.rb +546 -0
- data/lib/rubygems/vendor/uri/lib/uri/rfc3986_parser.rb +206 -0
- data/lib/rubygems/vendor/uri/lib/uri/version.rb +6 -0
- data/lib/rubygems/vendor/uri/lib/uri/ws.rb +83 -0
- data/lib/rubygems/vendor/uri/lib/uri/wss.rb +23 -0
- data/lib/rubygems/vendor/uri/lib/uri.rb +104 -0
- data/lib/rubygems/vendored_molinillo.rb +3 -0
- data/lib/rubygems/vendored_net_http.rb +5 -0
- data/lib/rubygems/vendored_optparse.rb +3 -0
- data/lib/rubygems/vendored_securerandom.rb +3 -0
- data/lib/rubygems/vendored_timeout.rb +5 -0
- data/lib/rubygems/vendored_tsort.rb +3 -0
- data/lib/rubygems/version.rb +26 -9
- data/lib/rubygems/yaml_serializer.rb +12 -7
- data/lib/rubygems.rb +160 -53
- data/rubygems-update.gemspec +11 -6
- data/setup.rb +1 -1
- metadata +124 -96
- data/bundler/lib/bundler/compact_index_client/gem_parser.rb +0 -32
- data/bundler/lib/bundler/gem_helpers.rb +0 -127
- data/bundler/lib/bundler/templates/Executable.bundler +0 -109
- data/bundler/lib/bundler/vendor/fileutils/.document +0 -1
- data/bundler/lib/bundler/vendor/net-http-persistent/.document +0 -1
- data/bundler/lib/bundler/vendor/pub_grub/.document +0 -1
- data/bundler/lib/bundler/vendor/thor/.document +0 -1
- data/bundler/lib/bundler/vendor/tsort/.document +0 -1
- data/bundler/lib/bundler/vendor/uri/.document +0 -1
- data/lib/rubygems/net/http.rb +0 -3
- data/lib/rubygems/net-http/.document +0 -1
- data/lib/rubygems/net-http/LICENSE.txt +0 -22
- data/lib/rubygems/net-http/lib/net/http/backward.rb +0 -40
- data/lib/rubygems/net-protocol/.document +0 -1
- data/lib/rubygems/net-protocol/LICENSE.txt +0 -22
- data/lib/rubygems/optparse/.document +0 -1
- data/lib/rubygems/optparse/lib/optparse/uri.rb +0 -7
- data/lib/rubygems/optparse.rb +0 -3
- data/lib/rubygems/resolv/.document +0 -1
- data/lib/rubygems/resolv/LICENSE.txt +0 -22
- data/lib/rubygems/resolver/molinillo/.document +0 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/resolution_state.rb +0 -57
- data/lib/rubygems/resolver/molinillo/lib/molinillo/gem_metadata.rb +0 -6
- data/lib/rubygems/resolver/molinillo.rb +0 -3
- data/lib/rubygems/shellwords.rb +0 -3
- data/lib/rubygems/ssl_certs/rubygems.org/GlobalSignRootCA.pem +0 -21
- data/lib/rubygems/timeout/.document +0 -1
- data/lib/rubygems/timeout/LICENSE.txt +0 -22
- data/lib/rubygems/timeout.rb +0 -3
- data/lib/rubygems/tsort/.document +0 -1
- data/lib/rubygems/tsort/LICENSE.txt +0 -22
- data/lib/rubygems/tsort.rb +0 -3
- /data/{lib/rubygems/optparse → bundler/lib/bundler/vendor/fileutils}/COPYING +0 -0
- /data/{MAINTAINERS.txt → doc/MAINTAINERS.txt} +0 -0
- /data/{UPGRADING.md → doc/rubygems/UPGRADING.md} +0 -0
- /data/lib/rubygems/ssl_certs/rubygems.org/{GlobalSignRootCA_R3.pem → GlobalSign.pem} +0 -0
- /data/{bundler/lib/bundler/vendor/connection_pool → lib/rubygems/vendor}/.document +0 -0
- /data/lib/rubygems/{resolver → vendor}/molinillo/LICENSE +0 -0
- /data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/exceptions.rb +0 -0
- /data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/proxy_delta.rb +0 -0
- /data/{bundler/lib/bundler/vendor/fileutils → lib/rubygems/vendor/net-protocol}/LICENSE.txt +0 -0
- /data/lib/rubygems/{net-protocol → vendor/net-protocol}/lib/net/protocol.rb +0 -0
- /data/lib/rubygems/{optparse → vendor/optparse}/lib/optionparser.rb +0 -0
- /data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse/date.rb +0 -0
- /data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse/shellwords.rb +0 -0
- /data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse/time.rb +0 -0
- /data/{bundler/lib/bundler/vendor/uri → lib/rubygems/vendor/tsort}/LICENSE.txt +0 -0
@@ -32,6 +32,20 @@ module Bundler
|
|
32
32
|
@local = false
|
33
33
|
end
|
34
34
|
|
35
|
+
def remote!
|
36
|
+
return if @allow_remote
|
37
|
+
|
38
|
+
@local_specs = nil
|
39
|
+
@allow_remote = true
|
40
|
+
end
|
41
|
+
|
42
|
+
def cached!
|
43
|
+
return if @allow_cached
|
44
|
+
|
45
|
+
@local_specs = nil
|
46
|
+
@allow_cached = true
|
47
|
+
end
|
48
|
+
|
35
49
|
def self.from_lock(options)
|
36
50
|
new(options.merge("uri" => options.delete("remote")))
|
37
51
|
end
|
@@ -56,13 +70,13 @@ module Bundler
|
|
56
70
|
end
|
57
71
|
|
58
72
|
def hash
|
59
|
-
[self.class, uri, ref, branch, name,
|
73
|
+
[self.class, uri, ref, branch, name, glob, submodules].hash
|
60
74
|
end
|
61
75
|
|
62
76
|
def eql?(other)
|
63
77
|
other.is_a?(Git) && uri == other.uri && ref == other.ref &&
|
64
78
|
branch == other.branch && name == other.name &&
|
65
|
-
|
79
|
+
glob == other.glob &&
|
66
80
|
submodules == other.submodules
|
67
81
|
end
|
68
82
|
|
@@ -88,7 +102,7 @@ module Bundler
|
|
88
102
|
end
|
89
103
|
|
90
104
|
def identifier
|
91
|
-
uri_with_specifiers([humanized_ref,
|
105
|
+
uri_with_specifiers([humanized_ref, locked_revision, glob_for_display])
|
92
106
|
end
|
93
107
|
|
94
108
|
def uri_with_specifiers(specifiers)
|
@@ -150,7 +164,8 @@ module Bundler
|
|
150
164
|
"does not exist. Run `bundle config unset local.#{override_for(original_path)}` to remove the local override"
|
151
165
|
end
|
152
166
|
|
153
|
-
|
167
|
+
@local = true
|
168
|
+
set_paths!(path)
|
154
169
|
|
155
170
|
# Create a new git proxy without the cached revision
|
156
171
|
# so the Gemfile.lock always picks up the new revision.
|
@@ -161,10 +176,10 @@ module Bundler
|
|
161
176
|
"#{current_branch} but Gemfile specifies #{branch}"
|
162
177
|
end
|
163
178
|
|
164
|
-
changed =
|
179
|
+
changed = locked_revision && locked_revision != revision
|
165
180
|
|
166
|
-
if !Bundler.settings[:disable_local_revision_check] && changed && !@unlocked && !git_proxy.contains?(
|
167
|
-
raise GitError, "The Gemfile lock is pointing to revision #{shortref_for_display(
|
181
|
+
if !Bundler.settings[:disable_local_revision_check] && changed && !@unlocked && !git_proxy.contains?(locked_revision)
|
182
|
+
raise GitError, "The Gemfile lock is pointing to revision #{shortref_for_display(locked_revision)} " \
|
168
183
|
"but the current branch in your local override for #{name} does not contain such commit. " \
|
169
184
|
"Please make sure your branch is up to date."
|
170
185
|
end
|
@@ -173,13 +188,11 @@ module Bundler
|
|
173
188
|
end
|
174
189
|
|
175
190
|
def specs(*)
|
176
|
-
|
191
|
+
set_cache_path!(app_cache_path) if use_app_cache?
|
177
192
|
|
178
193
|
if requires_checkout? && !@copied
|
179
|
-
fetch
|
180
|
-
|
181
|
-
serialize_gemspecs_in(install_path)
|
182
|
-
@copied = true
|
194
|
+
fetch unless use_app_cache?
|
195
|
+
checkout
|
183
196
|
end
|
184
197
|
|
185
198
|
local_specs
|
@@ -192,27 +205,25 @@ module Bundler
|
|
192
205
|
print_using_message "Using #{version_message(spec, options[:previous_spec])} from #{self}"
|
193
206
|
|
194
207
|
if (requires_checkout? && !@copied) || force
|
195
|
-
|
196
|
-
git_proxy.copy_to(install_path, submodules)
|
197
|
-
serialize_gemspecs_in(install_path)
|
198
|
-
@copied = true
|
208
|
+
checkout
|
199
209
|
end
|
200
210
|
|
201
|
-
generate_bin_options = { disable_extensions: !
|
211
|
+
generate_bin_options = { disable_extensions: !spec.missing_extensions?, build_args: options[:build_args] }
|
202
212
|
generate_bin(spec, generate_bin_options)
|
203
213
|
|
204
214
|
requires_checkout? ? spec.post_install_message : nil
|
205
215
|
end
|
206
216
|
|
217
|
+
def migrate_cache(custom_path = nil, local: false)
|
218
|
+
if local
|
219
|
+
cache_to(custom_path, try_migrate: false)
|
220
|
+
else
|
221
|
+
cache_to(custom_path, try_migrate: true)
|
222
|
+
end
|
223
|
+
end
|
224
|
+
|
207
225
|
def cache(spec, custom_path = nil)
|
208
|
-
|
209
|
-
return unless Bundler.feature_flag.cache_all?
|
210
|
-
return if path == app_cache_path
|
211
|
-
cached!
|
212
|
-
FileUtils.rm_rf(app_cache_path)
|
213
|
-
git_proxy.checkout if requires_checkout?
|
214
|
-
git_proxy.copy_to(app_cache_path, @submodules)
|
215
|
-
serialize_gemspecs_in(app_cache_path)
|
226
|
+
cache_to(custom_path, try_migrate: false)
|
216
227
|
end
|
217
228
|
|
218
229
|
def load_spec_files
|
@@ -235,7 +246,7 @@ module Bundler
|
|
235
246
|
end
|
236
247
|
|
237
248
|
def app_cache_dirname
|
238
|
-
"#{base_name}-#{shortref_for_path(
|
249
|
+
"#{base_name}-#{shortref_for_path(locked_revision || revision)}"
|
239
250
|
end
|
240
251
|
|
241
252
|
def revision
|
@@ -256,6 +267,43 @@ module Bundler
|
|
256
267
|
|
257
268
|
private
|
258
269
|
|
270
|
+
def cache_to(custom_path, try_migrate: false)
|
271
|
+
return unless Bundler.feature_flag.cache_all?
|
272
|
+
|
273
|
+
app_cache_path = app_cache_path(custom_path)
|
274
|
+
|
275
|
+
migrate = try_migrate ? bare_repo?(app_cache_path) : false
|
276
|
+
|
277
|
+
set_cache_path!(nil) if migrate
|
278
|
+
|
279
|
+
return if cache_path == app_cache_path
|
280
|
+
|
281
|
+
cached!
|
282
|
+
FileUtils.rm_rf(app_cache_path)
|
283
|
+
git_proxy.checkout if migrate || requires_checkout?
|
284
|
+
git_proxy.copy_to(app_cache_path, @submodules)
|
285
|
+
serialize_gemspecs_in(app_cache_path)
|
286
|
+
end
|
287
|
+
|
288
|
+
def checkout
|
289
|
+
Bundler.ui.debug " * Checking out revision: #{ref}"
|
290
|
+
if use_app_cache? && !bare_repo?(app_cache_path)
|
291
|
+
SharedHelpers.filesystem_access(install_path.dirname) do |p|
|
292
|
+
FileUtils.mkdir_p(p)
|
293
|
+
end
|
294
|
+
FileUtils.cp_r("#{app_cache_path}/.", install_path)
|
295
|
+
else
|
296
|
+
if use_app_cache? && bare_repo?(app_cache_path)
|
297
|
+
Bundler.ui.warn "Installing from cache in old \"bare repository\" format for compatibility. " \
|
298
|
+
"Please run `bundle cache` and commit the updated cache to migrate to the new format and get rid of this warning."
|
299
|
+
end
|
300
|
+
|
301
|
+
git_proxy.copy_to(install_path, submodules)
|
302
|
+
end
|
303
|
+
serialize_gemspecs_in(install_path)
|
304
|
+
@copied = true
|
305
|
+
end
|
306
|
+
|
259
307
|
def humanized_ref
|
260
308
|
if local?
|
261
309
|
path
|
@@ -278,28 +326,45 @@ module Bundler
|
|
278
326
|
# The gemspecs we cache should already be evaluated.
|
279
327
|
spec = Bundler.load_gemspec(spec_path)
|
280
328
|
next unless spec
|
281
|
-
|
329
|
+
spec.installed_by_version = Gem::VERSION
|
282
330
|
Bundler.rubygems.validate(spec)
|
283
331
|
File.open(spec_path, "wb") {|file| file.write(spec.to_ruby) }
|
284
332
|
end
|
285
333
|
end
|
286
334
|
|
287
|
-
def
|
288
|
-
|
289
|
-
|
290
|
-
|
335
|
+
def set_paths!(path)
|
336
|
+
set_cache_path!(path)
|
337
|
+
set_install_path!(path)
|
338
|
+
end
|
339
|
+
|
340
|
+
def set_cache_path!(path)
|
341
|
+
@git_proxy = nil
|
342
|
+
@cache_path = path
|
343
|
+
end
|
344
|
+
|
345
|
+
def set_install_path!(path)
|
346
|
+
@local_specs = nil
|
347
|
+
@install_path = path
|
291
348
|
end
|
292
349
|
|
293
350
|
def has_app_cache?
|
294
|
-
|
351
|
+
locked_revision && super
|
352
|
+
end
|
353
|
+
|
354
|
+
def use_app_cache?
|
355
|
+
has_app_cache? && !local?
|
295
356
|
end
|
296
357
|
|
297
358
|
def requires_checkout?
|
298
|
-
allow_git_ops? && !local? && !
|
359
|
+
allow_git_ops? && !local? && !locked_revision_checked_out?
|
360
|
+
end
|
361
|
+
|
362
|
+
def locked_revision_checked_out?
|
363
|
+
locked_revision && locked_revision == revision && installed?
|
299
364
|
end
|
300
365
|
|
301
|
-
def
|
302
|
-
|
366
|
+
def installed?
|
367
|
+
git_proxy.installed_to?(install_path)
|
303
368
|
end
|
304
369
|
|
305
370
|
def base_name
|
@@ -326,7 +391,7 @@ module Bundler
|
|
326
391
|
if %r{^\w+://(\w+@)?}.match?(uri)
|
327
392
|
# Downcase the domain component of the URI
|
328
393
|
# and strip off a trailing slash, if one is present
|
329
|
-
input =
|
394
|
+
input = Gem::URI.parse(uri).normalize.to_s.sub(%r{/$}, "")
|
330
395
|
else
|
331
396
|
# If there is no URI scheme, assume it is an ssh/git URI
|
332
397
|
input = uri
|
@@ -336,7 +401,7 @@ module Bundler
|
|
336
401
|
Bundler::Digest.sha1(input)
|
337
402
|
end
|
338
403
|
|
339
|
-
def
|
404
|
+
def locked_revision
|
340
405
|
options["revision"]
|
341
406
|
end
|
342
407
|
|
@@ -345,7 +410,7 @@ module Bundler
|
|
345
410
|
end
|
346
411
|
|
347
412
|
def git_proxy
|
348
|
-
@git_proxy ||= GitProxy.new(cache_path, uri, options,
|
413
|
+
@git_proxy ||= GitProxy.new(cache_path, uri, options, locked_revision, self)
|
349
414
|
end
|
350
415
|
|
351
416
|
def fetch
|
@@ -359,9 +424,12 @@ module Bundler
|
|
359
424
|
def validate_spec(_spec); end
|
360
425
|
|
361
426
|
def load_gemspec(file)
|
362
|
-
|
363
|
-
|
364
|
-
|
427
|
+
dirname = Pathname.new(file).dirname
|
428
|
+
SharedHelpers.chdir(dirname.to_s) do
|
429
|
+
stub = Gem::StubSpecification.gemspec_stub(file, install_path.parent, install_path.parent)
|
430
|
+
stub.full_gem_path = dirname.expand_path(root).to_s
|
431
|
+
StubSpecification.from_stub(stub)
|
432
|
+
end
|
365
433
|
end
|
366
434
|
|
367
435
|
def git_scope
|
@@ -375,6 +443,10 @@ module Bundler
|
|
375
443
|
def override_for(path)
|
376
444
|
Bundler.settings.local_overrides.key(path)
|
377
445
|
end
|
446
|
+
|
447
|
+
def bare_repo?(path)
|
448
|
+
File.exist?(path.join("objects")) && File.exist?(path.join("HEAD"))
|
449
|
+
end
|
378
450
|
end
|
379
451
|
end
|
380
452
|
end
|
@@ -11,6 +11,8 @@ module Bundler
|
|
11
11
|
end
|
12
12
|
|
13
13
|
if local_spec = Gem.loaded_specs["bundler"]
|
14
|
+
raise CorruptBundlerInstallError.new(local_spec) if local_spec.version.to_s != Bundler::VERSION
|
15
|
+
|
14
16
|
idx << local_spec
|
15
17
|
else
|
16
18
|
idx << Gem::Specification.new do |s|
|
@@ -22,9 +24,8 @@ module Bundler
|
|
22
24
|
s.bindir = "exe"
|
23
25
|
s.homepage = "https://bundler.io"
|
24
26
|
s.summary = "The best way to manage your application's dependencies"
|
25
|
-
s.executables = %w[bundle]
|
26
|
-
|
27
|
-
s.loaded_from = __dir__
|
27
|
+
s.executables = %w[bundle bundler]
|
28
|
+
s.loaded_from = SharedHelpers.gemspec_path
|
28
29
|
end
|
29
30
|
end
|
30
31
|
|
@@ -18,9 +18,6 @@ module Bundler
|
|
18
18
|
@options = options.dup
|
19
19
|
@glob = options["glob"] || DEFAULT_GLOB
|
20
20
|
|
21
|
-
@allow_cached = false
|
22
|
-
@allow_remote = false
|
23
|
-
|
24
21
|
@root_path = options["root_path"] || root
|
25
22
|
|
26
23
|
if options["path"]
|
@@ -41,16 +38,6 @@ module Bundler
|
|
41
38
|
@original_path = @path
|
42
39
|
end
|
43
40
|
|
44
|
-
def remote!
|
45
|
-
@local_specs = nil
|
46
|
-
@allow_remote = true
|
47
|
-
end
|
48
|
-
|
49
|
-
def cached!
|
50
|
-
@local_specs = nil
|
51
|
-
@allow_cached = true
|
52
|
-
end
|
53
|
-
|
54
41
|
def self.from_lock(options)
|
55
42
|
new(options.merge("path" => options.delete("remote")))
|
56
43
|
end
|
@@ -66,13 +53,15 @@ module Bundler
|
|
66
53
|
"source at `#{@path}`"
|
67
54
|
end
|
68
55
|
|
56
|
+
alias_method :to_gemfile, :path
|
57
|
+
|
69
58
|
def hash
|
70
59
|
[self.class, expanded_path, version].hash
|
71
60
|
end
|
72
61
|
|
73
62
|
def eql?(other)
|
74
|
-
|
75
|
-
|
63
|
+
[Gemspec, Path].include?(other.class) &&
|
64
|
+
expanded_original_path == other.expanded_original_path &&
|
76
65
|
version == other.version
|
77
66
|
end
|
78
67
|
|
@@ -161,7 +150,7 @@ module Bundler
|
|
161
150
|
|
162
151
|
def load_gemspec(file)
|
163
152
|
return unless spec = Bundler.load_gemspec(file)
|
164
|
-
|
153
|
+
spec.installed_by_version = Gem::VERSION
|
165
154
|
spec
|
166
155
|
end
|
167
156
|
|
@@ -178,6 +167,13 @@ module Bundler
|
|
178
167
|
next unless spec = load_gemspec(file)
|
179
168
|
spec.source = self
|
180
169
|
|
170
|
+
# The ignore attribute is for ignoring installed gems that don't
|
171
|
+
# have extensions correctly compiled for activation. In the case of
|
172
|
+
# path sources, there's a single version of each gem in the path
|
173
|
+
# source available to Bundler, so we always certainly want to
|
174
|
+
# consider that for activation and never makes sense to ignore it.
|
175
|
+
spec.ignored = false
|
176
|
+
|
181
177
|
# Validation causes extension_dir to be calculated, which depends
|
182
178
|
# on #source, so we validate here instead of load_gemspec
|
183
179
|
validate_spec(spec)
|
@@ -225,7 +221,7 @@ module Bundler
|
|
225
221
|
|
226
222
|
# Some gem authors put absolute paths in their gemspec
|
227
223
|
# and we have to save them from themselves
|
228
|
-
spec.files = spec.files.
|
224
|
+
spec.files = spec.files.filter_map do |path|
|
229
225
|
next path unless /\A#{Pathname::SEPARATOR_PAT}/o.match?(path)
|
230
226
|
next if File.directory?(path)
|
231
227
|
begin
|
@@ -233,7 +229,7 @@ module Bundler
|
|
233
229
|
rescue ArgumentError
|
234
230
|
path
|
235
231
|
end
|
236
|
-
end
|
232
|
+
end
|
237
233
|
|
238
234
|
installer = Path::Installer.new(
|
239
235
|
spec,
|
@@ -16,6 +16,9 @@ module Bundler
|
|
16
16
|
@anonymized_uri = remove_auth(@uri).freeze
|
17
17
|
end
|
18
18
|
|
19
|
+
MAX_CACHE_SLUG_HOST_SIZE = 255 - 1 - 32 # 255 minus dot minus MD5 length
|
20
|
+
private_constant :MAX_CACHE_SLUG_HOST_SIZE
|
21
|
+
|
19
22
|
# @return [String] A slug suitable for use as a cache key for this
|
20
23
|
# remote.
|
21
24
|
#
|
@@ -28,10 +31,15 @@ module Bundler
|
|
28
31
|
host = cache_uri.to_s.start_with?("file://") ? nil : cache_uri.host
|
29
32
|
|
30
33
|
uri_parts = [host, cache_uri.user, cache_uri.port, cache_uri.path]
|
31
|
-
|
34
|
+
uri_parts.compact!
|
35
|
+
uri_digest = SharedHelpers.digest(:MD5).hexdigest(uri_parts.join("."))
|
36
|
+
|
37
|
+
uri_parts.pop
|
38
|
+
host_parts = uri_parts.join(".")
|
39
|
+
return uri_digest if host_parts.empty?
|
32
40
|
|
33
|
-
|
34
|
-
|
41
|
+
shortened_host_parts = host_parts[0...MAX_CACHE_SLUG_HOST_SIZE]
|
42
|
+
[shortened_host_parts, uri_digest].join(".")
|
35
43
|
end
|
36
44
|
end
|
37
45
|
|
@@ -48,7 +56,7 @@ module Bundler
|
|
48
56
|
end
|
49
57
|
|
50
58
|
uri
|
51
|
-
rescue
|
59
|
+
rescue Gem::URI::InvalidComponentError
|
52
60
|
error_message = "Please CGI escape your usernames and passwords before " \
|
53
61
|
"setting them for authentication."
|
54
62
|
raise HTTPError.new(error_message)
|
@@ -10,7 +10,7 @@ module Bundler
|
|
10
10
|
# Ask for X gems per API request
|
11
11
|
API_REQUEST_SIZE = 50
|
12
12
|
|
13
|
-
|
13
|
+
attr_accessor :remotes
|
14
14
|
|
15
15
|
def initialize(options = {})
|
16
16
|
@options = options
|
@@ -19,15 +19,22 @@ module Bundler
|
|
19
19
|
@allow_remote = false
|
20
20
|
@allow_cached = false
|
21
21
|
@allow_local = options["allow_local"] || false
|
22
|
+
@prefer_local = false
|
22
23
|
@checksum_store = Checksum::Store.new
|
23
24
|
|
24
25
|
Array(options["remotes"]).reverse_each {|r| add_remote(r) }
|
26
|
+
|
27
|
+
@lockfile_remotes = @remotes if options["from_lockfile"]
|
25
28
|
end
|
26
29
|
|
27
30
|
def caches
|
28
31
|
@caches ||= [cache_path, *Bundler.rubygems.gem_cache]
|
29
32
|
end
|
30
33
|
|
34
|
+
def prefer_local!
|
35
|
+
@prefer_local = true
|
36
|
+
end
|
37
|
+
|
31
38
|
def local_only!
|
32
39
|
@specs = nil
|
33
40
|
@allow_local = true
|
@@ -35,6 +42,10 @@ module Bundler
|
|
35
42
|
@allow_remote = false
|
36
43
|
end
|
37
44
|
|
45
|
+
def local_only?
|
46
|
+
@allow_local && !@allow_remote
|
47
|
+
end
|
48
|
+
|
38
49
|
def local!
|
39
50
|
return if @allow_local
|
40
51
|
|
@@ -50,10 +61,11 @@ module Bundler
|
|
50
61
|
end
|
51
62
|
|
52
63
|
def cached!
|
64
|
+
return unless File.exist?(cache_path)
|
65
|
+
|
53
66
|
return if @allow_cached
|
54
67
|
|
55
68
|
@specs = nil
|
56
|
-
@allow_local = true
|
57
69
|
@allow_cached = true
|
58
70
|
end
|
59
71
|
|
@@ -90,13 +102,13 @@ module Bundler
|
|
90
102
|
|
91
103
|
def self.from_lock(options)
|
92
104
|
options["remotes"] = Array(options.delete("remote")).reverse
|
93
|
-
new(options)
|
105
|
+
new(options.merge("from_lockfile" => true))
|
94
106
|
end
|
95
107
|
|
96
108
|
def to_lock
|
97
109
|
out = String.new("GEM\n")
|
98
|
-
|
99
|
-
out << " remote: #{
|
110
|
+
lockfile_remotes.reverse_each do |remote|
|
111
|
+
out << " remote: #{remote}\n"
|
100
112
|
end
|
101
113
|
out << " specs:\n"
|
102
114
|
end
|
@@ -133,22 +145,25 @@ module Bundler
|
|
133
145
|
# sources, and large_idx.merge! small_idx is way faster than
|
134
146
|
# small_idx.merge! large_idx.
|
135
147
|
index = @allow_remote ? remote_specs.dup : Index.new
|
136
|
-
index.merge!(cached_specs) if @allow_cached
|
148
|
+
index.merge!(cached_specs) if @allow_cached
|
137
149
|
index.merge!(installed_specs) if @allow_local
|
150
|
+
|
151
|
+
if @allow_local
|
152
|
+
if @prefer_local
|
153
|
+
index.merge!(default_specs)
|
154
|
+
else
|
155
|
+
# complete with default specs, only if not already available in the
|
156
|
+
# index through remote, cached, or installed specs
|
157
|
+
index.use(default_specs)
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
138
161
|
index
|
139
162
|
end
|
140
163
|
end
|
141
164
|
|
142
165
|
def install(spec, options = {})
|
143
|
-
|
144
|
-
ensure_builtin_gems_cached = options[:ensure_builtin_gems_cached]
|
145
|
-
|
146
|
-
if ensure_builtin_gems_cached && spec.default_gem? && !cached_path(spec)
|
147
|
-
cached_built_in_gem(spec) unless spec.remote
|
148
|
-
force = true
|
149
|
-
end
|
150
|
-
|
151
|
-
if installed?(spec) && !force
|
166
|
+
if (spec.default_gem? && !cached_built_in_gem(spec, local: options[:local])) || (installed?(spec) && !options[:force])
|
152
167
|
print_using_message "Using #{version_message(spec, options[:previous_spec])}"
|
153
168
|
return nil # no post-install message
|
154
169
|
end
|
@@ -206,6 +221,7 @@ module Bundler
|
|
206
221
|
|
207
222
|
spec.full_gem_path = installed_spec.full_gem_path
|
208
223
|
spec.loaded_from = installed_spec.loaded_from
|
224
|
+
spec.base_dir = installed_spec.base_dir
|
209
225
|
|
210
226
|
spec.post_install_message
|
211
227
|
end
|
@@ -221,12 +237,13 @@ module Bundler
|
|
221
237
|
raise InstallError, e.message
|
222
238
|
end
|
223
239
|
|
224
|
-
def cached_built_in_gem(spec)
|
225
|
-
cached_path =
|
226
|
-
if cached_path.nil?
|
240
|
+
def cached_built_in_gem(spec, local: false)
|
241
|
+
cached_path = cached_gem(spec)
|
242
|
+
if cached_path.nil? && !local
|
227
243
|
remote_spec = remote_specs.search(spec).first
|
228
244
|
if remote_spec
|
229
245
|
cached_path = fetch_gem(remote_spec)
|
246
|
+
spec.remote = remote_spec.remote
|
230
247
|
else
|
231
248
|
Bundler.ui.warn "#{spec.full_name} is built in to Ruby, and can't be cached because your Gemfile doesn't have any sources that contain it."
|
232
249
|
end
|
@@ -312,11 +329,7 @@ module Bundler
|
|
312
329
|
end
|
313
330
|
|
314
331
|
def credless_remotes
|
315
|
-
|
316
|
-
remotes.map(&method(:remove_auth))
|
317
|
-
else
|
318
|
-
remotes.map(&method(:suppress_configured_credentials))
|
319
|
-
end
|
332
|
+
remotes.map(&method(:remove_auth))
|
320
333
|
end
|
321
334
|
|
322
335
|
def remotes_for_spec(spec)
|
@@ -327,14 +340,6 @@ module Bundler
|
|
327
340
|
end
|
328
341
|
|
329
342
|
def cached_gem(spec)
|
330
|
-
if spec.default_gem?
|
331
|
-
cached_built_in_gem(spec)
|
332
|
-
else
|
333
|
-
cached_path(spec)
|
334
|
-
end
|
335
|
-
end
|
336
|
-
|
337
|
-
def cached_path(spec)
|
338
343
|
global_cache_path = download_cache_path(spec)
|
339
344
|
caches << global_cache_path if global_cache_path
|
340
345
|
|
@@ -349,21 +354,12 @@ module Bundler
|
|
349
354
|
def normalize_uri(uri)
|
350
355
|
uri = URINormalizer.normalize_suffix(uri.to_s)
|
351
356
|
require_relative "../vendored_uri"
|
352
|
-
uri =
|
357
|
+
uri = Gem::URI(uri)
|
353
358
|
raise ArgumentError, "The source must be an absolute URI. For example:\n" \
|
354
|
-
"source 'https://rubygems.org'" if !uri.absolute? || (uri.is_a?(
|
359
|
+
"source 'https://rubygems.org'" if !uri.absolute? || (uri.is_a?(Gem::URI::HTTP) && uri.host.nil?)
|
355
360
|
uri
|
356
361
|
end
|
357
362
|
|
358
|
-
def suppress_configured_credentials(remote)
|
359
|
-
remote_nouser = remove_auth(remote)
|
360
|
-
if remote.userinfo && remote.userinfo == Bundler.settings[remote_nouser]
|
361
|
-
remote_nouser
|
362
|
-
else
|
363
|
-
remote
|
364
|
-
end
|
365
|
-
end
|
366
|
-
|
367
363
|
def remove_auth(remote)
|
368
364
|
if remote.user || remote.password
|
369
365
|
remote.dup.tap {|uri| uri.user = uri.password = nil }.to_s
|
@@ -374,12 +370,18 @@ module Bundler
|
|
374
370
|
|
375
371
|
def installed_specs
|
376
372
|
@installed_specs ||= Index.build do |idx|
|
377
|
-
Bundler.rubygems.
|
373
|
+
Bundler.rubygems.installed_specs.reverse_each do |spec|
|
374
|
+
spec.source = self
|
375
|
+
next if spec.ignored?
|
376
|
+
idx << spec
|
377
|
+
end
|
378
|
+
end
|
379
|
+
end
|
380
|
+
|
381
|
+
def default_specs
|
382
|
+
@default_specs ||= Index.build do |idx|
|
383
|
+
Bundler.rubygems.default_specs.each do |spec|
|
378
384
|
spec.source = self
|
379
|
-
if Bundler.rubygems.spec_missing_extensions?(spec, false)
|
380
|
-
Bundler.ui.debug "Source #{self} is ignoring #{spec} because it is missing extensions"
|
381
|
-
next
|
382
|
-
end
|
383
385
|
idx << spec
|
384
386
|
end
|
385
387
|
end
|
@@ -452,7 +454,7 @@ module Bundler
|
|
452
454
|
end
|
453
455
|
|
454
456
|
def installed?(spec)
|
455
|
-
installed_specs[spec].any? && !spec.
|
457
|
+
installed_specs[spec].any? && !spec.installation_missing?
|
456
458
|
end
|
457
459
|
|
458
460
|
def rubygems_dir
|
@@ -469,6 +471,10 @@ module Bundler
|
|
469
471
|
|
470
472
|
private
|
471
473
|
|
474
|
+
def lockfile_remotes
|
475
|
+
@lockfile_remotes || credless_remotes
|
476
|
+
end
|
477
|
+
|
472
478
|
# Checks if the requested spec exists in the global cache. If it does,
|
473
479
|
# we copy it to the download path, and if it does not, we download it.
|
474
480
|
#
|