rubygems-update 2.6.1 → 3.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +5899 -0
- data/CODE_OF_CONDUCT.md +76 -35
- data/CONTRIBUTING.md +231 -0
- data/MAINTAINERS.txt +8 -0
- data/Manifest.txt +428 -216
- data/POLICIES.md +135 -0
- data/README.md +112 -0
- data/UPGRADING.md +15 -0
- data/bundler/CHANGELOG.md +4719 -0
- data/bundler/LICENSE.md +22 -0
- data/bundler/README.md +58 -0
- data/bundler/UPGRADING.md +222 -0
- data/bundler/bundler.gemspec +46 -0
- data/bundler/exe/bundle +29 -0
- data/bundler/exe/bundler +4 -0
- data/bundler/lib/bundler/.document +1 -0
- data/bundler/lib/bundler/build_metadata.rb +45 -0
- data/bundler/lib/bundler/capistrano.rb +22 -0
- data/bundler/lib/bundler/checksum.rb +245 -0
- data/bundler/lib/bundler/ci_detector.rb +75 -0
- data/bundler/lib/bundler/cli/add.rb +47 -0
- data/bundler/lib/bundler/cli/binstubs.rb +57 -0
- data/bundler/lib/bundler/cli/cache.rb +43 -0
- data/bundler/lib/bundler/cli/check.rb +40 -0
- data/bundler/lib/bundler/cli/clean.rb +25 -0
- data/bundler/lib/bundler/cli/common.rb +138 -0
- data/bundler/lib/bundler/cli/config.rb +204 -0
- data/bundler/lib/bundler/cli/console.rb +44 -0
- data/bundler/lib/bundler/cli/doctor.rb +157 -0
- data/bundler/lib/bundler/cli/exec.rb +88 -0
- data/bundler/lib/bundler/cli/fund.rb +36 -0
- data/bundler/lib/bundler/cli/gem.rb +471 -0
- data/bundler/lib/bundler/cli/info.rb +83 -0
- data/bundler/lib/bundler/cli/init.rb +51 -0
- data/bundler/lib/bundler/cli/inject.rb +60 -0
- data/bundler/lib/bundler/cli/install.rb +190 -0
- data/bundler/lib/bundler/cli/issue.rb +41 -0
- data/bundler/lib/bundler/cli/list.rb +66 -0
- data/bundler/lib/bundler/cli/lock.rb +73 -0
- data/bundler/lib/bundler/cli/open.rb +29 -0
- data/bundler/lib/bundler/cli/outdated.rb +297 -0
- data/bundler/lib/bundler/cli/platform.rb +48 -0
- data/bundler/lib/bundler/cli/plugin.rb +34 -0
- data/bundler/lib/bundler/cli/pristine.rb +60 -0
- data/bundler/lib/bundler/cli/remove.rb +17 -0
- data/bundler/lib/bundler/cli/show.rb +75 -0
- data/bundler/lib/bundler/cli/update.rb +123 -0
- data/bundler/lib/bundler/cli/viz.rb +31 -0
- data/bundler/lib/bundler/cli.rb +846 -0
- data/bundler/lib/bundler/compact_index_client/cache.rb +121 -0
- data/bundler/lib/bundler/compact_index_client/cache_file.rb +153 -0
- data/bundler/lib/bundler/compact_index_client/gem_parser.rb +32 -0
- data/bundler/lib/bundler/compact_index_client/updater.rb +115 -0
- data/bundler/lib/bundler/compact_index_client.rb +126 -0
- data/bundler/lib/bundler/constants.rb +7 -0
- data/bundler/lib/bundler/current_ruby.rb +92 -0
- data/bundler/lib/bundler/definition.rb +1005 -0
- data/bundler/lib/bundler/dependency.rb +101 -0
- data/bundler/lib/bundler/deployment.rb +69 -0
- data/bundler/lib/bundler/deprecate.rb +44 -0
- data/bundler/lib/bundler/digest.rb +71 -0
- data/bundler/lib/bundler/dsl.rb +601 -0
- data/bundler/lib/bundler/endpoint_specification.rb +147 -0
- data/bundler/lib/bundler/env.rb +148 -0
- data/bundler/lib/bundler/environment_preserver.rb +86 -0
- data/bundler/lib/bundler/errors.rb +233 -0
- data/bundler/lib/bundler/feature_flag.rb +53 -0
- data/bundler/lib/bundler/fetcher/base.rb +52 -0
- data/bundler/lib/bundler/fetcher/compact_index.rb +129 -0
- data/bundler/lib/bundler/fetcher/dependency.rb +78 -0
- data/bundler/lib/bundler/fetcher/downloader.rb +91 -0
- data/bundler/lib/bundler/fetcher/gem_remote_fetcher.rb +16 -0
- data/bundler/lib/bundler/fetcher/index.rb +25 -0
- data/bundler/lib/bundler/fetcher.rb +324 -0
- data/bundler/lib/bundler/force_platform.rb +18 -0
- data/bundler/lib/bundler/friendly_errors.rb +126 -0
- data/bundler/lib/bundler/gem_helper.rb +237 -0
- data/bundler/lib/bundler/gem_helpers.rb +127 -0
- data/bundler/lib/bundler/gem_tasks.rb +7 -0
- data/bundler/lib/bundler/gem_version_promoter.rb +145 -0
- data/bundler/lib/bundler/graph.rb +152 -0
- data/bundler/lib/bundler/index.rb +205 -0
- data/bundler/lib/bundler/injector.rb +287 -0
- data/bundler/lib/bundler/inline.rb +73 -0
- data/bundler/lib/bundler/installer/gem_installer.rb +84 -0
- data/bundler/lib/bundler/installer/parallel_installer.rb +202 -0
- data/bundler/lib/bundler/installer/standalone.rb +116 -0
- data/bundler/lib/bundler/installer.rb +267 -0
- data/bundler/lib/bundler/lazy_specification.rb +170 -0
- data/bundler/lib/bundler/lockfile_generator.rb +104 -0
- data/bundler/lib/bundler/lockfile_parser.rb +289 -0
- data/bundler/lib/bundler/man/.document +1 -0
- data/bundler/lib/bundler/man/bundle-add.1 +59 -0
- data/bundler/lib/bundler/man/bundle-add.1.ronn +58 -0
- data/bundler/lib/bundler/man/bundle-binstubs.1 +30 -0
- data/bundler/lib/bundler/man/bundle-binstubs.1.ronn +41 -0
- data/bundler/lib/bundler/man/bundle-cache.1 +40 -0
- data/bundler/lib/bundler/man/bundle-cache.1.ronn +79 -0
- data/bundler/lib/bundler/man/bundle-check.1 +22 -0
- data/bundler/lib/bundler/man/bundle-check.1.ronn +26 -0
- data/bundler/lib/bundler/man/bundle-clean.1 +17 -0
- data/bundler/lib/bundler/man/bundle-clean.1.ronn +18 -0
- data/bundler/lib/bundler/man/bundle-config.1 +321 -0
- data/bundler/lib/bundler/man/bundle-config.1.ronn +411 -0
- data/bundler/lib/bundler/man/bundle-console.1 +35 -0
- data/bundler/lib/bundler/man/bundle-console.1.ronn +44 -0
- data/bundler/lib/bundler/man/bundle-doctor.1 +30 -0
- data/bundler/lib/bundler/man/bundle-doctor.1.ronn +33 -0
- data/bundler/lib/bundler/man/bundle-exec.1 +104 -0
- data/bundler/lib/bundler/man/bundle-exec.1.ronn +151 -0
- data/bundler/lib/bundler/man/bundle-gem.1 +69 -0
- data/bundler/lib/bundler/man/bundle-gem.1.ronn +117 -0
- data/bundler/lib/bundler/man/bundle-help.1 +9 -0
- data/bundler/lib/bundler/man/bundle-help.1.ronn +12 -0
- data/bundler/lib/bundler/man/bundle-info.1 +14 -0
- data/bundler/lib/bundler/man/bundle-info.1.ronn +17 -0
- data/bundler/lib/bundler/man/bundle-init.1 +20 -0
- data/bundler/lib/bundler/man/bundle-init.1.ronn +31 -0
- data/bundler/lib/bundler/man/bundle-inject.1 +23 -0
- data/bundler/lib/bundler/man/bundle-inject.1.ronn +24 -0
- data/bundler/lib/bundler/man/bundle-install.1 +215 -0
- data/bundler/lib/bundler/man/bundle-install.1.ronn +383 -0
- data/bundler/lib/bundler/man/bundle-list.1 +35 -0
- data/bundler/lib/bundler/man/bundle-list.1.ronn +33 -0
- data/bundler/lib/bundler/man/bundle-lock.1 +60 -0
- data/bundler/lib/bundler/man/bundle-lock.1.ronn +94 -0
- data/bundler/lib/bundler/man/bundle-open.1 +32 -0
- data/bundler/lib/bundler/man/bundle-open.1.ronn +27 -0
- data/bundler/lib/bundler/man/bundle-outdated.1 +100 -0
- data/bundler/lib/bundler/man/bundle-outdated.1.ronn +106 -0
- data/bundler/lib/bundler/man/bundle-platform.1 +49 -0
- data/bundler/lib/bundler/man/bundle-platform.1.ronn +49 -0
- data/bundler/lib/bundler/man/bundle-plugin.1 +55 -0
- data/bundler/lib/bundler/man/bundle-plugin.1.ronn +59 -0
- data/bundler/lib/bundler/man/bundle-pristine.1 +23 -0
- data/bundler/lib/bundler/man/bundle-pristine.1.ronn +34 -0
- data/bundler/lib/bundler/man/bundle-remove.1 +21 -0
- data/bundler/lib/bundler/man/bundle-remove.1.ronn +23 -0
- data/bundler/lib/bundler/man/bundle-show.1 +16 -0
- data/bundler/lib/bundler/man/bundle-show.1.ronn +21 -0
- data/bundler/lib/bundler/man/bundle-update.1 +275 -0
- data/bundler/lib/bundler/man/bundle-update.1.ronn +351 -0
- data/bundler/lib/bundler/man/bundle-version.1 +22 -0
- data/bundler/lib/bundler/man/bundle-version.1.ronn +24 -0
- data/bundler/lib/bundler/man/bundle-viz.1 +30 -0
- data/bundler/lib/bundler/man/bundle-viz.1.ronn +32 -0
- data/bundler/lib/bundler/man/bundle.1 +102 -0
- data/bundler/lib/bundler/man/bundle.1.ronn +116 -0
- data/bundler/lib/bundler/man/gemfile.5 +470 -0
- data/bundler/lib/bundler/man/gemfile.5.ronn +552 -0
- data/bundler/lib/bundler/man/index.txt +29 -0
- data/bundler/lib/bundler/match_metadata.rb +17 -0
- data/bundler/lib/bundler/match_platform.rb +23 -0
- data/bundler/lib/bundler/match_remote_metadata.rb +29 -0
- data/bundler/lib/bundler/mirror.rb +221 -0
- data/bundler/lib/bundler/plugin/api/source.rb +321 -0
- data/bundler/lib/bundler/plugin/api.rb +81 -0
- data/bundler/lib/bundler/plugin/dsl.rb +53 -0
- data/bundler/lib/bundler/plugin/events.rb +61 -0
- data/bundler/lib/bundler/plugin/index.rb +193 -0
- data/bundler/lib/bundler/plugin/installer/git.rb +34 -0
- data/bundler/lib/bundler/plugin/installer/rubygems.rb +19 -0
- data/bundler/lib/bundler/plugin/installer.rb +112 -0
- data/bundler/lib/bundler/plugin/source_list.rb +31 -0
- data/bundler/lib/bundler/plugin.rb +359 -0
- data/bundler/lib/bundler/process_lock.rb +24 -0
- data/bundler/lib/bundler/remote_specification.rb +117 -0
- data/bundler/lib/bundler/resolver/base.rb +107 -0
- data/bundler/lib/bundler/resolver/candidate.rb +94 -0
- data/bundler/lib/bundler/resolver/incompatibility.rb +15 -0
- data/bundler/lib/bundler/resolver/package.rb +77 -0
- data/bundler/lib/bundler/resolver/root.rb +25 -0
- data/bundler/lib/bundler/resolver/spec_group.rb +79 -0
- data/bundler/lib/bundler/resolver.rb +462 -0
- data/bundler/lib/bundler/retry.rb +66 -0
- data/bundler/lib/bundler/ruby_dsl.rb +53 -0
- data/bundler/lib/bundler/ruby_version.rb +131 -0
- data/bundler/lib/bundler/rubygems_ext.rb +328 -0
- data/bundler/lib/bundler/rubygems_gem_installer.rb +137 -0
- data/bundler/lib/bundler/rubygems_integration.rb +493 -0
- data/bundler/lib/bundler/runtime.rb +307 -0
- data/bundler/lib/bundler/safe_marshal.rb +31 -0
- data/bundler/lib/bundler/self_manager.rb +186 -0
- data/bundler/lib/bundler/settings/validator.rb +102 -0
- data/bundler/lib/bundler/settings.rb +588 -0
- data/bundler/lib/bundler/setup.rb +33 -0
- data/bundler/lib/bundler/shared_helpers.rb +380 -0
- data/bundler/lib/bundler/similarity_detector.rb +63 -0
- data/bundler/lib/bundler/source/gemspec.rb +18 -0
- data/bundler/lib/bundler/source/git/git_proxy.rb +455 -0
- data/bundler/lib/bundler/source/git.rb +380 -0
- data/bundler/lib/bundler/source/metadata.rb +62 -0
- data/bundler/lib/bundler/source/path/installer.rb +53 -0
- data/bundler/lib/bundler/source/path.rb +261 -0
- data/bundler/lib/bundler/source/rubygems/remote.rb +68 -0
- data/bundler/lib/bundler/source/rubygems.rb +516 -0
- data/bundler/lib/bundler/source/rubygems_aggregate.rb +68 -0
- data/bundler/lib/bundler/source.rb +116 -0
- data/bundler/lib/bundler/source_list.rb +227 -0
- data/bundler/lib/bundler/source_map.rb +71 -0
- data/bundler/lib/bundler/spec_set.rb +247 -0
- data/bundler/lib/bundler/stub_specification.rb +119 -0
- data/bundler/lib/bundler/templates/.document +1 -0
- data/bundler/lib/bundler/templates/Executable +27 -0
- data/bundler/lib/bundler/templates/Executable.bundler +109 -0
- data/bundler/lib/bundler/templates/Executable.standalone +14 -0
- data/bundler/lib/bundler/templates/Gemfile +5 -0
- data/bundler/lib/bundler/templates/newgem/CHANGELOG.md.tt +5 -0
- data/bundler/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +84 -0
- data/bundler/lib/bundler/templates/newgem/Cargo.toml.tt +7 -0
- data/bundler/lib/bundler/templates/newgem/Gemfile.tt +26 -0
- data/bundler/lib/bundler/templates/newgem/LICENSE.txt.tt +21 -0
- data/bundler/lib/bundler/templates/newgem/README.md.tt +45 -0
- data/bundler/lib/bundler/templates/newgem/Rakefile.tt +67 -0
- data/bundler/lib/bundler/templates/newgem/bin/console.tt +11 -0
- data/bundler/lib/bundler/templates/newgem/bin/setup.tt +8 -0
- data/bundler/lib/bundler/templates/newgem/circleci/config.yml.tt +25 -0
- data/bundler/lib/bundler/templates/newgem/exe/newgem.tt +3 -0
- data/bundler/lib/bundler/templates/newgem/ext/newgem/Cargo.toml.tt +15 -0
- data/bundler/lib/bundler/templates/newgem/ext/newgem/extconf-c.rb.tt +10 -0
- data/bundler/lib/bundler/templates/newgem/ext/newgem/extconf-rust.rb.tt +6 -0
- data/bundler/lib/bundler/templates/newgem/ext/newgem/newgem.c.tt +9 -0
- data/bundler/lib/bundler/templates/newgem/ext/newgem/newgem.h.tt +6 -0
- data/bundler/lib/bundler/templates/newgem/ext/newgem/src/lib.rs.tt +12 -0
- data/bundler/lib/bundler/templates/newgem/github/workflows/main.yml.tt +37 -0
- data/bundler/lib/bundler/templates/newgem/gitignore.tt +23 -0
- data/bundler/lib/bundler/templates/newgem/gitlab-ci.yml.tt +18 -0
- data/bundler/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +9 -0
- data/bundler/lib/bundler/templates/newgem/lib/newgem.rb.tt +15 -0
- data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +51 -0
- data/bundler/lib/bundler/templates/newgem/rspec.tt +3 -0
- data/bundler/lib/bundler/templates/newgem/rubocop.yml.tt +13 -0
- data/bundler/lib/bundler/templates/newgem/sig/newgem.rbs.tt +8 -0
- data/bundler/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +11 -0
- data/bundler/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +15 -0
- data/bundler/lib/bundler/templates/newgem/standard.yml.tt +3 -0
- data/bundler/lib/bundler/templates/newgem/test/minitest/test_helper.rb.tt +6 -0
- data/bundler/lib/bundler/templates/newgem/test/minitest/test_newgem.rb.tt +13 -0
- data/bundler/lib/bundler/templates/newgem/test/test-unit/newgem_test.rb.tt +15 -0
- data/bundler/lib/bundler/templates/newgem/test/test-unit/test_helper.rb.tt +6 -0
- data/bundler/lib/bundler/ui/rg_proxy.rb +19 -0
- data/bundler/lib/bundler/ui/shell.rb +165 -0
- data/bundler/lib/bundler/ui/silent.rb +85 -0
- data/bundler/lib/bundler/ui.rb +9 -0
- data/bundler/lib/bundler/uri_credentials_filter.rb +43 -0
- data/bundler/lib/bundler/uri_normalizer.rb +23 -0
- data/bundler/lib/bundler/vendor/.document +1 -0
- data/bundler/lib/bundler/vendor/connection_pool/LICENSE +20 -0
- data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +174 -0
- data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +3 -0
- data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +56 -0
- data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +175 -0
- data/bundler/lib/bundler/vendor/fileutils/LICENSE.txt +22 -0
- data/bundler/lib/bundler/vendor/fileutils/lib/fileutils.rb +2694 -0
- data/bundler/lib/bundler/vendor/net-http-persistent/README.rdoc +82 -0
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb +41 -0
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb +65 -0
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +79 -0
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +1073 -0
- data/bundler/lib/bundler/vendor/pub_grub/LICENSE.txt +21 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/assignment.rb +20 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/basic_package_source.rb +189 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/failure_writer.rb +182 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/incompatibility.rb +150 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/package.rb +43 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/partial_solution.rb +121 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/rubygems.rb +45 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/solve_failure.rb +19 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/static_package_source.rb +60 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/term.rb +105 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version.rb +3 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_constraint.rb +129 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_range.rb +411 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb +248 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_union.rb +178 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub.rb +31 -0
- data/bundler/lib/bundler/vendor/thor/LICENSE.md +20 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +105 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +61 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +108 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb +143 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +373 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +130 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions.rb +340 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/base.rb +825 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/command.rb +151 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +107 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/error.rb +106 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/group.rb +281 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/invocation.rb +178 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb +37 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb +88 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/line_editor.rb +17 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/nested_context.rb +29 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +89 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +195 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/option.rb +178 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/options.rb +293 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser.rb +4 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +72 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/runner.rb +335 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +388 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/color.rb +115 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/column_printer.rb +29 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/html.rb +84 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/lcs_diff.rb +49 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/table_printer.rb +134 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/terminal.rb +42 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/wrapped_printer.rb +38 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell.rb +81 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/util.rb +285 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/version.rb +3 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor.rb +663 -0
- data/bundler/lib/bundler/vendor/tsort/LICENSE.txt +22 -0
- data/bundler/lib/bundler/vendor/tsort/lib/tsort.rb +455 -0
- data/bundler/lib/bundler/vendor/uri/LICENSE.txt +22 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/common.rb +853 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/file.rb +100 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/ftp.rb +267 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/generic.rb +1588 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/http.rb +125 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/https.rb +23 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/ldap.rb +261 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/ldaps.rb +22 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/mailto.rb +293 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +539 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +183 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/version.rb +6 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/ws.rb +83 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/wss.rb +23 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri.rb +104 -0
- data/bundler/lib/bundler/vendored_fileutils.rb +4 -0
- data/bundler/lib/bundler/vendored_net_http.rb +8 -0
- data/bundler/lib/bundler/vendored_persistent.rb +11 -0
- data/bundler/lib/bundler/vendored_pub_grub.rb +4 -0
- data/bundler/lib/bundler/vendored_thor.rb +8 -0
- data/bundler/lib/bundler/vendored_timeout.rb +8 -0
- data/bundler/lib/bundler/vendored_tsort.rb +4 -0
- data/bundler/lib/bundler/vendored_uri.rb +4 -0
- data/bundler/lib/bundler/version.rb +13 -0
- data/bundler/lib/bundler/vlad.rb +17 -0
- data/bundler/lib/bundler/worker.rb +117 -0
- data/bundler/lib/bundler/yaml_serializer.rb +93 -0
- data/bundler/lib/bundler.rb +665 -0
- data/{test/rubygems/bogussources.rb → exe/gem} +5 -2
- data/exe/update_rubygems +38 -0
- data/hide_lib_for_update/note.txt +0 -4
- data/lib/rubygems/available_set.rb +12 -12
- data/lib/rubygems/basic_specification.rb +75 -58
- data/lib/rubygems/bundler_version_finder.rb +77 -0
- data/lib/rubygems/ci_detector.rb +75 -0
- data/lib/rubygems/command.rb +144 -71
- data/lib/rubygems/command_manager.rb +64 -27
- data/lib/rubygems/commands/build_command.rb +88 -17
- data/lib/rubygems/commands/cert_command.rb +131 -83
- data/lib/rubygems/commands/check_command.rb +30 -27
- data/lib/rubygems/commands/cleanup_command.rb +57 -40
- data/lib/rubygems/commands/contents_command.rb +37 -39
- data/lib/rubygems/commands/dependency_command.rb +53 -65
- data/lib/rubygems/commands/environment_command.rb +32 -16
- data/lib/rubygems/commands/exec_command.rb +249 -0
- data/lib/rubygems/commands/fetch_command.rb +36 -19
- data/lib/rubygems/commands/generate_index_command.rb +40 -74
- data/lib/rubygems/commands/help_command.rb +22 -22
- data/lib/rubygems/commands/info_command.rb +38 -0
- data/lib/rubygems/commands/install_command.rb +67 -143
- data/lib/rubygems/commands/list_command.rb +10 -9
- data/lib/rubygems/commands/lock_command.rb +12 -14
- data/lib/rubygems/commands/mirror_command.rb +4 -4
- data/lib/rubygems/commands/open_command.rb +28 -26
- data/lib/rubygems/commands/outdated_command.rb +6 -6
- data/lib/rubygems/commands/owner_command.rb +51 -27
- data/lib/rubygems/commands/pristine_command.rb +99 -71
- data/lib/rubygems/commands/push_command.rb +53 -46
- data/lib/rubygems/commands/query_command.rb +21 -328
- data/lib/rubygems/commands/rdoc_command.rb +33 -33
- data/lib/rubygems/commands/search_command.rb +9 -9
- data/lib/rubygems/commands/server_command.rb +15 -76
- data/lib/rubygems/commands/setup_command.rb +370 -186
- data/lib/rubygems/commands/signin_command.rb +34 -0
- data/lib/rubygems/commands/signout_command.rb +32 -0
- data/lib/rubygems/commands/sources_command.rb +57 -41
- data/lib/rubygems/commands/specification_command.rb +38 -28
- data/lib/rubygems/commands/stale_command.rb +6 -5
- data/lib/rubygems/commands/uninstall_command.rb +96 -62
- data/lib/rubygems/commands/unpack_command.rb +44 -53
- data/lib/rubygems/commands/update_command.rb +155 -99
- data/lib/rubygems/commands/which_command.rb +14 -17
- data/lib/rubygems/commands/yank_command.rb +28 -32
- data/lib/rubygems/compatibility.rb +13 -32
- data/lib/rubygems/config_file.rb +214 -119
- data/lib/rubygems/core_ext/kernel_gem.rb +10 -16
- data/lib/rubygems/core_ext/kernel_require.rb +92 -90
- data/lib/rubygems/core_ext/kernel_warn.rb +49 -0
- data/lib/rubygems/core_ext/tcpsocket_init.rb +54 -0
- data/lib/rubygems/defaults.rb +184 -54
- data/lib/rubygems/dependency.rb +75 -62
- data/lib/rubygems/dependency_installer.rb +74 -230
- data/lib/rubygems/dependency_list.rb +32 -33
- data/lib/rubygems/deprecate.rb +113 -17
- data/lib/rubygems/doctor.rb +31 -31
- data/lib/rubygems/errors.rb +51 -13
- data/lib/rubygems/exceptions.rb +65 -35
- data/lib/rubygems/ext/build_error.rb +3 -1
- data/lib/rubygems/ext/builder.rb +103 -77
- data/lib/rubygems/ext/cargo_builder/link_flag_converter.rb +27 -0
- data/lib/rubygems/ext/cargo_builder.rb +360 -0
- data/lib/rubygems/ext/cmake_builder.rb +6 -7
- data/lib/rubygems/ext/configure_builder.rb +6 -9
- data/lib/rubygems/ext/ext_conf_builder.rb +40 -61
- data/lib/rubygems/ext/rake_builder.rb +18 -21
- data/lib/rubygems/ext.rb +8 -7
- data/lib/rubygems/gem_runner.rb +19 -21
- data/lib/rubygems/gemcutter_utilities/webauthn_listener/response.rb +163 -0
- data/lib/rubygems/gemcutter_utilities/webauthn_listener.rb +105 -0
- data/lib/rubygems/gemcutter_utilities/webauthn_poller.rb +78 -0
- data/lib/rubygems/gemcutter_utilities.rb +246 -43
- data/lib/rubygems/install_default_message.rb +3 -3
- data/lib/rubygems/install_message.rb +3 -3
- data/lib/rubygems/install_update_options.rb +104 -98
- data/lib/rubygems/installer.rb +407 -225
- data/lib/rubygems/installer_uninstaller_utils.rb +27 -0
- data/lib/rubygems/local_remote_options.rb +29 -32
- data/lib/rubygems/name_tuple.rb +18 -23
- data/lib/rubygems/net/http.rb +3 -0
- data/lib/rubygems/net-http/LICENSE.txt +22 -0
- data/lib/rubygems/net-http/lib/net/http/backward.rb +40 -0
- data/lib/rubygems/net-http/lib/net/http/exceptions.rb +34 -0
- data/lib/rubygems/net-http/lib/net/http/generic_request.rb +414 -0
- data/lib/rubygems/net-http/lib/net/http/header.rb +981 -0
- data/lib/rubygems/net-http/lib/net/http/proxy_delta.rb +17 -0
- data/lib/rubygems/net-http/lib/net/http/request.rb +88 -0
- data/lib/rubygems/net-http/lib/net/http/requests.rb +425 -0
- data/lib/rubygems/net-http/lib/net/http/response.rb +738 -0
- data/lib/rubygems/net-http/lib/net/http/responses.rb +1174 -0
- data/lib/rubygems/net-http/lib/net/http/status.rb +84 -0
- data/lib/rubygems/net-http/lib/net/http.rb +2496 -0
- data/lib/rubygems/net-http/lib/net/https.rb +23 -0
- data/lib/rubygems/net-protocol/LICENSE.txt +22 -0
- data/lib/rubygems/net-protocol/lib/net/protocol.rb +544 -0
- data/lib/rubygems/openssl.rb +7 -0
- data/lib/rubygems/optparse/.document +1 -0
- data/lib/rubygems/optparse/COPYING +56 -0
- data/lib/rubygems/optparse/lib/optionparser.rb +2 -0
- data/lib/rubygems/optparse/lib/optparse/ac.rb +54 -0
- data/lib/rubygems/optparse/lib/optparse/date.rb +18 -0
- data/lib/rubygems/optparse/lib/optparse/kwargs.rb +22 -0
- data/lib/rubygems/optparse/lib/optparse/shellwords.rb +7 -0
- data/lib/rubygems/optparse/lib/optparse/time.rb +11 -0
- data/lib/rubygems/optparse/lib/optparse/uri.rb +7 -0
- data/lib/rubygems/optparse/lib/optparse/version.rb +71 -0
- data/lib/rubygems/optparse/lib/optparse.rb +2330 -0
- data/lib/rubygems/optparse.rb +3 -0
- data/lib/rubygems/package/digest_io.rb +5 -7
- data/lib/rubygems/package/file_source.rb +6 -8
- data/lib/rubygems/package/io_source.rb +6 -4
- data/lib/rubygems/package/old.rb +19 -28
- data/lib/rubygems/package/source.rb +1 -1
- data/lib/rubygems/package/tar_header.rb +114 -93
- data/lib/rubygems/package/tar_reader/entry.rb +116 -22
- data/lib/rubygems/package/tar_reader.rb +18 -40
- data/lib/rubygems/package/tar_writer.rb +42 -56
- data/lib/rubygems/package.rb +245 -145
- data/lib/rubygems/package_task.rb +8 -14
- data/lib/rubygems/path_support.rb +21 -16
- data/lib/rubygems/platform.rb +135 -74
- data/lib/rubygems/psych_tree.rb +3 -2
- data/lib/rubygems/query_utils.rb +349 -0
- data/lib/rubygems/rdoc.rb +4 -326
- data/lib/rubygems/remote_fetcher.rb +99 -181
- data/lib/rubygems/request/connection_pools.rb +31 -24
- data/lib/rubygems/request/http_pool.rb +6 -7
- data/lib/rubygems/request/https_pool.rb +2 -3
- data/lib/rubygems/request.rb +103 -53
- data/lib/rubygems/request_set/gem_dependency_api.rb +182 -190
- data/lib/rubygems/request_set/lockfile/parser.rb +42 -52
- data/lib/rubygems/request_set/lockfile/tokenizer.rb +34 -24
- data/lib/rubygems/request_set/lockfile.rb +32 -35
- data/lib/rubygems/request_set.rb +115 -71
- data/lib/rubygems/requirement.rb +77 -68
- data/lib/rubygems/resolv/LICENSE.txt +22 -0
- data/lib/rubygems/resolv/lib/resolv.rb +3387 -0
- data/lib/rubygems/resolver/activation_request.rb +34 -61
- data/lib/rubygems/resolver/api_set/gem_parser.rb +24 -0
- data/lib/rubygems/resolver/api_set.rb +40 -32
- data/lib/rubygems/resolver/api_specification.rb +37 -18
- data/lib/rubygems/resolver/best_set.rb +15 -17
- data/lib/rubygems/resolver/composed_set.rb +9 -11
- data/lib/rubygems/resolver/conflict.rb +19 -33
- data/lib/rubygems/resolver/current_set.rb +2 -4
- data/lib/rubygems/resolver/dependency_request.rb +8 -9
- data/lib/rubygems/resolver/git_set.rb +8 -10
- data/lib/rubygems/resolver/git_specification.rb +11 -13
- data/lib/rubygems/resolver/index_set.rb +13 -15
- data/lib/rubygems/resolver/index_specification.rb +42 -11
- data/lib/rubygems/resolver/installed_specification.rb +9 -11
- data/lib/rubygems/resolver/installer_set.rb +87 -45
- data/lib/rubygems/resolver/local_specification.rb +5 -7
- data/lib/rubygems/resolver/lock_set.rb +13 -15
- data/lib/rubygems/resolver/lock_specification.rb +13 -15
- data/lib/rubygems/resolver/molinillo/LICENSE +9 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/resolution_state.rb +57 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/specification_provider.rb +88 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/action.rb +36 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +66 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +62 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +63 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +61 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/log.rb +126 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/set_payload.rb +46 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/tag.rb +36 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/vertex.rb +164 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph.rb +110 -146
- data/lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb +83 -9
- data/lib/rubygems/resolver/molinillo/lib/molinillo/gem_metadata.rb +2 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/modules/specification_provider.rb +13 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/modules/ui.rb +3 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/resolution.rb +552 -172
- data/lib/rubygems/resolver/molinillo/lib/molinillo/resolver.rb +3 -2
- data/lib/rubygems/resolver/molinillo/lib/molinillo/state.rb +12 -6
- data/lib/rubygems/resolver/molinillo/lib/molinillo.rb +6 -5
- data/lib/rubygems/resolver/molinillo.rb +2 -1
- data/lib/rubygems/resolver/requirement_list.rb +2 -2
- data/lib/rubygems/resolver/set.rb +3 -5
- data/lib/rubygems/resolver/source_set.rb +6 -7
- data/lib/rubygems/resolver/spec_specification.rb +16 -4
- data/lib/rubygems/resolver/specification.rb +25 -10
- data/lib/rubygems/resolver/stats.rb +1 -0
- data/lib/rubygems/resolver/vendor_set.rb +6 -8
- data/lib/rubygems/resolver/vendor_specification.rb +6 -8
- data/lib/rubygems/resolver.rb +121 -72
- data/lib/rubygems/s3_uri_signer.rb +177 -0
- data/lib/rubygems/safe_marshal/elements.rb +138 -0
- data/lib/rubygems/safe_marshal/reader.rb +306 -0
- data/lib/rubygems/safe_marshal/visitors/stream_printer.rb +31 -0
- data/lib/rubygems/safe_marshal/visitors/to_ruby.rb +385 -0
- data/lib/rubygems/safe_marshal/visitors/visitor.rb +74 -0
- data/lib/rubygems/safe_marshal.rb +74 -0
- data/lib/rubygems/safe_yaml.rb +36 -0
- data/lib/rubygems/security/policies.rb +49 -51
- data/lib/rubygems/security/policy.rb +46 -53
- data/lib/rubygems/security/signer.rb +86 -29
- data/lib/rubygems/security/trust_dir.rb +22 -24
- data/lib/rubygems/security.rb +101 -82
- data/lib/rubygems/security_option.rb +43 -0
- data/lib/rubygems/shellwords.rb +3 -0
- data/lib/rubygems/source/git.rb +40 -42
- data/lib/rubygems/source/installed.rb +5 -9
- data/lib/rubygems/source/local.rb +30 -33
- data/lib/rubygems/source/lock.rb +10 -10
- data/lib/rubygems/source/specific_file.rb +7 -9
- data/lib/rubygems/source/vendor.rb +3 -7
- data/lib/rubygems/source.rb +78 -68
- data/lib/rubygems/source_list.rb +11 -15
- data/lib/rubygems/spec_fetcher.rb +71 -83
- data/lib/rubygems/specification.rb +833 -1115
- data/lib/rubygems/specification_policy.rb +538 -0
- data/lib/rubygems/ssl_certs/rubygems.org/GlobalSignRootCA.pem +21 -0
- data/lib/rubygems/ssl_certs/rubygems.org/GlobalSignRootCA_R3.pem +21 -0
- data/lib/rubygems/stub_specification.rb +55 -57
- data/lib/rubygems/text.rb +39 -27
- data/lib/rubygems/timeout/LICENSE.txt +22 -0
- data/lib/rubygems/timeout/lib/timeout.rb +199 -0
- data/lib/rubygems/timeout.rb +3 -0
- data/lib/rubygems/tsort/.document +1 -0
- data/lib/rubygems/tsort/LICENSE.txt +22 -0
- data/lib/rubygems/tsort/lib/tsort.rb +455 -0
- data/lib/rubygems/tsort.rb +3 -0
- data/lib/rubygems/uninstaller.rb +150 -87
- data/lib/rubygems/unknown_command_spell_checker.rb +21 -0
- data/lib/rubygems/update_suggestion.rb +56 -0
- data/lib/rubygems/uri.rb +126 -0
- data/lib/rubygems/uri_formatter.rb +4 -7
- data/lib/rubygems/user_interaction.rb +92 -146
- data/lib/rubygems/util/licenses.rb +712 -317
- data/lib/rubygems/util/list.rb +5 -2
- data/lib/rubygems/util.rb +58 -75
- data/lib/rubygems/validator.rb +26 -48
- data/lib/rubygems/version.rb +106 -56
- data/lib/rubygems/version_option.rb +22 -14
- data/lib/rubygems/yaml_serializer.rb +93 -0
- data/lib/rubygems.rb +427 -361
- data/rubygems-update.gemspec +38 -0
- data/setup.rb +13 -27
- metadata +500 -363
- data/.autotest +0 -71
- data/.document +0 -5
- data/.travis.yml +0 -46
- data/CONTRIBUTING.rdoc +0 -129
- data/CVE-2013-4287.txt +0 -35
- data/CVE-2013-4363.txt +0 -45
- data/CVE-2015-3900.txt +0 -40
- data/History.txt +0 -3105
- data/MAINTAINERS.md +0 -5
- data/POLICIES.rdoc +0 -61
- data/README.rdoc +0 -54
- data/Rakefile +0 -449
- data/UPGRADING.rdoc +0 -92
- data/appveyor.yml +0 -36
- data/bin/gem +0 -25
- data/bin/update_rubygems +0 -37
- data/lib/gauntlet_rubygems.rb +0 -51
- data/lib/rubygems/indexer.rb +0 -434
- data/lib/rubygems/installer_test_case.rb +0 -194
- data/lib/rubygems/mock_gem_ui.rb +0 -89
- data/lib/rubygems/package/tar_test_case.rb +0 -147
- data/lib/rubygems/psych_additions.rb +0 -10
- data/lib/rubygems/server.rb +0 -869
- data/lib/rubygems/source_local.rb +0 -6
- data/lib/rubygems/source_specific_file.rb +0 -5
- data/lib/rubygems/ssl_certs/AddTrustExternalCARoot-2048.pem +0 -25
- data/lib/rubygems/ssl_certs/AddTrustExternalCARoot.pem +0 -32
- data/lib/rubygems/ssl_certs/Class3PublicPrimaryCertificationAuthority.pem +0 -14
- data/lib/rubygems/ssl_certs/DigiCertHighAssuranceEVRootCA.pem +0 -23
- data/lib/rubygems/ssl_certs/EntrustnetSecureServerCertificationAuthority.pem +0 -28
- data/lib/rubygems/ssl_certs/GeoTrustGlobalCA.pem +0 -20
- data/lib/rubygems/syck_hack.rb +0 -77
- data/lib/rubygems/test_case.rb +0 -1496
- data/lib/rubygems/test_utilities.rb +0 -384
- data/lib/ubygems.rb +0 -11
- data/test/rubygems/alternate_cert.pem +0 -18
- data/test/rubygems/alternate_cert_32.pem +0 -18
- data/test/rubygems/alternate_key.pem +0 -27
- data/test/rubygems/bad_rake.rb +0 -2
- data/test/rubygems/ca_cert.pem +0 -68
- data/test/rubygems/child_cert.pem +0 -18
- data/test/rubygems/child_cert_32.pem +0 -18
- data/test/rubygems/child_key.pem +0 -27
- data/test/rubygems/client.pem +0 -49
- data/test/rubygems/data/gem-private_key.pem +0 -27
- data/test/rubygems/data/gem-public_cert.pem +0 -20
- data/test/rubygems/data/null-type.gemspec.rz +0 -0
- data/test/rubygems/encrypted_private_key.pem +0 -30
- data/test/rubygems/expired_cert.pem +0 -18
- data/test/rubygems/fake_certlib/openssl.rb +0 -8
- data/test/rubygems/fix_openssl_warnings.rb +0 -13
- data/test/rubygems/foo/discover.rb +0 -1
- data/test/rubygems/future_cert.pem +0 -18
- data/test/rubygems/future_cert_32.pem +0 -18
- data/test/rubygems/good_rake.rb +0 -2
- data/test/rubygems/grandchild_cert.pem +0 -18
- data/test/rubygems/grandchild_cert_32.pem +0 -18
- data/test/rubygems/grandchild_key.pem +0 -27
- data/test/rubygems/invalid_client.pem +0 -49
- data/test/rubygems/invalid_issuer_cert.pem +0 -18
- data/test/rubygems/invalid_issuer_cert_32.pem +0 -18
- data/test/rubygems/invalid_key.pem +0 -27
- data/test/rubygems/invalid_signer_cert.pem +0 -18
- data/test/rubygems/invalid_signer_cert_32.pem +0 -18
- data/test/rubygems/invalidchild_cert.pem +0 -18
- data/test/rubygems/invalidchild_cert_32.pem +0 -18
- data/test/rubygems/invalidchild_key.pem +0 -27
- data/test/rubygems/plugin/exception/rubygems_plugin.rb +0 -3
- data/test/rubygems/plugin/load/rubygems_plugin.rb +0 -4
- data/test/rubygems/plugin/standarderror/rubygems_plugin.rb +0 -3
- data/test/rubygems/private_key.pem +0 -27
- data/test/rubygems/public_cert.pem +0 -18
- data/test/rubygems/public_cert_32.pem +0 -18
- data/test/rubygems/public_key.pem +0 -9
- data/test/rubygems/rubygems/commands/crash_command.rb +0 -6
- data/test/rubygems/rubygems_plugin.rb +0 -22
- data/test/rubygems/sff/discover.rb +0 -1
- data/test/rubygems/simple_gem.rb +0 -67
- data/test/rubygems/specifications/bar-0.0.2.gemspec +0 -9
- data/test/rubygems/specifications/foo-0.0.1-x86-mswin32.gemspec +0 -0
- data/test/rubygems/ssl_cert.pem +0 -19
- data/test/rubygems/ssl_key.pem +0 -15
- data/test/rubygems/test_bundled_ca.rb +0 -59
- data/test/rubygems/test_config.rb +0 -24
- data/test/rubygems/test_deprecate.rb +0 -77
- data/test/rubygems/test_gem.rb +0 -1718
- data/test/rubygems/test_gem_available_set.rb +0 -130
- data/test/rubygems/test_gem_command.rb +0 -248
- data/test/rubygems/test_gem_command_manager.rb +0 -264
- data/test/rubygems/test_gem_commands_build_command.rb +0 -121
- data/test/rubygems/test_gem_commands_cert_command.rb +0 -671
- data/test/rubygems/test_gem_commands_check_command.rb +0 -69
- data/test/rubygems/test_gem_commands_cleanup_command.rb +0 -197
- data/test/rubygems/test_gem_commands_contents_command.rb +0 -240
- data/test/rubygems/test_gem_commands_dependency_command.rb +0 -230
- data/test/rubygems/test_gem_commands_environment_command.rb +0 -154
- data/test/rubygems/test_gem_commands_fetch_command.rb +0 -127
- data/test/rubygems/test_gem_commands_generate_index_command.rb +0 -51
- data/test/rubygems/test_gem_commands_help_command.rb +0 -75
- data/test/rubygems/test_gem_commands_install_command.rb +0 -1007
- data/test/rubygems/test_gem_commands_list_command.rb +0 -34
- data/test/rubygems/test_gem_commands_lock_command.rb +0 -69
- data/test/rubygems/test_gem_commands_mirror.rb +0 -20
- data/test/rubygems/test_gem_commands_open_command.rb +0 -70
- data/test/rubygems/test_gem_commands_outdated_command.rb +0 -33
- data/test/rubygems/test_gem_commands_owner_command.rb +0 -205
- data/test/rubygems/test_gem_commands_pristine_command.rb +0 -491
- data/test/rubygems/test_gem_commands_push_command.rb +0 -330
- data/test/rubygems/test_gem_commands_query_command.rb +0 -657
- data/test/rubygems/test_gem_commands_search_command.rb +0 -18
- data/test/rubygems/test_gem_commands_server_command.rb +0 -60
- data/test/rubygems/test_gem_commands_setup_command.rb +0 -136
- data/test/rubygems/test_gem_commands_sources_command.rb +0 -249
- data/test/rubygems/test_gem_commands_specification_command.rb +0 -251
- data/test/rubygems/test_gem_commands_stale_command.rb +0 -43
- data/test/rubygems/test_gem_commands_uninstall_command.rb +0 -283
- data/test/rubygems/test_gem_commands_unpack_command.rb +0 -209
- data/test/rubygems/test_gem_commands_update_command.rb +0 -514
- data/test/rubygems/test_gem_commands_which_command.rb +0 -87
- data/test/rubygems/test_gem_commands_yank_command.rb +0 -100
- data/test/rubygems/test_gem_config_file.rb +0 -491
- data/test/rubygems/test_gem_dependency.rb +0 -362
- data/test/rubygems/test_gem_dependency_installer.rb +0 -1235
- data/test/rubygems/test_gem_dependency_list.rb +0 -260
- data/test/rubygems/test_gem_dependency_resolution_error.rb +0 -29
- data/test/rubygems/test_gem_doctor.rb +0 -169
- data/test/rubygems/test_gem_ext_builder.rb +0 -341
- data/test/rubygems/test_gem_ext_cmake_builder.rb +0 -87
- data/test/rubygems/test_gem_ext_configure_builder.rb +0 -87
- data/test/rubygems/test_gem_ext_ext_conf_builder.rb +0 -211
- data/test/rubygems/test_gem_ext_rake_builder.rb +0 -65
- data/test/rubygems/test_gem_gem_runner.rb +0 -69
- data/test/rubygems/test_gem_gemcutter_utilities.rb +0 -235
- data/test/rubygems/test_gem_impossible_dependencies_error.rb +0 -62
- data/test/rubygems/test_gem_indexer.rb +0 -367
- data/test/rubygems/test_gem_install_update_options.rb +0 -197
- data/test/rubygems/test_gem_installer.rb +0 -1552
- data/test/rubygems/test_gem_local_remote_options.rb +0 -134
- data/test/rubygems/test_gem_name_tuple.rb +0 -45
- data/test/rubygems/test_gem_package.rb +0 -876
- data/test/rubygems/test_gem_package_old.rb +0 -90
- data/test/rubygems/test_gem_package_tar_header.rb +0 -147
- data/test/rubygems/test_gem_package_tar_reader.rb +0 -90
- data/test/rubygems/test_gem_package_tar_reader_entry.rb +0 -142
- data/test/rubygems/test_gem_package_tar_writer.rb +0 -264
- data/test/rubygems/test_gem_package_task.rb +0 -84
- data/test/rubygems/test_gem_path_support.rb +0 -121
- data/test/rubygems/test_gem_platform.rb +0 -308
- data/test/rubygems/test_gem_rdoc.rb +0 -270
- data/test/rubygems/test_gem_remote_fetcher.rb +0 -1051
- data/test/rubygems/test_gem_request.rb +0 -363
- data/test/rubygems/test_gem_request_connection_pools.rb +0 -130
- data/test/rubygems/test_gem_request_set.rb +0 -595
- data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +0 -831
- data/test/rubygems/test_gem_request_set_lockfile.rb +0 -470
- data/test/rubygems/test_gem_request_set_lockfile_parser.rb +0 -549
- data/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb +0 -306
- data/test/rubygems/test_gem_requirement.rb +0 -387
- data/test/rubygems/test_gem_resolver.rb +0 -715
- data/test/rubygems/test_gem_resolver_activation_request.rb +0 -74
- data/test/rubygems/test_gem_resolver_api_set.rb +0 -209
- data/test/rubygems/test_gem_resolver_api_specification.rb +0 -145
- data/test/rubygems/test_gem_resolver_best_set.rb +0 -138
- data/test/rubygems/test_gem_resolver_composed_set.rb +0 -46
- data/test/rubygems/test_gem_resolver_conflict.rb +0 -88
- data/test/rubygems/test_gem_resolver_dependency_request.rb +0 -85
- data/test/rubygems/test_gem_resolver_git_set.rb +0 -190
- data/test/rubygems/test_gem_resolver_git_specification.rb +0 -114
- data/test/rubygems/test_gem_resolver_index_set.rb +0 -90
- data/test/rubygems/test_gem_resolver_index_specification.rb +0 -90
- data/test/rubygems/test_gem_resolver_installed_specification.rb +0 -50
- data/test/rubygems/test_gem_resolver_installer_set.rb +0 -258
- data/test/rubygems/test_gem_resolver_local_specification.rb +0 -46
- data/test/rubygems/test_gem_resolver_lock_set.rb +0 -64
- data/test/rubygems/test_gem_resolver_lock_specification.rb +0 -100
- data/test/rubygems/test_gem_resolver_requirement_list.rb +0 -21
- data/test/rubygems/test_gem_resolver_specification.rb +0 -65
- data/test/rubygems/test_gem_resolver_vendor_set.rb +0 -84
- data/test/rubygems/test_gem_resolver_vendor_specification.rb +0 -84
- data/test/rubygems/test_gem_security.rb +0 -307
- data/test/rubygems/test_gem_security_policy.rb +0 -541
- data/test/rubygems/test_gem_security_signer.rb +0 -209
- data/test/rubygems/test_gem_security_trust_dir.rb +0 -101
- data/test/rubygems/test_gem_server.rb +0 -409
- data/test/rubygems/test_gem_silent_ui.rb +0 -117
- data/test/rubygems/test_gem_source.rb +0 -242
- data/test/rubygems/test_gem_source_fetch_problem.rb +0 -20
- data/test/rubygems/test_gem_source_git.rb +0 -309
- data/test/rubygems/test_gem_source_installed.rb +0 -37
- data/test/rubygems/test_gem_source_list.rb +0 -118
- data/test/rubygems/test_gem_source_local.rb +0 -107
- data/test/rubygems/test_gem_source_lock.rb +0 -115
- data/test/rubygems/test_gem_source_specific_file.rb +0 -76
- data/test/rubygems/test_gem_source_vendor.rb +0 -32
- data/test/rubygems/test_gem_spec_fetcher.rb +0 -311
- data/test/rubygems/test_gem_specification.rb +0 -3519
- data/test/rubygems/test_gem_stream_ui.rb +0 -239
- data/test/rubygems/test_gem_stub_specification.rb +0 -217
- data/test/rubygems/test_gem_text.rb +0 -77
- data/test/rubygems/test_gem_uninstaller.rb +0 -485
- data/test/rubygems/test_gem_unsatisfiable_dependency_error.rb +0 -33
- data/test/rubygems/test_gem_uri_formatter.rb +0 -29
- data/test/rubygems/test_gem_util.rb +0 -40
- data/test/rubygems/test_gem_validator.rb +0 -46
- data/test/rubygems/test_gem_version.rb +0 -222
- data/test/rubygems/test_gem_version_option.rb +0 -152
- data/test/rubygems/test_kernel.rb +0 -86
- data/test/rubygems/test_require.rb +0 -322
- data/test/rubygems/wrong_key_cert.pem +0 -18
- data/test/rubygems/wrong_key_cert_32.pem +0 -18
- data/util/CL2notes +0 -56
- data/util/create_certs.rb +0 -157
- data/util/create_encrypted_key.rb +0 -17
- data/util/generate_spdx_license_list.rb +0 -51
- data/util/update_bundled_ca_certificates.rb +0 -118
data/lib/rubygems.rb
CHANGED
@@ -1,24 +1,23 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
2
|
+
|
3
3
|
#--
|
4
4
|
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
|
5
5
|
# All rights reserved.
|
6
6
|
# See LICENSE.txt for permissions.
|
7
7
|
#++
|
8
8
|
|
9
|
-
require
|
10
|
-
require 'thread'
|
9
|
+
require "rbconfig"
|
11
10
|
|
12
11
|
module Gem
|
13
|
-
VERSION =
|
12
|
+
VERSION = "3.5.0"
|
14
13
|
end
|
15
14
|
|
16
15
|
# Must be first since it unloads the prelude from 1.9.2
|
17
|
-
|
16
|
+
require_relative "rubygems/compatibility"
|
18
17
|
|
19
|
-
|
20
|
-
|
21
|
-
|
18
|
+
require_relative "rubygems/defaults"
|
19
|
+
require_relative "rubygems/deprecate"
|
20
|
+
require_relative "rubygems/errors"
|
22
21
|
|
23
22
|
##
|
24
23
|
# RubyGems is the Ruby standard for publishing and managing third party
|
@@ -27,35 +26,34 @@ require 'rubygems/errors'
|
|
27
26
|
# For user documentation, see:
|
28
27
|
#
|
29
28
|
# * <tt>gem help</tt> and <tt>gem help [command]</tt>
|
30
|
-
# * {RubyGems User Guide}[
|
31
|
-
# * {Frequently Asked Questions}[
|
29
|
+
# * {RubyGems User Guide}[https://guides.rubygems.org/]
|
30
|
+
# * {Frequently Asked Questions}[https://guides.rubygems.org/faqs]
|
32
31
|
#
|
33
32
|
# For gem developer documentation see:
|
34
33
|
#
|
35
|
-
# * {Creating Gems}[
|
34
|
+
# * {Creating Gems}[https://guides.rubygems.org/make-your-own-gem]
|
36
35
|
# * Gem::Specification
|
37
36
|
# * Gem::Version for version dependency notes
|
38
37
|
#
|
39
38
|
# Further RubyGems documentation can be found at:
|
40
39
|
#
|
41
|
-
# * {RubyGems Guides}[
|
42
|
-
# * {RubyGems API}[
|
40
|
+
# * {RubyGems Guides}[https://guides.rubygems.org]
|
41
|
+
# * {RubyGems API}[https://www.rubydoc.info/github/rubygems/rubygems] (also available from
|
43
42
|
# <tt>gem server</tt>)
|
44
43
|
#
|
45
44
|
# == RubyGems Plugins
|
46
45
|
#
|
47
|
-
#
|
46
|
+
# RubyGems will load plugins in the latest version of each installed gem or
|
48
47
|
# $LOAD_PATH. Plugins must be named 'rubygems_plugin' (.rb, .so, etc) and
|
49
|
-
# placed at the root of your gem's #require_path. Plugins are
|
50
|
-
#
|
51
|
-
# plugin file may be loaded multiple times if multiple versions of your gem
|
52
|
-
# are installed.
|
48
|
+
# placed at the root of your gem's #require_path. Plugins are installed at a
|
49
|
+
# special location and loaded on boot.
|
53
50
|
#
|
54
|
-
# For an example plugin, see the
|
51
|
+
# For an example plugin, see the {Graph gem}[https://github.com/seattlerb/graph]
|
52
|
+
# which adds a <tt>gem graph</tt> command.
|
55
53
|
#
|
56
54
|
# == RubyGems Defaults, Packaging
|
57
55
|
#
|
58
|
-
# RubyGems defaults are stored in rubygems/defaults.rb. If you're packaging
|
56
|
+
# RubyGems defaults are stored in lib/rubygems/defaults.rb. If you're packaging
|
59
57
|
# RubyGems or implementing Ruby you can change RubyGems' defaults.
|
60
58
|
#
|
61
59
|
# For RubyGems packagers, provide lib/rubygems/defaults/operating_system.rb
|
@@ -65,7 +63,7 @@ require 'rubygems/errors'
|
|
65
63
|
# override any defaults from lib/rubygems/defaults.rb.
|
66
64
|
#
|
67
65
|
# If you need RubyGems to perform extra work on install or uninstall, your
|
68
|
-
# defaults override file can set pre
|
66
|
+
# defaults override file can set pre/post install and uninstall hooks.
|
69
67
|
# See Gem::pre_install, Gem::pre_uninstall, Gem::post_install,
|
70
68
|
# Gem::post_uninstall.
|
71
69
|
#
|
@@ -106,15 +104,16 @@ require 'rubygems/errors'
|
|
106
104
|
#
|
107
105
|
# (If your name is missing, PLEASE let us know!)
|
108
106
|
#
|
107
|
+
# == License
|
108
|
+
#
|
109
109
|
# See {LICENSE.txt}[rdoc-ref:lib/rubygems/LICENSE.txt] for permissions.
|
110
110
|
#
|
111
111
|
# Thanks!
|
112
112
|
#
|
113
113
|
# -The RubyGems Team
|
114
114
|
|
115
|
-
|
116
115
|
module Gem
|
117
|
-
RUBYGEMS_DIR =
|
116
|
+
RUBYGEMS_DIR = __dir__
|
118
117
|
|
119
118
|
##
|
120
119
|
# An Array of Regexps that match windows Ruby platforms.
|
@@ -126,13 +125,14 @@ module Gem
|
|
126
125
|
/mingw/i,
|
127
126
|
/mswin/i,
|
128
127
|
/wince/i,
|
129
|
-
]
|
128
|
+
].freeze
|
130
129
|
|
131
130
|
GEM_DEP_FILES = %w[
|
132
131
|
gem.deps.rb
|
132
|
+
gems.rb
|
133
133
|
Gemfile
|
134
134
|
Isolate
|
135
|
-
]
|
135
|
+
].freeze
|
136
136
|
|
137
137
|
##
|
138
138
|
# Subdirectories in a gem repository
|
@@ -143,8 +143,9 @@ module Gem
|
|
143
143
|
doc
|
144
144
|
extensions
|
145
145
|
gems
|
146
|
+
plugins
|
146
147
|
specifications
|
147
|
-
]
|
148
|
+
].freeze
|
148
149
|
|
149
150
|
##
|
150
151
|
# Subdirectories in a gem repository for default gems
|
@@ -152,14 +153,14 @@ module Gem
|
|
152
153
|
REPOSITORY_DEFAULT_GEM_SUBDIRECTORIES = %w[
|
153
154
|
gems
|
154
155
|
specifications/default
|
155
|
-
]
|
156
|
+
].freeze
|
156
157
|
|
157
158
|
@@win_platform = nil
|
158
159
|
|
159
160
|
@configuration = nil
|
160
161
|
@gemdeps = nil
|
161
162
|
@loaded_specs = {}
|
162
|
-
LOADED_SPECS_MUTEX = Mutex.new
|
163
|
+
LOADED_SPECS_MUTEX = Thread::Mutex.new
|
163
164
|
@path_to_default_spec_map = {}
|
164
165
|
@platforms = []
|
165
166
|
@ruby = nil
|
@@ -174,20 +175,16 @@ module Gem
|
|
174
175
|
@pre_reset_hooks ||= []
|
175
176
|
@post_reset_hooks ||= []
|
176
177
|
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
req = ENV["GEM_REQUIREMENT_#{gem_name.upcase}"] || '>= 0'.freeze
|
181
|
-
Gem::Requirement.create(req)
|
182
|
-
end
|
183
|
-
end
|
178
|
+
@default_source_date_epoch = nil
|
179
|
+
|
180
|
+
@discover_gems_on_require = true
|
184
181
|
|
185
182
|
##
|
186
183
|
# Try to activate a gem containing +path+. Returns true if
|
187
184
|
# activation succeeded or wasn't needed because it was already
|
188
185
|
# activated. Returns false if it can't find the path in a gem.
|
189
186
|
|
190
|
-
def self.try_activate
|
187
|
+
def self.try_activate(path)
|
191
188
|
# finds the _latest_ version... regardless of loaded specs and their deps
|
192
189
|
# if another gem had a requirement that would mean we shouldn't
|
193
190
|
# activate the latest version, then either it would already be activated
|
@@ -209,7 +206,7 @@ module Gem
|
|
209
206
|
end
|
210
207
|
end
|
211
208
|
|
212
|
-
|
209
|
+
true
|
213
210
|
end
|
214
211
|
|
215
212
|
def self.needs
|
@@ -222,6 +219,7 @@ module Gem
|
|
222
219
|
|
223
220
|
def self.finish_resolve(request_set=Gem::RequestSet.new)
|
224
221
|
request_set.import Gem::Specification.unresolved_deps.values
|
222
|
+
request_set.import Gem.loaded_specs.values.map {|s| Gem::Dependency.new(s.name, s.version) }
|
225
223
|
|
226
224
|
request_set.resolve_current.each do |s|
|
227
225
|
s.full_spec.activate
|
@@ -230,39 +228,58 @@ module Gem
|
|
230
228
|
|
231
229
|
##
|
232
230
|
# Find the full path to the executable for gem +name+. If the +exec_name+
|
233
|
-
# is not given,
|
231
|
+
# is not given, an exception will be raised, otherwise the
|
234
232
|
# specified executable's path is returned. +requirements+ allows
|
235
233
|
# you to specify specific gem versions.
|
236
234
|
|
237
235
|
def self.bin_path(name, exec_name = nil, *requirements)
|
238
|
-
# TODO: fails test_self_bin_path_bin_file_gone_in_latest
|
239
|
-
# Gem::Specification.find_by_name(name, *requirements).bin_file exec_name
|
240
|
-
|
241
|
-
raise ArgumentError, "you must supply exec_name" unless exec_name
|
242
|
-
|
243
236
|
requirements = Gem::Requirement.default if
|
244
237
|
requirements.empty?
|
245
238
|
|
239
|
+
find_spec_for_exe(name, exec_name, requirements).bin_file exec_name
|
240
|
+
end
|
241
|
+
|
242
|
+
def self.find_spec_for_exe(name, exec_name, requirements)
|
243
|
+
raise ArgumentError, "you must supply exec_name" unless exec_name
|
244
|
+
|
246
245
|
dep = Gem::Dependency.new name, requirements
|
247
246
|
|
248
247
|
loaded = Gem.loaded_specs[name]
|
249
248
|
|
250
|
-
return loaded
|
249
|
+
return loaded if loaded && dep.matches_spec?(loaded)
|
251
250
|
|
252
251
|
specs = dep.matching_specs(true)
|
253
252
|
|
254
|
-
|
255
|
-
"can't find gem #{dep}" if specs.empty?
|
256
|
-
|
257
|
-
specs = specs.find_all { |spec|
|
253
|
+
specs = specs.find_all do |spec|
|
258
254
|
spec.executables.include? exec_name
|
259
|
-
|
255
|
+
end if exec_name
|
260
256
|
|
261
|
-
unless spec = specs.
|
262
|
-
msg = "can't find gem #{
|
257
|
+
unless spec = specs.first
|
258
|
+
msg = "can't find gem #{dep} with executable #{exec_name}"
|
263
259
|
raise Gem::GemNotFoundException, msg
|
264
260
|
end
|
265
261
|
|
262
|
+
spec
|
263
|
+
end
|
264
|
+
private_class_method :find_spec_for_exe
|
265
|
+
|
266
|
+
##
|
267
|
+
# Find the full path to the executable for gem +name+. If the +exec_name+
|
268
|
+
# is not given, an exception will be raised, otherwise the
|
269
|
+
# specified executable's path is returned. +requirements+ allows
|
270
|
+
# you to specify specific gem versions.
|
271
|
+
#
|
272
|
+
# A side effect of this method is that it will activate the gem that
|
273
|
+
# contains the executable.
|
274
|
+
#
|
275
|
+
# This method should *only* be used in bin stub files.
|
276
|
+
|
277
|
+
def self.activate_bin_path(name, exec_name = nil, *requirements) # :nodoc:
|
278
|
+
spec = find_spec_for_exe name, exec_name, requirements
|
279
|
+
Gem::LOADED_SPECS_MUTEX.synchronize do
|
280
|
+
spec.activate
|
281
|
+
finish_resolve
|
282
|
+
end
|
266
283
|
spec.bin_file exec_name
|
267
284
|
end
|
268
285
|
|
@@ -270,18 +287,25 @@ module Gem
|
|
270
287
|
# The mode needed to read a file as straight binary.
|
271
288
|
|
272
289
|
def self.binary_mode
|
273
|
-
|
290
|
+
"rb"
|
274
291
|
end
|
275
292
|
|
276
293
|
##
|
277
294
|
# The path where gem executables are to be installed.
|
278
295
|
|
279
296
|
def self.bindir(install_dir=Gem.dir)
|
280
|
-
return File.join install_dir,
|
297
|
+
return File.join install_dir, "bin" unless
|
281
298
|
install_dir.to_s == Gem.default_dir.to_s
|
282
299
|
Gem.default_bindir
|
283
300
|
end
|
284
301
|
|
302
|
+
##
|
303
|
+
# The path were rubygems plugins are to be installed.
|
304
|
+
|
305
|
+
def self.plugindir(install_dir=Gem.dir)
|
306
|
+
File.join install_dir, "plugins"
|
307
|
+
end
|
308
|
+
|
285
309
|
##
|
286
310
|
# Reset the +dir+ and +path+ values. The next time +dir+ or +path+
|
287
311
|
# is requested, the values will be calculated from scratch. This is
|
@@ -294,13 +318,6 @@ module Gem
|
|
294
318
|
Gem::Security.reset if defined?(Gem::Security)
|
295
319
|
end
|
296
320
|
|
297
|
-
##
|
298
|
-
# The path to standard location of the user's .gemrc file.
|
299
|
-
|
300
|
-
def self.config_file
|
301
|
-
@config_file ||= File.join Gem.user_home, '.gemrc'
|
302
|
-
end
|
303
|
-
|
304
321
|
##
|
305
322
|
# The standard configuration object for gems.
|
306
323
|
|
@@ -316,22 +333,11 @@ module Gem
|
|
316
333
|
@configuration = config
|
317
334
|
end
|
318
335
|
|
319
|
-
##
|
320
|
-
# The path to the data directory specified by the gem name. If the
|
321
|
-
# package is not available as a gem, return nil.
|
322
|
-
|
323
|
-
def self.datadir(gem_name)
|
324
|
-
# TODO: deprecate
|
325
|
-
spec = @loaded_specs[gem_name]
|
326
|
-
return nil if spec.nil?
|
327
|
-
spec.datadir
|
328
|
-
end
|
329
|
-
|
330
336
|
##
|
331
337
|
# A Zlib::Deflate.deflate wrapper
|
332
338
|
|
333
339
|
def self.deflate(data)
|
334
|
-
require
|
340
|
+
require "zlib"
|
335
341
|
Zlib::Deflate.deflate data
|
336
342
|
end
|
337
343
|
|
@@ -353,16 +359,17 @@ module Gem
|
|
353
359
|
target = {}
|
354
360
|
env.each_pair do |k,v|
|
355
361
|
case k
|
356
|
-
when
|
362
|
+
when "GEM_HOME", "GEM_PATH", "GEM_SPEC_CACHE"
|
357
363
|
case v
|
358
364
|
when nil, String
|
359
365
|
target[k] = v
|
360
366
|
when Array
|
361
367
|
unless Gem::Deprecate.skip
|
362
|
-
warn <<-
|
363
|
-
Array values in the parameter
|
364
|
-
|
365
|
-
|
368
|
+
warn <<-EOWARN
|
369
|
+
Array values in the parameter to `Gem.paths=` are deprecated.
|
370
|
+
Please use a String or nil.
|
371
|
+
An Array (#{env.inspect}) was passed in from #{caller[3]}
|
372
|
+
EOWARN
|
366
373
|
end
|
367
374
|
target[k] = v.join File::PATH_SEPARATOR
|
368
375
|
end
|
@@ -376,8 +383,6 @@ An Array was passed in from #{caller[3]}
|
|
376
383
|
|
377
384
|
##
|
378
385
|
# The path where gems are to be installed.
|
379
|
-
#--
|
380
|
-
# FIXME deprecate these once everything else has been done -ebh
|
381
386
|
|
382
387
|
def self.dir
|
383
388
|
paths.home
|
@@ -400,7 +405,7 @@ An Array was passed in from #{caller[3]}
|
|
400
405
|
#
|
401
406
|
# World-writable directories will never be created.
|
402
407
|
|
403
|
-
def self.ensure_gem_subdirectories
|
408
|
+
def self.ensure_gem_subdirectories(dir = Gem.dir, mode = nil)
|
404
409
|
ensure_subdirectories(dir, mode, REPOSITORY_SUBDIRECTORIES)
|
405
410
|
end
|
406
411
|
|
@@ -413,15 +418,13 @@ An Array was passed in from #{caller[3]}
|
|
413
418
|
#
|
414
419
|
# World-writable directories will never be created.
|
415
420
|
|
416
|
-
def self.ensure_default_gem_subdirectories
|
421
|
+
def self.ensure_default_gem_subdirectories(dir = Gem.dir, mode = nil)
|
417
422
|
ensure_subdirectories(dir, mode, REPOSITORY_DEFAULT_GEM_SUBDIRECTORIES)
|
418
423
|
end
|
419
424
|
|
420
|
-
def self.ensure_subdirectories
|
425
|
+
def self.ensure_subdirectories(dir, mode, subdirs) # :nodoc:
|
421
426
|
old_umask = File.umask
|
422
|
-
File.umask old_umask |
|
423
|
-
|
424
|
-
require 'fileutils'
|
427
|
+
File.umask old_umask | 0o002
|
425
428
|
|
426
429
|
options = {}
|
427
430
|
|
@@ -430,7 +433,13 @@ An Array was passed in from #{caller[3]}
|
|
430
433
|
subdirs.each do |name|
|
431
434
|
subdir = File.join dir, name
|
432
435
|
next if File.exist? subdir
|
433
|
-
|
436
|
+
|
437
|
+
require "fileutils"
|
438
|
+
|
439
|
+
begin
|
440
|
+
FileUtils.mkdir_p subdir, **options
|
441
|
+
rescue SystemCallError
|
442
|
+
end
|
434
443
|
end
|
435
444
|
ensure
|
436
445
|
File.umask old_umask
|
@@ -441,7 +450,7 @@ An Array was passed in from #{caller[3]}
|
|
441
450
|
# distinction as extensions cannot be shared between the two.
|
442
451
|
|
443
452
|
def self.extension_api_version # :nodoc:
|
444
|
-
if
|
453
|
+
if RbConfig::CONFIG["ENABLE_SHARED"] == "no"
|
445
454
|
"#{ruby_api_version}-static"
|
446
455
|
else
|
447
456
|
ruby_api_version
|
@@ -467,7 +476,7 @@ An Array was passed in from #{caller[3]}
|
|
467
476
|
|
468
477
|
gem_specifications = @gemdeps ? Gem.loaded_specs.values : Gem::Specification.stubs
|
469
478
|
|
470
|
-
files.concat gem_specifications.map {
|
479
|
+
files.concat gem_specifications.map {|spec|
|
471
480
|
spec.matches_for_glob("#{glob}#{Gem.suffix_pattern}")
|
472
481
|
}.flatten
|
473
482
|
|
@@ -475,13 +484,14 @@ An Array was passed in from #{caller[3]}
|
|
475
484
|
# the spec dirs directly, so we prune.
|
476
485
|
files.uniq! if check_load_path
|
477
486
|
|
478
|
-
|
487
|
+
files
|
479
488
|
end
|
480
489
|
|
481
|
-
def self.find_files_from_load_path
|
482
|
-
|
483
|
-
|
484
|
-
|
490
|
+
def self.find_files_from_load_path(glob) # :nodoc:
|
491
|
+
glob_with_suffixes = "#{glob}#{Gem.suffix_pattern}"
|
492
|
+
$LOAD_PATH.map do |load_path|
|
493
|
+
Gem::Util.glob_files_in_dir(glob_with_suffixes, load_path)
|
494
|
+
end.flatten.select {|file| File.file? file }
|
485
495
|
end
|
486
496
|
|
487
497
|
##
|
@@ -501,7 +511,7 @@ An Array was passed in from #{caller[3]}
|
|
501
511
|
|
502
512
|
files = find_files_from_load_path glob if check_load_path
|
503
513
|
|
504
|
-
files.concat Gem::Specification.latest_specs(true).map {
|
514
|
+
files.concat Gem::Specification.latest_specs(true).map {|spec|
|
505
515
|
spec.matches_for_glob("#{glob}#{Gem.suffix_pattern}")
|
506
516
|
}.flatten
|
507
517
|
|
@@ -509,73 +519,7 @@ An Array was passed in from #{caller[3]}
|
|
509
519
|
# the spec dirs directly, so we prune.
|
510
520
|
files.uniq! if check_load_path
|
511
521
|
|
512
|
-
|
513
|
-
end
|
514
|
-
|
515
|
-
##
|
516
|
-
# Finds the user's home directory.
|
517
|
-
#--
|
518
|
-
# Some comments from the ruby-talk list regarding finding the home
|
519
|
-
# directory:
|
520
|
-
#
|
521
|
-
# I have HOME, USERPROFILE and HOMEDRIVE + HOMEPATH. Ruby seems
|
522
|
-
# to be depending on HOME in those code samples. I propose that
|
523
|
-
# it should fallback to USERPROFILE and HOMEDRIVE + HOMEPATH (at
|
524
|
-
# least on Win32).
|
525
|
-
#++
|
526
|
-
#--
|
527
|
-
#
|
528
|
-
# FIXME move to pathsupport
|
529
|
-
#
|
530
|
-
#++
|
531
|
-
|
532
|
-
def self.find_home
|
533
|
-
windows = File::ALT_SEPARATOR
|
534
|
-
if not windows or RUBY_VERSION >= '1.9' then
|
535
|
-
File.expand_path "~"
|
536
|
-
else
|
537
|
-
['HOME', 'USERPROFILE'].each do |key|
|
538
|
-
return File.expand_path ENV[key] if ENV[key]
|
539
|
-
end
|
540
|
-
|
541
|
-
if ENV['HOMEDRIVE'] && ENV['HOMEPATH'] then
|
542
|
-
File.expand_path "#{ENV['HOMEDRIVE']}#{ENV['HOMEPATH']}"
|
543
|
-
end
|
544
|
-
end
|
545
|
-
rescue
|
546
|
-
if windows then
|
547
|
-
File.expand_path File.join(ENV['HOMEDRIVE'] || ENV['SystemDrive'], '/')
|
548
|
-
else
|
549
|
-
File.expand_path "/"
|
550
|
-
end
|
551
|
-
end
|
552
|
-
|
553
|
-
private_class_method :find_home
|
554
|
-
|
555
|
-
# FIXME deprecate these in 3.0
|
556
|
-
|
557
|
-
##
|
558
|
-
# Zlib::GzipReader wrapper that unzips +data+.
|
559
|
-
|
560
|
-
def self.gunzip(data)
|
561
|
-
require 'rubygems/util'
|
562
|
-
Gem::Util.gunzip data
|
563
|
-
end
|
564
|
-
|
565
|
-
##
|
566
|
-
# Zlib::GzipWriter wrapper that zips +data+.
|
567
|
-
|
568
|
-
def self.gzip(data)
|
569
|
-
require 'rubygems/util'
|
570
|
-
Gem::Util.gzip data
|
571
|
-
end
|
572
|
-
|
573
|
-
##
|
574
|
-
# A Zlib::Inflate#inflate wrapper
|
575
|
-
|
576
|
-
def self.inflate(data)
|
577
|
-
require 'rubygems/util'
|
578
|
-
Gem::Util.inflate data
|
522
|
+
files
|
579
523
|
end
|
580
524
|
|
581
525
|
##
|
@@ -583,11 +527,11 @@ An Array was passed in from #{caller[3]}
|
|
583
527
|
#
|
584
528
|
# % irb
|
585
529
|
# >> Gem.install "minitest"
|
586
|
-
# Fetching: minitest-
|
530
|
+
# Fetching: minitest-5.14.0.gem (100%)
|
587
531
|
# => [#<Gem::Specification:0x1013b4528 @name="minitest", ...>]
|
588
532
|
|
589
|
-
def self.install
|
590
|
-
|
533
|
+
def self.install(name, version = Gem::Requirement.default, *options)
|
534
|
+
require_relative "rubygems/dependency_installer"
|
591
535
|
inst = Gem::DependencyInstaller.new(*options)
|
592
536
|
inst.install name, version
|
593
537
|
inst.installed_gems
|
@@ -598,14 +542,12 @@ An Array was passed in from #{caller[3]}
|
|
598
542
|
# <tt>https://rubygems.org</tt>.
|
599
543
|
|
600
544
|
def self.host
|
601
|
-
# TODO: move to utils
|
602
545
|
@host ||= Gem::DEFAULT_HOST
|
603
546
|
end
|
604
547
|
|
605
548
|
## Set the default RubyGems API host.
|
606
549
|
|
607
|
-
def self.host=
|
608
|
-
# TODO: move to utils
|
550
|
+
def self.host=(host)
|
609
551
|
@host = host
|
610
552
|
end
|
611
553
|
|
@@ -618,9 +560,27 @@ An Array was passed in from #{caller[3]}
|
|
618
560
|
return i if path.instance_variable_defined?(:@gem_prelude_index)
|
619
561
|
end
|
620
562
|
|
621
|
-
index = $LOAD_PATH.index RbConfig::CONFIG[
|
563
|
+
index = $LOAD_PATH.index RbConfig::CONFIG["sitelibdir"]
|
622
564
|
|
623
|
-
index
|
565
|
+
index || 0
|
566
|
+
end
|
567
|
+
|
568
|
+
##
|
569
|
+
# The number of paths in the +$LOAD_PATH+ from activated gems. Used to
|
570
|
+
# prioritize +-I+ and <code>ENV['RUBYLIB']</code> entries during +require+.
|
571
|
+
|
572
|
+
def self.activated_gem_paths
|
573
|
+
@activated_gem_paths ||= 0
|
574
|
+
end
|
575
|
+
|
576
|
+
##
|
577
|
+
# Add a list of paths to the $LOAD_PATH at the proper place.
|
578
|
+
|
579
|
+
def self.add_to_load_path(*paths)
|
580
|
+
@activated_gem_paths = activated_gem_paths + paths.size
|
581
|
+
|
582
|
+
# gem directories must come after -I and ENV['RUBYLIB']
|
583
|
+
$LOAD_PATH.insert(Gem.load_path_insert_index, *paths)
|
624
584
|
end
|
625
585
|
|
626
586
|
@yaml_loaded = false
|
@@ -630,58 +590,41 @@ An Array was passed in from #{caller[3]}
|
|
630
590
|
|
631
591
|
def self.load_yaml
|
632
592
|
return if @yaml_loaded
|
633
|
-
return unless defined?(gem)
|
634
593
|
|
635
|
-
|
594
|
+
require "psych"
|
595
|
+
require_relative "rubygems/psych_tree"
|
636
596
|
|
637
|
-
|
638
|
-
test_syck = false unless /^1\./ =~ RUBY_VERSION
|
597
|
+
require_relative "rubygems/safe_yaml"
|
639
598
|
|
640
|
-
|
641
|
-
|
642
|
-
gem 'psych', '>= 1.2.1'
|
643
|
-
rescue Gem::LoadError
|
644
|
-
# It's OK if the user does not have the psych gem installed. We will
|
645
|
-
# attempt to require the stdlib version
|
646
|
-
end
|
647
|
-
|
648
|
-
begin
|
649
|
-
# Try requiring the gem version *or* stdlib version of psych.
|
650
|
-
require 'psych'
|
651
|
-
rescue ::LoadError
|
652
|
-
# If we can't load psych, thats fine, go on.
|
653
|
-
else
|
654
|
-
# If 'yaml' has already been required, then we have to
|
655
|
-
# be sure to switch it over to the newly loaded psych.
|
656
|
-
if defined?(YAML::ENGINE) && YAML::ENGINE.yamler != "psych"
|
657
|
-
YAML::ENGINE.yamler = "psych"
|
658
|
-
end
|
659
|
-
|
660
|
-
require 'rubygems/psych_additions'
|
661
|
-
require 'rubygems/psych_tree'
|
662
|
-
end
|
663
|
-
end
|
599
|
+
@yaml_loaded = true
|
600
|
+
end
|
664
601
|
|
665
|
-
|
602
|
+
@safe_marshal_loaded = false
|
666
603
|
|
667
|
-
|
668
|
-
|
669
|
-
if test_syck and defined?(YAML::ENGINE)
|
670
|
-
YAML::ENGINE.yamler = "syck" unless YAML::ENGINE.syck?
|
671
|
-
end
|
604
|
+
def self.load_safe_marshal
|
605
|
+
return if @safe_marshal_loaded
|
672
606
|
|
673
|
-
|
674
|
-
# in our hack to deal with Syck's DefaultKey ugliness.
|
675
|
-
require 'rubygems/syck_hack'
|
607
|
+
require_relative "rubygems/safe_marshal"
|
676
608
|
|
677
|
-
@
|
609
|
+
@safe_marshal_loaded = true
|
678
610
|
end
|
679
611
|
|
680
612
|
##
|
681
613
|
# The file name and line number of the caller of the caller of this method.
|
614
|
+
#
|
615
|
+
# +depth+ is how many layers up the call stack it should go.
|
616
|
+
#
|
617
|
+
# e.g.,
|
618
|
+
#
|
619
|
+
# def a; Gem.location_of_caller; end
|
620
|
+
# a #=> ["x.rb", 2] # (it'll vary depending on file name and line number)
|
621
|
+
#
|
622
|
+
# def b; c; end
|
623
|
+
# def c; Gem.location_of_caller(2); end
|
624
|
+
# b #=> ["x.rb", 6] # (it'll vary depending on file name and line number)
|
682
625
|
|
683
|
-
def self.location_of_caller
|
684
|
-
caller[
|
626
|
+
def self.location_of_caller(depth = 1)
|
627
|
+
caller[depth] =~ /(.*?):(\d+).*?$/i
|
685
628
|
file = $1
|
686
629
|
lineno = $2.to_i
|
687
630
|
|
@@ -792,9 +735,9 @@ An Array was passed in from #{caller[3]}
|
|
792
735
|
def self.prefix
|
793
736
|
prefix = File.dirname RUBYGEMS_DIR
|
794
737
|
|
795
|
-
if prefix != File.expand_path(RbConfig::CONFIG[
|
796
|
-
prefix != File.expand_path(RbConfig::CONFIG[
|
797
|
-
|
738
|
+
if prefix != File.expand_path(RbConfig::CONFIG["sitelibdir"]) &&
|
739
|
+
prefix != File.expand_path(RbConfig::CONFIG["libdir"]) &&
|
740
|
+
File.basename(RUBYGEMS_DIR) == "lib"
|
798
741
|
prefix
|
799
742
|
end
|
800
743
|
end
|
@@ -810,20 +753,42 @@ An Array was passed in from #{caller[3]}
|
|
810
753
|
# Safely read a file in binary mode on all platforms.
|
811
754
|
|
812
755
|
def self.read_binary(path)
|
813
|
-
|
814
|
-
|
815
|
-
|
756
|
+
open_file(path, "rb+", &:read)
|
757
|
+
rescue Errno::EACCES, Errno::EROFS
|
758
|
+
open_file(path, "rb", &:read)
|
759
|
+
end
|
760
|
+
|
761
|
+
##
|
762
|
+
# Safely write a file in binary mode on all platforms.
|
763
|
+
def self.write_binary(path, data)
|
764
|
+
open_file(path, "wb") do |io|
|
765
|
+
io.write data
|
816
766
|
end
|
817
|
-
rescue Errno::
|
818
|
-
|
819
|
-
|
767
|
+
rescue Errno::ENOSPC
|
768
|
+
# If we ran out of space but the file exists, it's *guaranteed* to be corrupted.
|
769
|
+
File.delete(path) if File.exist?(path)
|
770
|
+
raise
|
771
|
+
end
|
772
|
+
|
773
|
+
##
|
774
|
+
# Open a file with given flags, and on Windows protect access with flock
|
775
|
+
|
776
|
+
def self.open_file(path, flags, &block)
|
777
|
+
File.open(path, flags) do |io|
|
778
|
+
if !java_platform? && win_platform?
|
779
|
+
begin
|
780
|
+
io.flock(File::LOCK_EX)
|
781
|
+
rescue Errno::ENOSYS, Errno::ENOTSUP
|
782
|
+
end
|
783
|
+
end
|
784
|
+
yield io
|
820
785
|
end
|
821
786
|
rescue Errno::ENOLCK # NFS
|
822
787
|
if Thread.main != Thread.current
|
823
788
|
raise
|
824
789
|
else
|
825
|
-
open
|
826
|
-
|
790
|
+
File.open(path, flags) do |io|
|
791
|
+
yield io
|
827
792
|
end
|
828
793
|
end
|
829
794
|
end
|
@@ -832,11 +797,10 @@ An Array was passed in from #{caller[3]}
|
|
832
797
|
# The path to the running Ruby interpreter.
|
833
798
|
|
834
799
|
def self.ruby
|
835
|
-
if @ruby.nil?
|
836
|
-
@ruby =
|
837
|
-
"#{RbConfig::CONFIG['ruby_install_name']}#{RbConfig::CONFIG['EXEEXT']}")
|
800
|
+
if @ruby.nil?
|
801
|
+
@ruby = RbConfig.ruby
|
838
802
|
|
839
|
-
@ruby = "\"#{@ruby}\"" if @ruby
|
803
|
+
@ruby = "\"#{@ruby}\"" if /\s/.match?(@ruby)
|
840
804
|
end
|
841
805
|
|
842
806
|
@ruby
|
@@ -846,18 +810,27 @@ An Array was passed in from #{caller[3]}
|
|
846
810
|
# Returns a String containing the API compatibility version of Ruby
|
847
811
|
|
848
812
|
def self.ruby_api_version
|
849
|
-
@ruby_api_version ||= RbConfig::CONFIG[
|
813
|
+
@ruby_api_version ||= RbConfig::CONFIG["ruby_version"].dup
|
814
|
+
end
|
815
|
+
|
816
|
+
def self.env_requirement(gem_name)
|
817
|
+
@env_requirements_by_name ||= {}
|
818
|
+
@env_requirements_by_name[gem_name] ||= begin
|
819
|
+
req = ENV["GEM_REQUIREMENT_#{gem_name.upcase}"] || ">= 0"
|
820
|
+
Gem::Requirement.create(req)
|
821
|
+
end
|
850
822
|
end
|
823
|
+
post_reset { @env_requirements_by_name = {} }
|
851
824
|
|
852
825
|
##
|
853
826
|
# Returns the latest release-version specification for the gem +name+.
|
854
827
|
|
855
|
-
def self.latest_spec_for
|
828
|
+
def self.latest_spec_for(name)
|
856
829
|
dependency = Gem::Dependency.new name
|
857
830
|
fetcher = Gem::SpecFetcher.fetcher
|
858
831
|
spec_tuples, = fetcher.spec_for_dependency dependency
|
859
832
|
|
860
|
-
spec, = spec_tuples.
|
833
|
+
spec, = spec_tuples.last
|
861
834
|
|
862
835
|
spec
|
863
836
|
end
|
@@ -866,16 +839,15 @@ An Array was passed in from #{caller[3]}
|
|
866
839
|
# Returns the latest release version of RubyGems.
|
867
840
|
|
868
841
|
def self.latest_rubygems_version
|
869
|
-
latest_version_for(
|
870
|
-
raise
|
842
|
+
latest_version_for("rubygems-update") ||
|
843
|
+
raise("Can't find 'rubygems-update' in any repo. Check `gem source list`.")
|
871
844
|
end
|
872
845
|
|
873
846
|
##
|
874
847
|
# Returns the version of the latest release-version of gem +name+
|
875
848
|
|
876
|
-
def self.latest_version_for
|
877
|
-
|
878
|
-
spec and spec.version
|
849
|
+
def self.latest_version_for(name)
|
850
|
+
latest_spec_for(name)&.version
|
879
851
|
end
|
880
852
|
|
881
853
|
##
|
@@ -885,10 +857,13 @@ An Array was passed in from #{caller[3]}
|
|
885
857
|
return @ruby_version if defined? @ruby_version
|
886
858
|
version = RUBY_VERSION.dup
|
887
859
|
|
888
|
-
if
|
889
|
-
|
890
|
-
|
891
|
-
|
860
|
+
if RUBY_PATCHLEVEL == -1
|
861
|
+
if RUBY_ENGINE == "ruby"
|
862
|
+
desc = RUBY_DESCRIPTION[/\Aruby #{Regexp.quote(RUBY_VERSION)}([^ ]+) /, 1]
|
863
|
+
else
|
864
|
+
desc = RUBY_DESCRIPTION[/\A#{RUBY_ENGINE} #{Regexp.quote(RUBY_ENGINE_VERSION)} \(#{RUBY_VERSION}([^ ]+)\) /, 1]
|
865
|
+
end
|
866
|
+
version << ".#{desc}" if desc
|
892
867
|
end
|
893
868
|
|
894
869
|
@ruby_version = Gem::Version.new version
|
@@ -907,7 +882,8 @@ An Array was passed in from #{caller[3]}
|
|
907
882
|
# default_sources if the sources list is empty.
|
908
883
|
|
909
884
|
def self.sources
|
910
|
-
|
885
|
+
source_list = configuration.sources || default_sources
|
886
|
+
@sources ||= Gem::SourceList.from(source_list)
|
911
887
|
end
|
912
888
|
|
913
889
|
##
|
@@ -917,7 +893,7 @@ An Array was passed in from #{caller[3]}
|
|
917
893
|
# DOC: This comment is not documentation about the method itself, it's
|
918
894
|
# more of a code comment about the implementation.
|
919
895
|
|
920
|
-
def self.sources=
|
896
|
+
def self.sources=(new_sources)
|
921
897
|
if !new_sources
|
922
898
|
@sources = nil
|
923
899
|
else
|
@@ -929,21 +905,41 @@ An Array was passed in from #{caller[3]}
|
|
929
905
|
# Glob pattern for require-able path suffixes.
|
930
906
|
|
931
907
|
def self.suffix_pattern
|
932
|
-
@suffix_pattern ||= "{#{suffixes.join(
|
908
|
+
@suffix_pattern ||= "{#{suffixes.join(",")}}"
|
909
|
+
end
|
910
|
+
|
911
|
+
##
|
912
|
+
# Regexp for require-able path suffixes.
|
913
|
+
|
914
|
+
def self.suffix_regexp
|
915
|
+
@suffix_regexp ||= /#{Regexp.union(suffixes)}\z/
|
916
|
+
end
|
917
|
+
|
918
|
+
##
|
919
|
+
# Glob pattern for require-able plugin suffixes.
|
920
|
+
|
921
|
+
def self.plugin_suffix_pattern
|
922
|
+
@plugin_suffix_pattern ||= "_plugin#{suffix_pattern}"
|
923
|
+
end
|
924
|
+
|
925
|
+
##
|
926
|
+
# Regexp for require-able plugin suffixes.
|
927
|
+
|
928
|
+
def self.plugin_suffix_regexp
|
929
|
+
@plugin_suffix_regexp ||= /_plugin#{suffix_regexp}\z/
|
933
930
|
end
|
934
931
|
|
935
932
|
##
|
936
933
|
# Suffixes for require-able paths.
|
937
934
|
|
938
935
|
def self.suffixes
|
939
|
-
@suffixes ||= [
|
940
|
-
|
941
|
-
*%w
|
936
|
+
@suffixes ||= ["",
|
937
|
+
".rb",
|
938
|
+
*%w[DLEXT DLEXT2].map do |key|
|
942
939
|
val = RbConfig::CONFIG[key]
|
943
|
-
next unless val
|
940
|
+
next unless val && !val.empty?
|
944
941
|
".#{val}"
|
945
|
-
|
946
|
-
].compact.uniq
|
942
|
+
end].compact.uniq
|
947
943
|
end
|
948
944
|
|
949
945
|
##
|
@@ -957,7 +953,7 @@ An Array was passed in from #{caller[3]}
|
|
957
953
|
|
958
954
|
elapsed = Time.now - now
|
959
955
|
|
960
|
-
ui.say "%2$*1$s: %3$3.3fs"
|
956
|
+
ui.say format("%2$*1$s: %3$3.3fs", -width, msg, elapsed) if display
|
961
957
|
|
962
958
|
value
|
963
959
|
end
|
@@ -966,7 +962,7 @@ An Array was passed in from #{caller[3]}
|
|
966
962
|
# Lazily loads DefaultUserInteraction and returns the default UI.
|
967
963
|
|
968
964
|
def self.ui
|
969
|
-
|
965
|
+
require_relative "rubygems/user_interaction"
|
970
966
|
|
971
967
|
Gem::DefaultUserInteraction.ui
|
972
968
|
end
|
@@ -979,43 +975,49 @@ An Array was passed in from #{caller[3]}
|
|
979
975
|
paths.flatten!
|
980
976
|
paths.compact!
|
981
977
|
hash = { "GEM_HOME" => home, "GEM_PATH" => paths.empty? ? home : paths.join(File::PATH_SEPARATOR) }
|
982
|
-
hash.delete_if {
|
978
|
+
hash.delete_if {|_, v| v.nil? }
|
983
979
|
self.paths = hash
|
984
980
|
end
|
985
981
|
|
986
|
-
##
|
987
|
-
# The home directory for the user.
|
988
|
-
|
989
|
-
def self.user_home
|
990
|
-
@user_home ||= find_home.untaint
|
991
|
-
end
|
992
|
-
|
993
982
|
##
|
994
983
|
# Is this a windows platform?
|
995
984
|
|
996
985
|
def self.win_platform?
|
997
|
-
if @@win_platform.nil?
|
998
|
-
ruby_platform = RbConfig::CONFIG[
|
999
|
-
@@win_platform =
|
986
|
+
if @@win_platform.nil?
|
987
|
+
ruby_platform = RbConfig::CONFIG["host_os"]
|
988
|
+
@@win_platform = !WIN_PATTERNS.find {|r| ruby_platform =~ r }.nil?
|
1000
989
|
end
|
1001
990
|
|
1002
991
|
@@win_platform
|
1003
992
|
end
|
1004
993
|
|
994
|
+
##
|
995
|
+
# Is this a java platform?
|
996
|
+
|
997
|
+
def self.java_platform?
|
998
|
+
RUBY_PLATFORM == "java"
|
999
|
+
end
|
1000
|
+
|
1001
|
+
##
|
1002
|
+
# Is this platform Solaris?
|
1003
|
+
|
1004
|
+
def self.solaris_platform?
|
1005
|
+
RUBY_PLATFORM.include?("solaris")
|
1006
|
+
end
|
1007
|
+
|
1005
1008
|
##
|
1006
1009
|
# Load +plugins+ as Ruby files
|
1007
1010
|
|
1008
|
-
def self.load_plugin_files
|
1011
|
+
def self.load_plugin_files(plugins) # :nodoc:
|
1009
1012
|
plugins.each do |plugin|
|
1010
|
-
|
1011
1013
|
# Skip older versions of the GemCutter plugin: Its commands are in
|
1012
1014
|
# RubyGems proper now.
|
1013
1015
|
|
1014
|
-
next if
|
1016
|
+
next if /gemcutter-0\.[0-3]/.match?(plugin)
|
1015
1017
|
|
1016
1018
|
begin
|
1017
1019
|
load plugin
|
1018
|
-
rescue
|
1020
|
+
rescue ScriptError, StandardError => e
|
1019
1021
|
details = "#{plugin.inspect}: #{e.message} (#{e.class})"
|
1020
1022
|
warn "Error loading RubyGems plugin #{details}"
|
1021
1023
|
end
|
@@ -1023,15 +1025,11 @@ An Array was passed in from #{caller[3]}
|
|
1023
1025
|
end
|
1024
1026
|
|
1025
1027
|
##
|
1026
|
-
# Find
|
1027
|
-
# them
|
1028
|
+
# Find rubygems plugin files in the standard location and load them
|
1028
1029
|
|
1029
1030
|
def self.load_plugins
|
1030
|
-
|
1031
|
-
|
1032
|
-
load_plugin_files find_files('rubygems_plugin', false)
|
1033
|
-
else
|
1034
|
-
load_plugin_files find_latest_files('rubygems_plugin', false)
|
1031
|
+
Gem.path.each do |gem_path|
|
1032
|
+
load_plugin_files Gem::Util.glob_files_in_dir("*#{Gem.plugin_suffix_pattern}", plugindir(gem_path))
|
1035
1033
|
end
|
1036
1034
|
end
|
1037
1035
|
|
@@ -1039,18 +1037,7 @@ An Array was passed in from #{caller[3]}
|
|
1039
1037
|
# Find all 'rubygems_plugin' files in $LOAD_PATH and load them
|
1040
1038
|
|
1041
1039
|
def self.load_env_plugins
|
1042
|
-
|
1043
|
-
|
1044
|
-
files = []
|
1045
|
-
$LOAD_PATH.each do |load_path|
|
1046
|
-
globbed = Dir["#{File.expand_path path, load_path}#{Gem.suffix_pattern}"]
|
1047
|
-
|
1048
|
-
globbed.each do |load_path_file|
|
1049
|
-
files << load_path_file if File.file?(load_path_file.untaint)
|
1050
|
-
end
|
1051
|
-
end
|
1052
|
-
|
1053
|
-
load_plugin_files files
|
1040
|
+
load_plugin_files find_files_from_load_path("rubygems_plugin")
|
1054
1041
|
end
|
1055
1042
|
|
1056
1043
|
##
|
@@ -1073,19 +1060,17 @@ An Array was passed in from #{caller[3]}
|
|
1073
1060
|
# execution of arbitrary code when used from directories outside your
|
1074
1061
|
# control.
|
1075
1062
|
|
1076
|
-
def self.use_gemdeps
|
1063
|
+
def self.use_gemdeps(path = nil)
|
1077
1064
|
raise_exception = path
|
1078
1065
|
|
1079
|
-
path ||= ENV[
|
1066
|
+
path ||= ENV["RUBYGEMS_GEMDEPS"]
|
1080
1067
|
return unless path
|
1081
1068
|
|
1082
1069
|
path = path.dup
|
1083
1070
|
|
1084
|
-
if path == "-"
|
1085
|
-
require 'rubygems/util'
|
1086
|
-
|
1071
|
+
if path == "-"
|
1087
1072
|
Gem::Util.traverse_parents Dir.pwd do |directory|
|
1088
|
-
dep_file = GEM_DEP_FILES.find {
|
1073
|
+
dep_file = GEM_DEP_FILES.find {|f| File.file?(f) }
|
1089
1074
|
|
1090
1075
|
next unless dep_file
|
1091
1076
|
|
@@ -1094,39 +1079,87 @@ An Array was passed in from #{caller[3]}
|
|
1094
1079
|
end
|
1095
1080
|
end
|
1096
1081
|
|
1097
|
-
path
|
1098
|
-
|
1099
|
-
unless File.file? path then
|
1082
|
+
unless File.file? path
|
1100
1083
|
return unless raise_exception
|
1101
1084
|
|
1102
1085
|
raise ArgumentError, "Unable to find gem dependencies file at #{path}"
|
1103
1086
|
end
|
1104
1087
|
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
1110
|
-
|
1111
|
-
|
1088
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path(path)
|
1089
|
+
require_relative "rubygems/user_interaction"
|
1090
|
+
require "bundler"
|
1091
|
+
begin
|
1092
|
+
Gem::DefaultUserInteraction.use_ui(ui) do
|
1093
|
+
Bundler.ui.silence do
|
1094
|
+
@gemdeps = Bundler.setup
|
1095
|
+
end
|
1096
|
+
ensure
|
1097
|
+
Gem::DefaultUserInteraction.ui.close
|
1098
|
+
end
|
1099
|
+
rescue Bundler::BundlerError => e
|
1100
|
+
warn e.message
|
1101
|
+
warn "You may need to `bundle install` to install missing gems"
|
1102
|
+
warn ""
|
1112
1103
|
end
|
1113
|
-
rescue Gem::LoadError, Gem::UnsatisfiableDependencyError => e
|
1114
|
-
warn e.message
|
1115
|
-
warn "You may need to `gem install -g` to install missing gems"
|
1116
|
-
warn ""
|
1117
1104
|
end
|
1118
1105
|
|
1119
|
-
|
1120
|
-
|
1121
|
-
|
1106
|
+
##
|
1107
|
+
# If the SOURCE_DATE_EPOCH environment variable is set, returns it's value.
|
1108
|
+
# Otherwise, returns the time that +Gem.source_date_epoch_string+ was
|
1109
|
+
# first called in the same format as SOURCE_DATE_EPOCH.
|
1110
|
+
#
|
1111
|
+
# NOTE(@duckinator): The implementation is a tad weird because we want to:
|
1112
|
+
# 1. Make builds reproducible by default, by having this function always
|
1113
|
+
# return the same result during a given run.
|
1114
|
+
# 2. Allow changing ENV['SOURCE_DATE_EPOCH'] at runtime, since multiple
|
1115
|
+
# tests that set this variable will be run in a single process.
|
1116
|
+
#
|
1117
|
+
# If you simplify this function and a lot of tests fail, that is likely
|
1118
|
+
# due to #2 above.
|
1119
|
+
#
|
1120
|
+
# Details on SOURCE_DATE_EPOCH:
|
1121
|
+
# https://reproducible-builds.org/specs/source-date-epoch/
|
1122
|
+
|
1123
|
+
def self.source_date_epoch_string
|
1124
|
+
# The value used if $SOURCE_DATE_EPOCH is not set.
|
1125
|
+
@default_source_date_epoch ||= Time.now.to_i.to_s
|
1126
|
+
|
1127
|
+
specified_epoch = ENV["SOURCE_DATE_EPOCH"]
|
1128
|
+
|
1129
|
+
# If it's empty or just whitespace, treat it like it wasn't set at all.
|
1130
|
+
specified_epoch = nil if !specified_epoch.nil? && specified_epoch.strip.empty?
|
1122
1131
|
|
1123
|
-
|
1132
|
+
epoch = specified_epoch || @default_source_date_epoch
|
1133
|
+
|
1134
|
+
epoch.strip
|
1135
|
+
end
|
1136
|
+
|
1137
|
+
##
|
1138
|
+
# Returns the value of Gem.source_date_epoch_string, as a Time object.
|
1139
|
+
#
|
1140
|
+
# This is used throughout RubyGems for enabling reproducible builds.
|
1141
|
+
|
1142
|
+
def self.source_date_epoch
|
1143
|
+
Time.at(source_date_epoch_string.to_i).utc.freeze
|
1124
1144
|
end
|
1125
1145
|
|
1126
1146
|
# FIX: Almost everywhere else we use the `def self.` way of defining class
|
1127
1147
|
# methods, and then we switch over to `class << self` here. Pick one or the
|
1128
1148
|
# other.
|
1129
1149
|
class << self
|
1150
|
+
##
|
1151
|
+
# RubyGems distributors (like operating system package managers) can
|
1152
|
+
# disable RubyGems update by setting this to error message printed to
|
1153
|
+
# end-users on gem update --system instead of actual update.
|
1154
|
+
|
1155
|
+
attr_accessor :disable_system_update_message
|
1156
|
+
|
1157
|
+
##
|
1158
|
+
# Whether RubyGems should enhance builtin `require` to automatically
|
1159
|
+
# check whether the path required is present in installed gems, and
|
1160
|
+
# automatically activate them and add them to `$LOAD_PATH`.
|
1161
|
+
|
1162
|
+
attr_accessor :discover_gems_on_require
|
1130
1163
|
|
1131
1164
|
##
|
1132
1165
|
# Hash of loaded Gem::Specification keyed by name
|
@@ -1152,10 +1185,11 @@ An Array was passed in from #{caller[3]}
|
|
1152
1185
|
#
|
1153
1186
|
|
1154
1187
|
def register_default_spec(spec)
|
1155
|
-
|
1188
|
+
extended_require_paths = spec.require_paths.map {|f| f + "/" }
|
1189
|
+
new_format = extended_require_paths.any? {|path| spec.files.any? {|f| f.start_with? path } }
|
1156
1190
|
|
1157
1191
|
if new_format
|
1158
|
-
prefix_group =
|
1192
|
+
prefix_group = extended_require_paths.join("|")
|
1159
1193
|
prefix_pattern = /^(#{prefix_group})/
|
1160
1194
|
end
|
1161
1195
|
|
@@ -1165,7 +1199,10 @@ An Array was passed in from #{caller[3]}
|
|
1165
1199
|
next unless $~
|
1166
1200
|
end
|
1167
1201
|
|
1202
|
+
spec.activate if already_loaded?(file)
|
1203
|
+
|
1168
1204
|
@path_to_default_spec_map[file] = spec
|
1205
|
+
@path_to_default_spec_map[file.sub(suffix_regexp, "")] = spec
|
1169
1206
|
end
|
1170
1207
|
end
|
1171
1208
|
|
@@ -1173,21 +1210,8 @@ An Array was passed in from #{caller[3]}
|
|
1173
1210
|
# Find a Gem::Specification of default gem from +path+
|
1174
1211
|
|
1175
1212
|
def find_unresolved_default_spec(path)
|
1176
|
-
|
1177
|
-
|
1178
|
-
return spec if spec
|
1179
|
-
end
|
1180
|
-
nil
|
1181
|
-
end
|
1182
|
-
|
1183
|
-
##
|
1184
|
-
# Remove needless Gem::Specification of default gem from
|
1185
|
-
# unresolved default gem list
|
1186
|
-
|
1187
|
-
def remove_unresolved_default_spec(spec)
|
1188
|
-
spec.files.each do |file|
|
1189
|
-
@path_to_default_spec_map.delete(file)
|
1190
|
-
end
|
1213
|
+
default_spec = @path_to_default_spec_map[path]
|
1214
|
+
return default_spec if default_spec && loaded_specs[default_spec.name] != default_spec
|
1191
1215
|
end
|
1192
1216
|
|
1193
1217
|
##
|
@@ -1241,54 +1265,86 @@ An Array was passed in from #{caller[3]}
|
|
1241
1265
|
# work
|
1242
1266
|
|
1243
1267
|
attr_reader :pre_uninstall_hooks
|
1268
|
+
|
1269
|
+
private
|
1270
|
+
|
1271
|
+
def already_loaded?(file)
|
1272
|
+
$LOADED_FEATURES.any? do |feature_path|
|
1273
|
+
feature_path.end_with?(file) && default_gem_load_paths.any? {|load_path_entry| feature_path == "#{load_path_entry}/#{file}" }
|
1274
|
+
end
|
1275
|
+
end
|
1276
|
+
|
1277
|
+
def default_gem_load_paths
|
1278
|
+
@default_gem_load_paths ||= $LOAD_PATH[load_path_insert_index..-1].map do |lp|
|
1279
|
+
expanded = File.expand_path(lp)
|
1280
|
+
next expanded unless File.exist?(expanded)
|
1281
|
+
|
1282
|
+
File.realpath(expanded)
|
1283
|
+
end
|
1284
|
+
end
|
1244
1285
|
end
|
1245
1286
|
|
1246
1287
|
##
|
1247
1288
|
# Location of Marshal quick gemspecs on remote repositories
|
1248
1289
|
|
1249
|
-
MARSHAL_SPEC_DIR = "quick/Marshal.#{Gem.marshal_version}/"
|
1250
|
-
|
1251
|
-
autoload :ConfigFile,
|
1252
|
-
autoload :
|
1253
|
-
autoload :
|
1254
|
-
autoload :
|
1255
|
-
autoload :Installer,
|
1256
|
-
autoload :Licenses,
|
1257
|
-
autoload :
|
1258
|
-
autoload :
|
1259
|
-
autoload :RequestSet,
|
1260
|
-
autoload :Requirement,
|
1261
|
-
autoload :Resolver,
|
1262
|
-
autoload :Source,
|
1263
|
-
autoload :SourceList,
|
1264
|
-
autoload :SpecFetcher,
|
1265
|
-
autoload :
|
1266
|
-
autoload :
|
1267
|
-
|
1268
|
-
require "rubygems/specification"
|
1290
|
+
MARSHAL_SPEC_DIR = "quick/Marshal.#{Gem.marshal_version}/".freeze
|
1291
|
+
|
1292
|
+
autoload :ConfigFile, File.expand_path("rubygems/config_file", __dir__)
|
1293
|
+
autoload :CIDetector, File.expand_path("rubygems/ci_detector", __dir__)
|
1294
|
+
autoload :Dependency, File.expand_path("rubygems/dependency", __dir__)
|
1295
|
+
autoload :DependencyList, File.expand_path("rubygems/dependency_list", __dir__)
|
1296
|
+
autoload :Installer, File.expand_path("rubygems/installer", __dir__)
|
1297
|
+
autoload :Licenses, File.expand_path("rubygems/util/licenses", __dir__)
|
1298
|
+
autoload :NameTuple, File.expand_path("rubygems/name_tuple", __dir__)
|
1299
|
+
autoload :PathSupport, File.expand_path("rubygems/path_support", __dir__)
|
1300
|
+
autoload :RequestSet, File.expand_path("rubygems/request_set", __dir__)
|
1301
|
+
autoload :Requirement, File.expand_path("rubygems/requirement", __dir__)
|
1302
|
+
autoload :Resolver, File.expand_path("rubygems/resolver", __dir__)
|
1303
|
+
autoload :Source, File.expand_path("rubygems/source", __dir__)
|
1304
|
+
autoload :SourceList, File.expand_path("rubygems/source_list", __dir__)
|
1305
|
+
autoload :SpecFetcher, File.expand_path("rubygems/spec_fetcher", __dir__)
|
1306
|
+
autoload :SpecificationPolicy, File.expand_path("rubygems/specification_policy", __dir__)
|
1307
|
+
autoload :Util, File.expand_path("rubygems/util", __dir__)
|
1308
|
+
autoload :Version, File.expand_path("rubygems/version", __dir__)
|
1269
1309
|
end
|
1270
1310
|
|
1271
|
-
|
1311
|
+
require_relative "rubygems/exceptions"
|
1312
|
+
require_relative "rubygems/specification"
|
1272
1313
|
|
1273
1314
|
# REFACTOR: This should be pulled out into some kind of hacks file.
|
1274
|
-
|
1275
|
-
|
1276
|
-
|
1277
|
-
|
1278
|
-
|
1315
|
+
begin
|
1316
|
+
##
|
1317
|
+
# Defaults the operating system (or packager) wants to provide for RubyGems.
|
1318
|
+
|
1319
|
+
require "rubygems/defaults/operating_system"
|
1320
|
+
rescue LoadError
|
1321
|
+
# Ignored
|
1322
|
+
rescue StandardError => e
|
1323
|
+
path = e.backtrace_locations.reverse.find {|l| l.path.end_with?("rubygems/defaults/operating_system.rb") }.path
|
1324
|
+
msg = "#{e.message}\n" \
|
1325
|
+
"Loading the #{path} file caused an error. " \
|
1326
|
+
"This file is owned by your OS, not by rubygems upstream. " \
|
1327
|
+
"Please find out which OS package this file belongs to and follow the guidelines from your OS to report " \
|
1328
|
+
"the problem and ask for help."
|
1329
|
+
raise e.class, msg
|
1330
|
+
end
|
1279
1331
|
|
1280
|
-
|
1281
|
-
|
1282
|
-
|
1332
|
+
begin
|
1333
|
+
##
|
1334
|
+
# Defaults the Ruby implementation wants to provide for RubyGems
|
1283
1335
|
|
1284
|
-
|
1285
|
-
|
1286
|
-
|
1287
|
-
# Defaults the Ruby implementation wants to provide for RubyGems
|
1336
|
+
require "rubygems/defaults/#{RUBY_ENGINE}"
|
1337
|
+
rescue LoadError
|
1338
|
+
end
|
1288
1339
|
|
1289
|
-
|
1290
|
-
|
1291
|
-
|
1340
|
+
# TruffleRuby >= 24 defines REUSE_AS_BINARY_ON_TRUFFLERUBY in defaults/truffleruby.
|
1341
|
+
# However, TruffleRuby < 24 defines REUSE_AS_BINARY_ON_TRUFFLERUBY directly in its copy
|
1342
|
+
# of lib/rubygems/platform.rb, so it is not defined if RubyGems is updated (gem update --system).
|
1343
|
+
# Instead, we define it here in that case, similar to bundler/lib/bundler/rubygems_ext.rb.
|
1344
|
+
# We must define it here and not in platform.rb because platform.rb is loaded before defaults/truffleruby.
|
1345
|
+
class Gem::Platform
|
1346
|
+
if RUBY_ENGINE == "truffleruby" && !defined?(REUSE_AS_BINARY_ON_TRUFFLERUBY)
|
1347
|
+
REUSE_AS_BINARY_ON_TRUFFLERUBY = %w[libv8 libv8-node sorbet-static].freeze
|
1292
1348
|
end
|
1293
1349
|
end
|
1294
1350
|
|
@@ -1296,7 +1352,17 @@ end
|
|
1296
1352
|
# Loads the default specs.
|
1297
1353
|
Gem::Specification.load_defaults
|
1298
1354
|
|
1299
|
-
|
1300
|
-
|
1355
|
+
require_relative "rubygems/core_ext/kernel_gem"
|
1356
|
+
|
1357
|
+
path = File.join(__dir__, "rubygems/core_ext/kernel_require.rb")
|
1358
|
+
# When https://bugs.ruby-lang.org/issues/17259 is available, there is no need to override Kernel#warn
|
1359
|
+
if RUBY_ENGINE == "truffleruby" ||
|
1360
|
+
RUBY_ENGINE == "ruby"
|
1361
|
+
file = "<internal:#{path}>"
|
1362
|
+
else
|
1363
|
+
require_relative "rubygems/core_ext/kernel_warn"
|
1364
|
+
file = path
|
1365
|
+
end
|
1366
|
+
eval File.read(path), nil, file
|
1301
1367
|
|
1302
|
-
|
1368
|
+
require ENV["BUNDLER_SETUP"] if ENV["BUNDLER_SETUP"] && !defined?(Bundler)
|