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/installer.rb
CHANGED
@@ -1,16 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
#--
|
3
4
|
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
|
4
5
|
# All rights reserved.
|
5
6
|
# See LICENSE.txt for permissions.
|
6
7
|
#++
|
7
8
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
9
|
+
require_relative "installer_uninstaller_utils"
|
10
|
+
require_relative "exceptions"
|
11
|
+
require_relative "deprecate"
|
12
|
+
require_relative "package"
|
13
|
+
require_relative "ext"
|
14
|
+
require_relative "user_interaction"
|
14
15
|
|
15
16
|
##
|
16
17
|
# The installer installs the files contained in the .gem into the Gem.home.
|
@@ -26,12 +27,13 @@ require 'fileutils'
|
|
26
27
|
# file. See Gem.pre_install and Gem.post_install for details.
|
27
28
|
|
28
29
|
class Gem::Installer
|
30
|
+
extend Gem::Deprecate
|
29
31
|
|
30
32
|
##
|
31
33
|
# Paths where env(1) might live. Some systems are broken and have it in
|
32
34
|
# /bin
|
33
35
|
|
34
|
-
ENV_PATHS = %w[/usr/bin/env /bin/env]
|
36
|
+
ENV_PATHS = %w[/usr/bin/env /bin/env].freeze
|
35
37
|
|
36
38
|
##
|
37
39
|
# Deprecated in favor of Gem::Ext::BuildError
|
@@ -40,10 +42,7 @@ class Gem::Installer
|
|
40
42
|
|
41
43
|
include Gem::UserInteraction
|
42
44
|
|
43
|
-
|
44
|
-
# Filename of the gem being installed.
|
45
|
-
|
46
|
-
attr_reader :gem
|
45
|
+
include Gem::InstallerUninstallerUtils
|
47
46
|
|
48
47
|
##
|
49
48
|
# The directory a gem's executables will be installed into
|
@@ -62,22 +61,35 @@ class Gem::Installer
|
|
62
61
|
|
63
62
|
attr_reader :options
|
64
63
|
|
65
|
-
|
64
|
+
##
|
65
|
+
# The gem package instance.
|
66
|
+
|
67
|
+
attr_reader :package
|
66
68
|
|
67
|
-
@
|
69
|
+
@path_warning = false
|
68
70
|
|
69
71
|
class << self
|
72
|
+
#
|
73
|
+
# Changes in rubygems to lazily loading `rubygems/command` (in order to
|
74
|
+
# lazily load `optparse` as a side effect) affect bundler's custom installer
|
75
|
+
# which uses `Gem::Command` without requiring it (up until bundler 2.2.29).
|
76
|
+
# This hook is to compensate for that missing require.
|
77
|
+
#
|
78
|
+
# TODO: Remove when rubygems no longer supports running on bundler older
|
79
|
+
# than 2.2.29.
|
70
80
|
|
71
|
-
|
72
|
-
|
81
|
+
def inherited(klass)
|
82
|
+
if klass.name == "Bundler::RubyGemsGemInstaller"
|
83
|
+
require "rubygems/command"
|
84
|
+
end
|
73
85
|
|
74
|
-
|
86
|
+
super(klass)
|
87
|
+
end
|
75
88
|
|
76
89
|
##
|
77
|
-
#
|
78
|
-
# used to allow multiple threads to install Gems at the same time.
|
90
|
+
# True if we've warned about PATH not including Gem.bindir
|
79
91
|
|
80
|
-
|
92
|
+
attr_accessor :path_warning
|
81
93
|
|
82
94
|
##
|
83
95
|
# Overrides the executable format.
|
@@ -92,13 +104,12 @@ class Gem::Installer
|
|
92
104
|
def exec_format
|
93
105
|
@exec_format ||= Gem.default_exec_format
|
94
106
|
end
|
95
|
-
|
96
107
|
end
|
97
108
|
|
98
109
|
##
|
99
110
|
# Construct an installer object for the gem file located at +path+
|
100
111
|
|
101
|
-
def self.at
|
112
|
+
def self.at(path, options = {})
|
102
113
|
security_policy = options[:security_policy]
|
103
114
|
package = Gem::Package.new path, security_policy
|
104
115
|
new package, options
|
@@ -107,22 +118,28 @@ class Gem::Installer
|
|
107
118
|
class FakePackage
|
108
119
|
attr_accessor :spec
|
109
120
|
|
121
|
+
attr_accessor :dir_mode
|
122
|
+
attr_accessor :prog_mode
|
123
|
+
attr_accessor :data_mode
|
124
|
+
|
110
125
|
def initialize(spec)
|
111
126
|
@spec = spec
|
112
127
|
end
|
113
128
|
|
114
|
-
def extract_files
|
129
|
+
def extract_files(destination_dir, pattern = "*")
|
115
130
|
FileUtils.mkdir_p destination_dir
|
116
131
|
|
117
132
|
spec.files.each do |file|
|
118
133
|
file = File.join destination_dir, file
|
119
134
|
next if File.exist? file
|
120
135
|
FileUtils.mkdir_p File.dirname(file)
|
121
|
-
File.open file,
|
136
|
+
File.open file, "w" do |fp|
|
137
|
+
fp.puts "# #{file}"
|
138
|
+
end
|
122
139
|
end
|
123
140
|
end
|
124
141
|
|
125
|
-
def copy_to
|
142
|
+
def copy_to(path)
|
126
143
|
end
|
127
144
|
end
|
128
145
|
|
@@ -130,14 +147,15 @@ class Gem::Installer
|
|
130
147
|
# Construct an installer object for an ephemeral gem (one where we don't
|
131
148
|
# actually have a .gem file, just a spec)
|
132
149
|
|
133
|
-
def self.for_spec
|
150
|
+
def self.for_spec(spec, options = {})
|
134
151
|
# FIXME: we should have a real Package class for this
|
135
152
|
new FakePackage.new(spec), options
|
136
153
|
end
|
137
154
|
|
138
155
|
##
|
139
|
-
# Constructs an Installer instance that will install the gem
|
140
|
-
#
|
156
|
+
# Constructs an Installer instance that will install the gem at +package+ which
|
157
|
+
# can either be a path or an instance of Gem::Package. +options+ is a Hash
|
158
|
+
# with the following keys:
|
141
159
|
#
|
142
160
|
# :bin_dir:: Where to put a bin wrapper if needed.
|
143
161
|
# :development:: Whether or not development dependencies should be installed.
|
@@ -157,26 +175,26 @@ class Gem::Installer
|
|
157
175
|
# :wrappers:: Install wrappers if true, symlinks if false.
|
158
176
|
# :build_args:: An Array of arguments to pass to the extension builder
|
159
177
|
# process. If not set, then Gem::Command.build_args is used
|
178
|
+
# :post_install_message:: Print gem post install message if true
|
160
179
|
|
161
180
|
def initialize(package, options={})
|
162
|
-
require
|
181
|
+
require "fileutils"
|
163
182
|
|
164
183
|
@options = options
|
165
|
-
|
166
|
-
security_policy = options[:security_policy]
|
167
|
-
@package = Gem::Package.new package, security_policy
|
168
|
-
if $VERBOSE
|
169
|
-
warn "constructing an Installer object with a string is deprecated. Please use Gem::Installer.at (called from: #{caller.first})"
|
170
|
-
end
|
171
|
-
else
|
172
|
-
@package = package
|
173
|
-
end
|
184
|
+
@package = package
|
174
185
|
|
175
186
|
process_options
|
176
187
|
|
177
|
-
|
178
|
-
|
179
|
-
|
188
|
+
@package.dir_mode = options[:dir_mode]
|
189
|
+
@package.prog_mode = options[:prog_mode]
|
190
|
+
@package.data_mode = options[:data_mode]
|
191
|
+
|
192
|
+
if @gem_home == Gem.user_dir
|
193
|
+
# If we get here, then one of the following likely happened:
|
194
|
+
# - `--user-install` was specified
|
195
|
+
# - `Gem::PathSupport#home` fell back to `Gem.user_dir`
|
196
|
+
# - GEM_HOME was manually set to `Gem.user_dir`
|
197
|
+
|
180
198
|
check_that_user_bin_dir_is_in_path
|
181
199
|
end
|
182
200
|
end
|
@@ -186,15 +204,15 @@ class Gem::Installer
|
|
186
204
|
#
|
187
205
|
# If +@force+ is set +filename+ is overwritten.
|
188
206
|
#
|
189
|
-
# If +filename+ exists and is a RubyGems wrapper for different gem
|
190
|
-
# is consulted.
|
207
|
+
# If +filename+ exists and it is a RubyGems wrapper for a different gem, then
|
208
|
+
# the user is consulted.
|
191
209
|
#
|
192
210
|
# If +filename+ exists and +@bin_dir+ is Gem.default_bindir (/usr/local) the
|
193
211
|
# user is consulted.
|
194
212
|
#
|
195
213
|
# Otherwise +filename+ is overwritten.
|
196
214
|
|
197
|
-
def check_executable_overwrite
|
215
|
+
def check_executable_overwrite(filename) # :nodoc:
|
198
216
|
return if @force
|
199
217
|
|
200
218
|
generated_bin = File.join @bin_dir, formatted_program_filename(filename)
|
@@ -204,33 +222,45 @@ class Gem::Installer
|
|
204
222
|
ruby_executable = false
|
205
223
|
existing = nil
|
206
224
|
|
207
|
-
open generated_bin,
|
208
|
-
|
225
|
+
File.open generated_bin, "rb" do |io|
|
226
|
+
line = io.gets
|
227
|
+
shebang = /^#!.*ruby/o
|
228
|
+
|
229
|
+
# TruffleRuby uses a bash prelude in default launchers
|
230
|
+
if load_relative_enabled? || RUBY_ENGINE == "truffleruby"
|
231
|
+
until line.nil? || shebang.match?(line) do
|
232
|
+
line = io.gets
|
233
|
+
end
|
234
|
+
end
|
235
|
+
|
236
|
+
next unless line&.match?(shebang)
|
237
|
+
|
209
238
|
io.gets # blankline
|
210
239
|
|
211
|
-
# TODO detect a specially formatted comment instead of trying
|
212
|
-
# to
|
213
|
-
next unless io.gets
|
240
|
+
# TODO: detect a specially formatted comment instead of trying
|
241
|
+
# to find a string inside Ruby code.
|
242
|
+
next unless io.gets&.include?("This file was generated by RubyGems")
|
214
243
|
|
215
244
|
ruby_executable = true
|
216
|
-
existing = io.read.slice(
|
217
|
-
|
245
|
+
existing = io.read.slice(/
|
246
|
+
^\s*(
|
218
247
|
gem \s |
|
219
|
-
load \s Gem\.bin_path\(
|
248
|
+
load \s Gem\.bin_path\( |
|
249
|
+
load \s Gem\.activate_bin_path\(
|
220
250
|
)
|
221
251
|
(['"])(.*?)(\2),
|
222
|
-
|
252
|
+
/x, 3)
|
223
253
|
end
|
224
254
|
|
225
255
|
return if spec.name == existing
|
226
256
|
|
227
257
|
# somebody has written to RubyGems' directory, overwrite, too bad
|
228
|
-
return if Gem.default_bindir != @bin_dir
|
258
|
+
return if Gem.default_bindir != @bin_dir && !ruby_executable
|
229
259
|
|
230
260
|
question = "#{spec.name}'s executable \"#{filename}\" conflicts with ".dup
|
231
261
|
|
232
|
-
if ruby_executable
|
233
|
-
question << existing
|
262
|
+
if ruby_executable
|
263
|
+
question << (existing || "an unknown executable")
|
234
264
|
|
235
265
|
return if ask_yes_no "#{question}\nOverwrite the executable?", false
|
236
266
|
|
@@ -259,8 +289,6 @@ class Gem::Installer
|
|
259
289
|
|
260
290
|
def spec
|
261
291
|
@package.spec
|
262
|
-
rescue Gem::Package::Error => e
|
263
|
-
raise Gem::InstallError, "invalid gem: #{e.message}"
|
264
292
|
end
|
265
293
|
|
266
294
|
##
|
@@ -277,67 +305,76 @@ class Gem::Installer
|
|
277
305
|
def install
|
278
306
|
pre_install_checks
|
279
307
|
|
280
|
-
FileUtils.rm_f File.join gem_home, 'specifications', spec.spec_name
|
281
|
-
|
282
308
|
run_pre_install_hooks
|
283
309
|
|
310
|
+
# Set loaded_from to ensure extension_dir is correct
|
311
|
+
if @options[:install_as_default]
|
312
|
+
spec.loaded_from = default_spec_file
|
313
|
+
else
|
314
|
+
spec.loaded_from = spec_file
|
315
|
+
end
|
316
|
+
|
284
317
|
# Completely remove any previous gem files
|
285
318
|
FileUtils.rm_rf gem_dir
|
319
|
+
FileUtils.rm_rf spec.extension_dir
|
286
320
|
|
287
|
-
|
321
|
+
dir_mode = options[:dir_mode]
|
322
|
+
FileUtils.mkdir_p gem_dir, mode: dir_mode && 0o755
|
288
323
|
|
289
324
|
if @options[:install_as_default]
|
290
|
-
spec.loaded_from = default_spec_file
|
291
325
|
extract_bin
|
292
326
|
write_default_spec
|
293
327
|
else
|
294
|
-
spec.loaded_from = spec_file
|
295
328
|
extract_files
|
296
329
|
|
297
330
|
build_extensions
|
298
331
|
write_build_info_file
|
299
332
|
run_post_build_hooks
|
333
|
+
end
|
334
|
+
|
335
|
+
generate_bin
|
336
|
+
generate_plugins
|
300
337
|
|
301
|
-
|
338
|
+
unless @options[:install_as_default]
|
302
339
|
write_spec
|
303
340
|
write_cache_file
|
304
341
|
end
|
305
342
|
|
343
|
+
File.chmod(dir_mode, gem_dir) if dir_mode
|
344
|
+
|
306
345
|
say spec.post_install_message if options[:post_install_message] && !spec.post_install_message.nil?
|
307
346
|
|
308
|
-
Gem::
|
347
|
+
Gem::Specification.add_spec(spec)
|
348
|
+
|
349
|
+
load_plugin
|
309
350
|
|
310
351
|
run_post_install_hooks
|
311
352
|
|
312
353
|
spec
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
rescue Zlib::GzipFile::Error
|
317
|
-
raise Gem::InstallError, "gzip error installing #{gem}"
|
354
|
+
rescue Errno::EACCES => e
|
355
|
+
# Permission denied - /path/to/foo
|
356
|
+
raise Gem::FilePermissionError, e.message.split(" - ").last
|
318
357
|
end
|
319
358
|
|
320
359
|
def run_pre_install_hooks # :nodoc:
|
321
360
|
Gem.pre_install_hooks.each do |hook|
|
322
|
-
|
323
|
-
|
361
|
+
next unless hook.call(self) == false
|
362
|
+
location = " at #{$1}" if hook.inspect =~ /[ @](.*:\d+)/
|
324
363
|
|
325
|
-
|
326
|
-
|
327
|
-
end
|
364
|
+
message = "pre-install hook#{location} failed for #{spec.full_name}"
|
365
|
+
raise Gem::InstallError, message
|
328
366
|
end
|
329
367
|
end
|
330
368
|
|
331
369
|
def run_post_build_hooks # :nodoc:
|
332
370
|
Gem.post_build_hooks.each do |hook|
|
333
|
-
|
334
|
-
|
371
|
+
next unless hook.call(self) == false
|
372
|
+
FileUtils.rm_rf gem_dir
|
335
373
|
|
336
|
-
|
374
|
+
location = " at #{$1}" if hook.inspect =~ /[ @](.*:\d+)/
|
337
375
|
|
338
|
-
|
339
|
-
|
340
|
-
end
|
376
|
+
message = "post-build hook#{location} failed for #{spec.full_name}"
|
377
|
+
raise Gem::InstallError, message
|
341
378
|
end
|
342
379
|
end
|
343
380
|
|
@@ -353,11 +390,11 @@ class Gem::Installer
|
|
353
390
|
# we'll be installing into.
|
354
391
|
|
355
392
|
def installed_specs
|
356
|
-
@
|
393
|
+
@installed_specs ||= begin
|
357
394
|
specs = []
|
358
395
|
|
359
|
-
|
360
|
-
spec = Gem::Specification.load path
|
396
|
+
Gem::Util.glob_files_in_dir("*.gemspec", File.join(gem_home, "specifications")).each do |path|
|
397
|
+
spec = Gem::Specification.load path
|
361
398
|
specs << spec if spec
|
362
399
|
end
|
363
400
|
|
@@ -373,7 +410,7 @@ class Gem::Installer
|
|
373
410
|
# dependency :: Gem::Dependency
|
374
411
|
|
375
412
|
def ensure_dependency(spec, dependency)
|
376
|
-
unless installation_satisfies_dependency? dependency
|
413
|
+
unless installation_satisfies_dependency? dependency
|
377
414
|
raise Gem::InstallError, "#{spec.name} requires #{dependency}"
|
378
415
|
end
|
379
416
|
true
|
@@ -383,10 +420,10 @@ class Gem::Installer
|
|
383
420
|
# True if the gems in the system satisfy +dependency+.
|
384
421
|
|
385
422
|
def installation_satisfies_dependency?(dependency)
|
386
|
-
return true if @options[:development]
|
387
|
-
return true if installed_specs.detect {
|
423
|
+
return true if @options[:development] && dependency.type == :development
|
424
|
+
return true if installed_specs.detect {|s| dependency.matches_spec? s }
|
388
425
|
return false if @only_install_dir
|
389
|
-
|
426
|
+
!dependency.matching_specs.empty?
|
390
427
|
end
|
391
428
|
|
392
429
|
##
|
@@ -396,6 +433,7 @@ class Gem::Installer
|
|
396
433
|
@gem_dir = directory
|
397
434
|
extract_files
|
398
435
|
end
|
436
|
+
rubygems_deprecate :unpack
|
399
437
|
|
400
438
|
##
|
401
439
|
# The location of the spec file that is installed.
|
@@ -410,7 +448,7 @@ class Gem::Installer
|
|
410
448
|
#
|
411
449
|
|
412
450
|
def default_spec_file
|
413
|
-
File.join
|
451
|
+
File.join gem_home, "specifications", "default", "#{spec.full_name}.gemspec"
|
414
452
|
end
|
415
453
|
|
416
454
|
##
|
@@ -418,33 +456,30 @@ class Gem::Installer
|
|
418
456
|
# specifications directory.
|
419
457
|
|
420
458
|
def write_spec
|
421
|
-
|
422
|
-
spec.installed_by_version = Gem.rubygems_version
|
423
|
-
|
424
|
-
file.puts spec.to_ruby_for_cache
|
459
|
+
spec.installed_by_version = Gem.rubygems_version
|
425
460
|
|
426
|
-
|
427
|
-
end
|
461
|
+
Gem.write_binary(spec_file, spec.to_ruby_for_cache)
|
428
462
|
end
|
429
463
|
|
430
464
|
##
|
431
465
|
# Writes the full .gemspec specification (in Ruby) to the gem home's
|
432
466
|
# specifications/default directory.
|
467
|
+
#
|
468
|
+
# In contrast to #write_spec, this keeps file lists, so the `gem contents`
|
469
|
+
# command works.
|
433
470
|
|
434
471
|
def write_default_spec
|
435
|
-
|
436
|
-
file.puts spec.to_ruby
|
437
|
-
end
|
472
|
+
Gem.write_binary(default_spec_file, spec.to_ruby)
|
438
473
|
end
|
439
474
|
|
440
475
|
##
|
441
476
|
# Creates windows .bat files for easy running of commands
|
442
477
|
|
443
478
|
def generate_windows_script(filename, bindir)
|
444
|
-
if Gem.win_platform?
|
445
|
-
script_name = filename + ".bat"
|
479
|
+
if Gem.win_platform?
|
480
|
+
script_name = formatted_program_filename(filename) + ".bat"
|
446
481
|
script_path = File.join bindir, File.basename(script_name)
|
447
|
-
File.open script_path,
|
482
|
+
File.open script_path, "w" do |file|
|
448
483
|
file.puts windows_stub_script(bindir, filename)
|
449
484
|
end
|
450
485
|
|
@@ -453,33 +488,45 @@ class Gem::Installer
|
|
453
488
|
end
|
454
489
|
|
455
490
|
def generate_bin # :nodoc:
|
456
|
-
return if spec.executables.nil?
|
491
|
+
return if spec.executables.nil? || spec.executables.empty?
|
457
492
|
|
458
|
-
|
459
|
-
raise Gem::FilePermissionError.new(@bin_dir) unless File.writable? @bin_dir
|
493
|
+
ensure_writable_dir @bin_dir
|
460
494
|
|
461
495
|
spec.executables.each do |filename|
|
462
|
-
filename.untaint
|
463
496
|
bin_path = File.join gem_dir, spec.bindir, filename
|
464
|
-
|
465
|
-
unless File.exist? bin_path then
|
466
|
-
# TODO change this to a more useful warning
|
467
|
-
warn "#{bin_path} maybe `gem pristine #{spec.name}` will fix it?"
|
468
|
-
next
|
469
|
-
end
|
497
|
+
next unless File.exist? bin_path
|
470
498
|
|
471
499
|
mode = File.stat(bin_path).mode
|
472
|
-
|
500
|
+
dir_mode = options[:prog_mode] || (mode | 0o111)
|
501
|
+
|
502
|
+
unless dir_mode == mode
|
503
|
+
require "fileutils"
|
504
|
+
FileUtils.chmod dir_mode, bin_path
|
505
|
+
end
|
473
506
|
|
474
507
|
check_executable_overwrite filename
|
475
508
|
|
476
|
-
if @wrappers
|
509
|
+
if @wrappers
|
477
510
|
generate_bin_script filename, @bin_dir
|
478
511
|
else
|
479
512
|
generate_bin_symlink filename, @bin_dir
|
480
513
|
end
|
514
|
+
end
|
515
|
+
end
|
516
|
+
|
517
|
+
def generate_plugins # :nodoc:
|
518
|
+
latest = Gem::Specification.latest_spec_for(spec.name)
|
519
|
+
return if latest && latest.version > spec.version
|
481
520
|
|
521
|
+
ensure_writable_dir @plugins_dir
|
522
|
+
|
523
|
+
if spec.plugins.empty?
|
524
|
+
remove_plugins_for(spec, @plugins_dir)
|
525
|
+
else
|
526
|
+
regenerate_plugins_for(spec, @plugins_dir)
|
482
527
|
end
|
528
|
+
rescue ArgumentError => e
|
529
|
+
raise e, "#{latest.name} #{latest.version} #{spec.name} #{spec.version}: #{e.message}"
|
483
530
|
end
|
484
531
|
|
485
532
|
##
|
@@ -487,15 +534,17 @@ class Gem::Installer
|
|
487
534
|
#--
|
488
535
|
# The Windows script is generated in addition to the regular one due to a
|
489
536
|
# bug or misfeature in the Windows shell's pipe. See
|
490
|
-
#
|
537
|
+
# https://blade.ruby-lang.org/ruby-talk/193379
|
491
538
|
|
492
539
|
def generate_bin_script(filename, bindir)
|
493
540
|
bin_script_path = File.join bindir, formatted_program_filename(filename)
|
494
541
|
|
542
|
+
require "fileutils"
|
495
543
|
FileUtils.rm_f bin_script_path # prior install may have been --no-wrappers
|
496
544
|
|
497
|
-
File.open bin_script_path,
|
545
|
+
File.open bin_script_path, "wb", 0o755 do |file|
|
498
546
|
file.print app_script_text(filename)
|
547
|
+
file.chmod(options[:prog_mode] || 0o755)
|
499
548
|
end
|
500
549
|
|
501
550
|
verbose bin_script_path
|
@@ -508,25 +557,22 @@ class Gem::Installer
|
|
508
557
|
# the symlink if the gem being installed has a newer version.
|
509
558
|
|
510
559
|
def generate_bin_symlink(filename, bindir)
|
511
|
-
if Gem.win_platform? then
|
512
|
-
alert_warning "Unable to use symlinks on Windows, installing wrapper"
|
513
|
-
generate_bin_script filename, bindir
|
514
|
-
return
|
515
|
-
end
|
516
|
-
|
517
560
|
src = File.join gem_dir, spec.bindir, filename
|
518
561
|
dst = File.join bindir, formatted_program_filename(filename)
|
519
562
|
|
520
|
-
if File.exist? dst
|
521
|
-
if File.symlink? dst
|
563
|
+
if File.exist? dst
|
564
|
+
if File.symlink? dst
|
522
565
|
link = File.readlink(dst).split File::SEPARATOR
|
523
|
-
cur_version = Gem::Version.create(link[-3].sub(/^.*-/,
|
566
|
+
cur_version = Gem::Version.create(link[-3].sub(/^.*-/, ""))
|
524
567
|
return if spec.version < cur_version
|
525
568
|
end
|
526
569
|
File.unlink dst
|
527
570
|
end
|
528
571
|
|
529
|
-
FileUtils.symlink src, dst, :
|
572
|
+
FileUtils.symlink src, dst, verbose: Gem.configuration.really_verbose
|
573
|
+
rescue NotImplementedError, SystemCallError
|
574
|
+
alert_warning "Unable to use symlinks, installing wrapper"
|
575
|
+
generate_bin_script filename, bindir
|
530
576
|
end
|
531
577
|
|
532
578
|
##
|
@@ -545,11 +591,10 @@ class Gem::Installer
|
|
545
591
|
#
|
546
592
|
|
547
593
|
def shebang(bin_file_name)
|
548
|
-
ruby_name = RbConfig::CONFIG['ruby_install_name'] if @env_shebang
|
549
594
|
path = File.join gem_dir, spec.bindir, bin_file_name
|
550
|
-
first_line = File.open(path, "rb")
|
595
|
+
first_line = File.open(path, "rb", &:gets) || ""
|
551
596
|
|
552
|
-
if
|
597
|
+
if first_line.start_with?("#!")
|
553
598
|
# Preserve extra words on shebang line, like "-w". Thanks RPA.
|
554
599
|
shebang = first_line.sub(/\A\#!.*?ruby\S*((\s+\S+)+)/, "#!#{Gem.ruby}")
|
555
600
|
opts = $1
|
@@ -558,7 +603,7 @@ class Gem::Installer
|
|
558
603
|
|
559
604
|
if which = Gem.configuration[:custom_shebang]
|
560
605
|
# replace bin_file_name with "ruby" to avoid endless loops
|
561
|
-
which = which.gsub(/ #{bin_file_name}$/," #{
|
606
|
+
which = which.gsub(/ #{bin_file_name}$/," #{ruby_install_name}")
|
562
607
|
|
563
608
|
which = which.gsub(/\$(\w+)/) do
|
564
609
|
case $1
|
@@ -574,14 +619,12 @@ class Gem::Installer
|
|
574
619
|
end
|
575
620
|
|
576
621
|
"#!#{which}"
|
577
|
-
elsif
|
578
|
-
"#!#{Gem.ruby}#{opts}"
|
579
|
-
elsif opts then
|
580
|
-
"#!/bin/sh\n'exec' #{ruby_name.dump} '-x' \"$0\" \"$@\"\n#{shebang}"
|
581
|
-
else
|
622
|
+
elsif @env_shebang
|
582
623
|
# Create a plain shebang line.
|
583
624
|
@env_path ||= ENV_PATHS.find {|env_path| File.executable? env_path }
|
584
|
-
"#!#{@env_path} #{
|
625
|
+
"#!#{@env_path} #{ruby_install_name}"
|
626
|
+
else
|
627
|
+
"#{bash_prolog_script}#!#{Gem.ruby}#{opts}"
|
585
628
|
end
|
586
629
|
end
|
587
630
|
|
@@ -591,7 +634,6 @@ class Gem::Installer
|
|
591
634
|
|
592
635
|
def ensure_loadable_spec
|
593
636
|
ruby = spec.to_ruby_for_cache
|
594
|
-
ruby.untaint
|
595
637
|
|
596
638
|
begin
|
597
639
|
eval ruby
|
@@ -601,24 +643,6 @@ class Gem::Installer
|
|
601
643
|
end
|
602
644
|
end
|
603
645
|
|
604
|
-
def ensure_required_ruby_version_met # :nodoc:
|
605
|
-
if rrv = spec.required_ruby_version then
|
606
|
-
unless rrv.satisfied_by? Gem.ruby_version then
|
607
|
-
raise Gem::InstallError, "#{spec.name} requires Ruby version #{rrv}."
|
608
|
-
end
|
609
|
-
end
|
610
|
-
end
|
611
|
-
|
612
|
-
def ensure_required_rubygems_version_met # :nodoc:
|
613
|
-
if rrgv = spec.required_rubygems_version then
|
614
|
-
unless rrgv.satisfied_by? Gem.rubygems_version then
|
615
|
-
raise Gem::InstallError,
|
616
|
-
"#{spec.name} requires RubyGems version #{rrgv}. " +
|
617
|
-
"Try 'gem update --system' to update RubyGems itself."
|
618
|
-
end
|
619
|
-
end
|
620
|
-
end
|
621
|
-
|
622
646
|
def ensure_dependencies_met # :nodoc:
|
623
647
|
deps = spec.runtime_dependencies
|
624
648
|
deps |= spec.development_dependencies if @development
|
@@ -630,74 +654,110 @@ class Gem::Installer
|
|
630
654
|
|
631
655
|
def process_options # :nodoc:
|
632
656
|
@options = {
|
633
|
-
:
|
634
|
-
:
|
635
|
-
:
|
636
|
-
:
|
637
|
-
:
|
657
|
+
bin_dir: nil,
|
658
|
+
env_shebang: false,
|
659
|
+
force: false,
|
660
|
+
only_install_dir: false,
|
661
|
+
post_install_message: true,
|
638
662
|
}.merge options
|
639
663
|
|
640
664
|
@env_shebang = options[:env_shebang]
|
641
665
|
@force = options[:force]
|
642
666
|
@install_dir = options[:install_dir]
|
643
|
-
@
|
667
|
+
@user_install = options[:user_install]
|
644
668
|
@ignore_dependencies = options[:ignore_dependencies]
|
645
669
|
@format_executable = options[:format_executable]
|
646
670
|
@wrappers = options[:wrappers]
|
647
671
|
@only_install_dir = options[:only_install_dir]
|
648
672
|
|
673
|
+
@bin_dir = options[:bin_dir]
|
674
|
+
@development = options[:development]
|
675
|
+
@build_root = options[:build_root]
|
676
|
+
|
677
|
+
@build_args = options[:build_args]
|
678
|
+
|
679
|
+
@gem_home = @install_dir || user_install_dir || Gem.dir
|
680
|
+
|
649
681
|
# If the user has asked for the gem to be installed in a directory that is
|
650
682
|
# the system gem directory, then use the system bin directory, else create
|
651
683
|
# (or use) a new bin dir under the gem_home.
|
652
|
-
@bin_dir
|
653
|
-
@development = options[:development]
|
654
|
-
@build_root = options[:build_root]
|
684
|
+
@bin_dir ||= Gem.bindir(@gem_home)
|
655
685
|
|
656
|
-
@
|
686
|
+
@plugins_dir = Gem.plugindir(@gem_home)
|
657
687
|
|
658
688
|
unless @build_root.nil?
|
659
|
-
|
660
|
-
@
|
661
|
-
@
|
662
|
-
|
663
|
-
alert_warning "You build with buildroot.\n Build root: #{@build_root}\n Bin dir: #{@bin_dir}\n Gem home: #{@gem_home}"
|
689
|
+
@bin_dir = File.join(@build_root, @bin_dir.gsub(/^[a-zA-Z]:/, ""))
|
690
|
+
@gem_home = File.join(@build_root, @gem_home.gsub(/^[a-zA-Z]:/, ""))
|
691
|
+
@plugins_dir = File.join(@build_root, @plugins_dir.gsub(/^[a-zA-Z]:/, ""))
|
692
|
+
alert_warning "You build with buildroot.\n Build root: #{@build_root}\n Bin dir: #{@bin_dir}\n Gem home: #{@gem_home}\n Plugins dir: #{@plugins_dir}"
|
664
693
|
end
|
665
694
|
end
|
666
695
|
|
667
696
|
def check_that_user_bin_dir_is_in_path # :nodoc:
|
697
|
+
return if self.class.path_warning
|
698
|
+
|
668
699
|
user_bin_dir = @bin_dir || Gem.bindir(gem_home)
|
669
|
-
user_bin_dir = user_bin_dir.
|
670
|
-
|
700
|
+
user_bin_dir = user_bin_dir.tr(File::ALT_SEPARATOR, File::SEPARATOR) if File::ALT_SEPARATOR
|
701
|
+
|
702
|
+
path = ENV["PATH"]
|
703
|
+
path = path.tr(File::ALT_SEPARATOR, File::SEPARATOR) if File::ALT_SEPARATOR
|
671
704
|
|
672
|
-
|
673
|
-
if Gem.win_platform? then
|
705
|
+
if Gem.win_platform?
|
674
706
|
path = path.downcase
|
675
707
|
user_bin_dir = user_bin_dir.downcase
|
676
708
|
end
|
677
709
|
|
678
710
|
path = path.split(File::PATH_SEPARATOR)
|
679
711
|
|
680
|
-
unless path.include? user_bin_dir
|
681
|
-
unless !Gem.win_platform? && (path.include? user_bin_dir.sub(ENV[
|
682
|
-
|
683
|
-
|
684
|
-
self.class.path_warning = true
|
685
|
-
end
|
712
|
+
unless path.include? user_bin_dir
|
713
|
+
unless !Gem.win_platform? && (path.include? user_bin_dir.sub(ENV["HOME"], "~"))
|
714
|
+
alert_warning "You don't have #{user_bin_dir} in your PATH,\n\t gem executables will not run."
|
715
|
+
self.class.path_warning = true
|
686
716
|
end
|
687
717
|
end
|
688
718
|
end
|
689
719
|
|
690
|
-
def verify_gem_home
|
691
|
-
FileUtils.mkdir_p gem_home
|
692
|
-
|
693
|
-
|
720
|
+
def verify_gem_home # :nodoc:
|
721
|
+
FileUtils.mkdir_p gem_home, mode: options[:dir_mode] && 0o755
|
722
|
+
end
|
723
|
+
|
724
|
+
def verify_spec
|
725
|
+
unless Gem::Specification::VALID_NAME_PATTERN.match?(spec.name)
|
726
|
+
raise Gem::InstallError, "#{spec} has an invalid name"
|
727
|
+
end
|
728
|
+
|
729
|
+
if spec.raw_require_paths.any? {|path| path =~ /\R/ }
|
730
|
+
raise Gem::InstallError, "#{spec} has an invalid require_paths"
|
731
|
+
end
|
732
|
+
|
733
|
+
if spec.extensions.any? {|ext| ext =~ /\R/ }
|
734
|
+
raise Gem::InstallError, "#{spec} has an invalid extensions"
|
735
|
+
end
|
736
|
+
|
737
|
+
if /\R/.match?(spec.platform.to_s)
|
738
|
+
raise Gem::InstallError, "#{spec.platform} is an invalid platform"
|
739
|
+
end
|
740
|
+
|
741
|
+
unless /\A\d+\z/.match?(spec.specification_version.to_s)
|
742
|
+
raise Gem::InstallError, "#{spec} has an invalid specification_version"
|
743
|
+
end
|
744
|
+
|
745
|
+
if spec.dependencies.any? {|dep| dep.type != :runtime && dep.type != :development }
|
746
|
+
raise Gem::InstallError, "#{spec} has an invalid dependencies"
|
747
|
+
end
|
748
|
+
|
749
|
+
if spec.dependencies.any? {|dep| dep.name =~ /(?:\R|[<>])/ }
|
750
|
+
raise Gem::InstallError, "#{spec} has an invalid dependencies"
|
751
|
+
end
|
694
752
|
end
|
695
753
|
|
696
754
|
##
|
697
755
|
# Return the text for an application file.
|
698
756
|
|
699
757
|
def app_script_text(bin_file_name)
|
700
|
-
|
758
|
+
# NOTE: that the `load` lines cannot be indented, as old RG versions match
|
759
|
+
# against the beginning of the line
|
760
|
+
<<-TEXT
|
701
761
|
#{shebang bin_file_name}
|
702
762
|
#
|
703
763
|
# This file was generated by RubyGems.
|
@@ -707,19 +767,43 @@ class Gem::Installer
|
|
707
767
|
#
|
708
768
|
|
709
769
|
require 'rubygems'
|
710
|
-
|
711
|
-
version = "#{Gem::Requirement.
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
str = str.
|
716
|
-
if str
|
717
|
-
|
770
|
+
#{gemdeps_load(spec.name)}
|
771
|
+
version = "#{Gem::Requirement.default_prerelease}"
|
772
|
+
|
773
|
+
str = ARGV.first
|
774
|
+
if str
|
775
|
+
str = str.b[/\\A_(.*)_\\z/, 1]
|
776
|
+
if str and Gem::Version.correct?(str)
|
777
|
+
#{explicit_version_requirement(spec.name)}
|
718
778
|
ARGV.shift
|
719
779
|
end
|
720
780
|
end
|
721
781
|
|
722
|
-
|
782
|
+
if Gem.respond_to?(:activate_bin_path)
|
783
|
+
load Gem.activate_bin_path('#{spec.name}', '#{bin_file_name}', version)
|
784
|
+
else
|
785
|
+
gem #{spec.name.dump}, version
|
786
|
+
load Gem.bin_path(#{spec.name.dump}, #{bin_file_name.dump}, version)
|
787
|
+
end
|
788
|
+
TEXT
|
789
|
+
end
|
790
|
+
|
791
|
+
def gemdeps_load(name)
|
792
|
+
return "" if name == "bundler"
|
793
|
+
|
794
|
+
<<-TEXT
|
795
|
+
|
796
|
+
Gem.use_gemdeps
|
797
|
+
TEXT
|
798
|
+
end
|
799
|
+
|
800
|
+
def explicit_version_requirement(name)
|
801
|
+
code = "version = str"
|
802
|
+
return code unless name == "bundler"
|
803
|
+
|
804
|
+
code += <<-TEXT
|
805
|
+
|
806
|
+
ENV['BUNDLER_VERSION'] = str
|
723
807
|
TEXT
|
724
808
|
end
|
725
809
|
|
@@ -727,38 +811,47 @@ TEXT
|
|
727
811
|
# return the stub script text used to launch the true Ruby script
|
728
812
|
|
729
813
|
def windows_stub_script(bindir, bin_file_name)
|
730
|
-
|
731
|
-
|
814
|
+
rb_topdir = RbConfig::TOPDIR || File.dirname(rb_config["bindir"])
|
815
|
+
|
816
|
+
# get ruby executable file name from RbConfig
|
817
|
+
ruby_exe = "#{rb_config["RUBY_INSTALL_NAME"]}#{rb_config["EXEEXT"]}"
|
818
|
+
ruby_exe = "ruby.exe" if ruby_exe.empty?
|
819
|
+
|
820
|
+
if File.exist?(File.join(bindir, ruby_exe))
|
821
|
+
# stub & ruby.exe within same folder. Portable
|
822
|
+
<<-TEXT
|
732
823
|
@ECHO OFF
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
824
|
+
@"%~dp0#{ruby_exe}" "%~dpn0" %*
|
825
|
+
TEXT
|
826
|
+
elsif bindir.downcase.start_with? rb_topdir.downcase
|
827
|
+
# stub within ruby folder, but not standard bin. Portable
|
828
|
+
require "pathname"
|
829
|
+
from = Pathname.new bindir
|
830
|
+
to = Pathname.new "#{rb_topdir}/bin"
|
831
|
+
rel = to.relative_path_from from
|
832
|
+
<<-TEXT
|
833
|
+
@ECHO OFF
|
834
|
+
@"%~dp0#{rel}/#{ruby_exe}" "%~dpn0" %*
|
835
|
+
TEXT
|
836
|
+
else
|
837
|
+
# outside ruby folder, maybe -user-install or bundler. Portable, but ruby
|
838
|
+
# is dependent on PATH
|
839
|
+
<<-TEXT
|
840
|
+
@ECHO OFF
|
841
|
+
@#{ruby_exe} "%~dpn0" %*
|
842
|
+
TEXT
|
843
|
+
end
|
739
844
|
end
|
740
|
-
|
741
845
|
##
|
742
846
|
# Builds extensions. Valid types of extensions are extconf.rb files,
|
743
847
|
# configure scripts and rakefiles or mkrf_conf files.
|
744
848
|
|
745
849
|
def build_extensions
|
746
|
-
builder = Gem::Ext::Builder.new spec,
|
850
|
+
builder = Gem::Ext::Builder.new spec, build_args
|
747
851
|
|
748
852
|
builder.build_extensions
|
749
853
|
end
|
750
854
|
|
751
|
-
##
|
752
|
-
# Logs the build +output+ in +build_dir+, then raises Gem::Ext::BuildError.
|
753
|
-
#
|
754
|
-
# TODO: Delete this for RubyGems 3. It remains for API compatibility
|
755
|
-
|
756
|
-
def extension_build_error(build_dir, output, backtrace = nil) # :nodoc:
|
757
|
-
builder = Gem::Ext::Builder.new spec, @build_args
|
758
|
-
|
759
|
-
builder.build_error build_dir, output, backtrace
|
760
|
-
end
|
761
|
-
|
762
855
|
##
|
763
856
|
# Reads the file index and extracts each file into the gem directory.
|
764
857
|
#
|
@@ -774,14 +867,14 @@ TEXT
|
|
774
867
|
# without the full gem installed.
|
775
868
|
|
776
869
|
def extract_bin
|
777
|
-
@package.extract_files gem_dir, "
|
870
|
+
@package.extract_files gem_dir, "#{spec.bindir}/*"
|
778
871
|
end
|
779
872
|
|
780
873
|
##
|
781
874
|
# Prefix and suffix the program filename the same as ruby.
|
782
875
|
|
783
876
|
def formatted_program_filename(filename)
|
784
|
-
if @format_executable
|
877
|
+
if @format_executable
|
785
878
|
self.class.exec_format % File.basename(filename)
|
786
879
|
else
|
787
880
|
filename
|
@@ -798,6 +891,13 @@ TEXT
|
|
798
891
|
gem_dir.to_s
|
799
892
|
end
|
800
893
|
|
894
|
+
##
|
895
|
+
# Filename of the gem being installed.
|
896
|
+
|
897
|
+
def gem
|
898
|
+
@package.gem.path
|
899
|
+
end
|
900
|
+
|
801
901
|
##
|
802
902
|
# Performs various checks before installing the gem such as the install
|
803
903
|
# repository is writable and its directories exist, required Ruby and
|
@@ -805,10 +905,14 @@ TEXT
|
|
805
905
|
#
|
806
906
|
# Version and dependency checks are skipped if this install is forced.
|
807
907
|
#
|
808
|
-
# The dependent check will be skipped
|
908
|
+
# The dependent check will be skipped if the install is ignoring dependencies.
|
809
909
|
|
810
910
|
def pre_install_checks
|
811
|
-
verify_gem_home
|
911
|
+
verify_gem_home
|
912
|
+
|
913
|
+
# The name and require_paths must be verified first, since it could contain
|
914
|
+
# ruby code that would be eval'ed in #ensure_loadable_spec
|
915
|
+
verify_spec
|
812
916
|
|
813
917
|
ensure_loadable_spec
|
814
918
|
|
@@ -820,8 +924,6 @@ TEXT
|
|
820
924
|
|
821
925
|
return true if @force
|
822
926
|
|
823
|
-
ensure_required_ruby_version_met
|
824
|
-
ensure_required_rubygems_version_met
|
825
927
|
ensure_dependencies_met unless @ignore_dependencies
|
826
928
|
|
827
929
|
true
|
@@ -832,27 +934,107 @@ TEXT
|
|
832
934
|
# extensions.
|
833
935
|
|
834
936
|
def write_build_info_file
|
835
|
-
return if
|
937
|
+
return if build_args.empty?
|
836
938
|
|
837
|
-
build_info_dir = File.join gem_home,
|
939
|
+
build_info_dir = File.join gem_home, "build_info"
|
838
940
|
|
839
|
-
|
941
|
+
dir_mode = options[:dir_mode]
|
942
|
+
FileUtils.mkdir_p build_info_dir, mode: dir_mode && 0o755
|
840
943
|
|
841
944
|
build_info_file = File.join build_info_dir, "#{spec.full_name}.info"
|
842
945
|
|
843
|
-
open build_info_file,
|
844
|
-
|
946
|
+
File.open build_info_file, "w" do |io|
|
947
|
+
build_args.each do |arg|
|
845
948
|
io.puts arg
|
846
949
|
end
|
847
950
|
end
|
951
|
+
|
952
|
+
File.chmod(dir_mode, build_info_dir) if dir_mode
|
848
953
|
end
|
849
954
|
|
850
955
|
##
|
851
956
|
# Writes the .gem file to the cache directory
|
852
957
|
|
853
958
|
def write_cache_file
|
854
|
-
cache_file = File.join gem_home,
|
959
|
+
cache_file = File.join gem_home, "cache", spec.file_name
|
855
960
|
@package.copy_to cache_file
|
856
961
|
end
|
857
962
|
|
963
|
+
def ensure_writable_dir(dir) # :nodoc:
|
964
|
+
begin
|
965
|
+
Dir.mkdir dir, *[options[:dir_mode] && 0o755].compact
|
966
|
+
rescue SystemCallError
|
967
|
+
raise unless File.directory? dir
|
968
|
+
end
|
969
|
+
|
970
|
+
raise Gem::FilePermissionError.new(dir) unless File.writable? dir
|
971
|
+
end
|
972
|
+
|
973
|
+
private
|
974
|
+
|
975
|
+
def user_install_dir
|
976
|
+
# never install to user home in --build-root mode
|
977
|
+
return unless @build_root.nil?
|
978
|
+
|
979
|
+
# Please note that @user_install might have three states:
|
980
|
+
# * `true`: `--user-install`
|
981
|
+
# * `false`: `--no-user-install` and
|
982
|
+
# * `nil`: option was not specified
|
983
|
+
if @user_install || (@user_install.nil? && Gem.default_user_install)
|
984
|
+
Gem.user_dir
|
985
|
+
end
|
986
|
+
end
|
987
|
+
|
988
|
+
def build_args
|
989
|
+
@build_args ||= begin
|
990
|
+
require_relative "command"
|
991
|
+
Gem::Command.build_args
|
992
|
+
end
|
993
|
+
end
|
994
|
+
|
995
|
+
def rb_config
|
996
|
+
RbConfig::CONFIG
|
997
|
+
end
|
998
|
+
|
999
|
+
def ruby_install_name
|
1000
|
+
rb_config["ruby_install_name"]
|
1001
|
+
end
|
1002
|
+
|
1003
|
+
def load_relative_enabled?
|
1004
|
+
rb_config["LIBRUBY_RELATIVE"] == "yes"
|
1005
|
+
end
|
1006
|
+
|
1007
|
+
def bash_prolog_script
|
1008
|
+
if load_relative_enabled?
|
1009
|
+
script = +<<~EOS
|
1010
|
+
bindir="${0%/*}"
|
1011
|
+
EOS
|
1012
|
+
|
1013
|
+
script << %(exec "$bindir/#{ruby_install_name}" "-x" "$0" "$@"\n)
|
1014
|
+
|
1015
|
+
<<~EOS
|
1016
|
+
#!/bin/sh
|
1017
|
+
# -*- ruby -*-
|
1018
|
+
_=_\\
|
1019
|
+
=begin
|
1020
|
+
#{script.chomp}
|
1021
|
+
=end
|
1022
|
+
EOS
|
1023
|
+
else
|
1024
|
+
""
|
1025
|
+
end
|
1026
|
+
end
|
1027
|
+
|
1028
|
+
def load_plugin
|
1029
|
+
specs = Gem::Specification.find_all_by_name(spec.name)
|
1030
|
+
# If old version already exists, this plugin isn't loaded
|
1031
|
+
# immediately. It's for avoiding a case that multiple versions
|
1032
|
+
# are loaded at the same time.
|
1033
|
+
return unless specs.size == 1
|
1034
|
+
|
1035
|
+
plugin_files = spec.plugins.map do |plugin|
|
1036
|
+
File.join(@plugins_dir, "#{spec.name}_plugin#{File.extname(plugin)}")
|
1037
|
+
end
|
1038
|
+
Gem.load_plugin_files(plugin_files)
|
1039
|
+
end
|
858
1040
|
end
|