rubygems-update 2.6.3 → 2.7.7
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rubygems-update might be problematic. Click here for more details.
- checksums.yaml +5 -5
- data/.travis.yml +17 -34
- data/CODE_OF_CONDUCT.md +36 -33
- data/CONTRIBUTING.rdoc +56 -55
- data/History.txt +467 -10
- data/Manifest.txt +276 -4
- data/POLICIES.rdoc +4 -4
- data/README.md +72 -0
- data/Rakefile +77 -10
- data/appveyor.yml +61 -31
- data/bin/gem +1 -1
- data/bin/update_rubygems +2 -2
- data/bundler/CHANGELOG.md +2910 -0
- data/bundler/CODE_OF_CONDUCT.md +42 -0
- data/bundler/CONTRIBUTING.md +17 -0
- data/bundler/LICENSE.md +23 -0
- data/bundler/README.md +63 -0
- data/bundler/bundler.gemspec +57 -0
- data/bundler/exe/bundle +31 -0
- data/bundler/exe/bundle_ruby +60 -0
- data/bundler/exe/bundler +4 -0
- data/bundler/lib/bundler/build_metadata.rb +36 -0
- data/bundler/lib/bundler/capistrano.rb +22 -0
- data/bundler/lib/bundler/cli/add.rb +25 -0
- data/bundler/lib/bundler/cli/binstubs.rb +43 -0
- data/bundler/lib/bundler/cli/cache.rb +36 -0
- data/bundler/lib/bundler/cli/check.rb +38 -0
- data/bundler/lib/bundler/cli/clean.rb +25 -0
- data/bundler/lib/bundler/cli/common.rb +102 -0
- data/bundler/lib/bundler/cli/config.rb +119 -0
- data/bundler/lib/bundler/cli/console.rb +43 -0
- data/bundler/lib/bundler/cli/doctor.rb +94 -0
- data/bundler/lib/bundler/cli/exec.rb +104 -0
- data/bundler/lib/bundler/cli/gem.rb +252 -0
- data/bundler/lib/bundler/cli/info.rb +50 -0
- data/bundler/lib/bundler/cli/init.rb +47 -0
- data/bundler/lib/bundler/cli/inject.rb +60 -0
- data/bundler/lib/bundler/cli/install.rb +214 -0
- data/bundler/lib/bundler/cli/issue.rb +40 -0
- data/bundler/lib/bundler/cli/list.rb +22 -0
- data/bundler/lib/bundler/cli/lock.rb +63 -0
- data/bundler/lib/bundler/cli/open.rb +26 -0
- data/bundler/lib/bundler/cli/outdated.rb +260 -0
- data/bundler/lib/bundler/cli/package.rb +49 -0
- data/bundler/lib/bundler/cli/platform.rb +46 -0
- data/bundler/lib/bundler/cli/plugin.rb +24 -0
- data/bundler/lib/bundler/cli/pristine.rb +43 -0
- data/bundler/lib/bundler/cli/show.rb +75 -0
- data/bundler/lib/bundler/cli/update.rb +91 -0
- data/bundler/lib/bundler/cli/viz.rb +31 -0
- data/bundler/lib/bundler/cli.rb +748 -0
- data/bundler/lib/bundler/compact_index_client/cache.rb +118 -0
- data/bundler/lib/bundler/compact_index_client/updater.rb +116 -0
- data/bundler/lib/bundler/compact_index_client.rb +109 -0
- data/bundler/lib/bundler/compatibility_guard.rb +14 -0
- data/bundler/lib/bundler/constants.rb +7 -0
- data/bundler/lib/bundler/current_ruby.rb +86 -0
- data/bundler/lib/bundler/definition.rb +989 -0
- data/bundler/lib/bundler/dep_proxy.rb +48 -0
- data/bundler/lib/bundler/dependency.rb +138 -0
- data/bundler/lib/bundler/deployment.rb +69 -0
- data/bundler/lib/bundler/deprecate.rb +43 -0
- data/bundler/lib/bundler/dsl.rb +599 -0
- data/bundler/lib/bundler/endpoint_specification.rb +141 -0
- data/bundler/lib/bundler/env.rb +153 -0
- data/bundler/lib/bundler/environment_preserver.rb +59 -0
- data/bundler/lib/bundler/errors.rb +158 -0
- data/bundler/lib/bundler/feature_flag.rb +67 -0
- data/bundler/lib/bundler/fetcher/base.rb +52 -0
- data/bundler/lib/bundler/fetcher/compact_index.rb +126 -0
- data/bundler/lib/bundler/fetcher/dependency.rb +82 -0
- data/bundler/lib/bundler/fetcher/downloader.rb +79 -0
- data/bundler/lib/bundler/fetcher/index.rb +52 -0
- data/bundler/lib/bundler/fetcher.rb +312 -0
- data/bundler/lib/bundler/friendly_errors.rb +131 -0
- data/bundler/lib/bundler/gem_helper.rb +202 -0
- data/bundler/lib/bundler/gem_helpers.rb +101 -0
- data/bundler/lib/bundler/gem_remote_fetcher.rb +43 -0
- data/bundler/lib/bundler/gem_tasks.rb +7 -0
- data/bundler/lib/bundler/gem_version_promoter.rb +176 -0
- data/bundler/lib/bundler/gemdeps.rb +29 -0
- data/bundler/lib/bundler/graph.rb +152 -0
- data/bundler/lib/bundler/index.rb +213 -0
- data/bundler/lib/bundler/injector.rb +94 -0
- data/bundler/lib/bundler/inline.rb +74 -0
- data/bundler/lib/bundler/installer/gem_installer.rb +83 -0
- data/bundler/lib/bundler/installer/parallel_installer.rb +228 -0
- data/bundler/lib/bundler/installer/standalone.rb +53 -0
- data/bundler/lib/bundler/installer.rb +295 -0
- data/bundler/lib/bundler/lazy_specification.rb +123 -0
- data/bundler/lib/bundler/lockfile_generator.rb +95 -0
- data/bundler/lib/bundler/lockfile_parser.rb +256 -0
- data/bundler/lib/bundler/match_platform.rb +24 -0
- data/bundler/lib/bundler/mirror.rb +223 -0
- data/bundler/lib/bundler/plugin/api/source.rb +306 -0
- data/bundler/lib/bundler/plugin/api.rb +81 -0
- data/bundler/lib/bundler/plugin/dsl.rb +53 -0
- data/bundler/lib/bundler/plugin/index.rb +162 -0
- data/bundler/lib/bundler/plugin/installer/git.rb +38 -0
- data/bundler/lib/bundler/plugin/installer/rubygems.rb +27 -0
- data/bundler/lib/bundler/plugin/installer.rb +96 -0
- data/bundler/lib/bundler/plugin/source_list.rb +27 -0
- data/bundler/lib/bundler/plugin.rb +285 -0
- data/bundler/lib/bundler/process_lock.rb +24 -0
- data/bundler/lib/bundler/psyched_yaml.rb +37 -0
- data/bundler/lib/bundler/remote_specification.rb +114 -0
- data/bundler/lib/bundler/resolver/spec_group.rb +110 -0
- data/bundler/lib/bundler/resolver.rb +372 -0
- data/bundler/lib/bundler/retry.rb +66 -0
- data/bundler/lib/bundler/ruby_dsl.rb +18 -0
- data/bundler/lib/bundler/ruby_version.rb +152 -0
- data/bundler/lib/bundler/rubygems_ext.rb +210 -0
- data/bundler/lib/bundler/rubygems_gem_installer.rb +99 -0
- data/bundler/lib/bundler/rubygems_integration.rb +898 -0
- data/bundler/lib/bundler/runtime.rb +316 -0
- data/bundler/lib/bundler/settings/validator.rb +79 -0
- data/bundler/lib/bundler/settings.rb +442 -0
- data/bundler/lib/bundler/setup.rb +28 -0
- data/bundler/lib/bundler/shared_helpers.rb +356 -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 +262 -0
- data/bundler/lib/bundler/source/git.rb +329 -0
- data/bundler/lib/bundler/source/metadata.rb +63 -0
- data/bundler/lib/bundler/source/path/installer.rb +74 -0
- data/bundler/lib/bundler/source/path.rb +249 -0
- data/bundler/lib/bundler/source/rubygems/remote.rb +66 -0
- data/bundler/lib/bundler/source/rubygems.rb +535 -0
- data/bundler/lib/bundler/source.rb +94 -0
- data/bundler/lib/bundler/source_list.rb +186 -0
- data/bundler/lib/bundler/spec_set.rb +192 -0
- data/bundler/lib/bundler/ssl_certs/.document +1 -0
- data/bundler/lib/bundler/ssl_certs/certificate_manager.rb +66 -0
- data/bundler/lib/bundler/ssl_certs/index.rubygems.org/GlobalSignRootCA.pem +21 -0
- data/bundler/lib/bundler/ssl_certs/rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem +23 -0
- data/bundler/lib/bundler/stub_specification.rb +108 -0
- data/bundler/lib/bundler/templates/.document +1 -0
- data/bundler/lib/bundler/templates/Executable +29 -0
- data/bundler/lib/bundler/templates/Executable.bundler +105 -0
- data/bundler/lib/bundler/templates/Executable.standalone +14 -0
- data/bundler/lib/bundler/templates/Gemfile +7 -0
- data/bundler/lib/bundler/templates/gems.rb +8 -0
- data/bundler/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +74 -0
- data/bundler/lib/bundler/templates/newgem/Gemfile.tt +6 -0
- data/bundler/lib/bundler/templates/newgem/LICENSE.txt.tt +21 -0
- data/bundler/lib/bundler/templates/newgem/README.md.tt +47 -0
- data/bundler/lib/bundler/templates/newgem/Rakefile.tt +29 -0
- data/bundler/lib/bundler/templates/newgem/bin/console.tt +14 -0
- data/bundler/lib/bundler/templates/newgem/bin/setup.tt +8 -0
- data/bundler/lib/bundler/templates/newgem/exe/newgem.tt +3 -0
- data/bundler/lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt +3 -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/gitignore.tt +20 -0
- data/bundler/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +7 -0
- data/bundler/lib/bundler/templates/newgem/lib/newgem.rb.tt +12 -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/spec/newgem_spec.rb.tt +9 -0
- data/bundler/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +14 -0
- data/bundler/lib/bundler/templates/newgem/test/newgem_test.rb.tt +11 -0
- data/bundler/lib/bundler/templates/newgem/test/test_helper.rb.tt +4 -0
- data/bundler/lib/bundler/templates/newgem/travis.yml.tt +5 -0
- data/bundler/lib/bundler/ui/rg_proxy.rb +19 -0
- data/bundler/lib/bundler/ui/shell.rb +146 -0
- data/bundler/lib/bundler/ui/silent.rb +69 -0
- data/bundler/lib/bundler/ui.rb +9 -0
- data/bundler/lib/bundler/uri_credentials_filter.rb +37 -0
- data/bundler/lib/bundler/vendor/fileutils/lib/fileutils.rb +1638 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb +26 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +57 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +81 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +36 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +66 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +62 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +63 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +61 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +126 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +46 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +36 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +126 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +223 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +138 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +6 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +101 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb +67 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +837 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +46 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +58 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo.rb +12 -0
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/faster.rb +27 -0
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/ssl_reuse.rb +129 -0
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +1233 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +104 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +60 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +118 -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 +364 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +109 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions.rb +321 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/base.rb +679 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/command.rb +135 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +97 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb +12 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/core_ext/ordered_hash.rb +129 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/error.rb +32 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/group.rb +281 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/invocation.rb +177 -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/parser/argument.rb +70 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +175 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/option.rb +146 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/options.rb +221 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser.rb +4 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +71 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/runner.rb +324 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +437 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/color.rb +149 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/html.rb +126 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell.rb +81 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/util.rb +268 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/version.rb +3 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor.rb +509 -0
- data/bundler/lib/bundler/vendored_fileutils.rb +9 -0
- data/bundler/lib/bundler/vendored_molinillo.rb +4 -0
- data/bundler/lib/bundler/vendored_persistent.rb +52 -0
- data/bundler/lib/bundler/vendored_thor.rb +8 -0
- data/bundler/lib/bundler/version.rb +28 -0
- data/bundler/lib/bundler/version_ranges.rb +76 -0
- data/bundler/lib/bundler/vlad.rb +17 -0
- data/bundler/lib/bundler/worker.rb +106 -0
- data/bundler/lib/bundler/yaml_serializer.rb +90 -0
- data/bundler/lib/bundler.rb +545 -0
- data/bundler/man/bundle-add.ronn +29 -0
- data/bundler/man/bundle-binstubs.ronn +43 -0
- data/bundler/man/bundle-check.ronn +26 -0
- data/bundler/man/bundle-clean.ronn +18 -0
- data/bundler/man/bundle-config.ronn +376 -0
- data/bundler/man/bundle-doctor.ronn +33 -0
- data/bundler/man/bundle-exec.ronn +152 -0
- data/bundler/man/bundle-gem.ronn +78 -0
- data/bundler/man/bundle-info.ronn +17 -0
- data/bundler/man/bundle-init.ronn +29 -0
- data/bundler/man/bundle-inject.ronn +22 -0
- data/bundler/man/bundle-install.ronn +369 -0
- data/bundler/man/bundle-list.ronn +15 -0
- data/bundler/man/bundle-lock.ronn +94 -0
- data/bundler/man/bundle-open.ronn +19 -0
- data/bundler/man/bundle-outdated.ronn +107 -0
- data/bundler/man/bundle-package.ronn +72 -0
- data/bundler/man/bundle-platform.ronn +42 -0
- data/bundler/man/bundle-pristine.ronn +34 -0
- data/bundler/man/bundle-show.ronn +20 -0
- data/bundler/man/bundle-update.ronn +346 -0
- data/bundler/man/bundle-viz.ronn +30 -0
- data/bundler/man/bundle.ronn +108 -0
- data/bundler/man/gemfile.5.ronn +506 -0
- data/lib/rubygems/basic_specification.rb +8 -4
- data/lib/rubygems/bundler_version_finder.rb +116 -0
- data/lib/rubygems/command.rb +10 -2
- data/lib/rubygems/command_manager.rb +3 -1
- data/lib/rubygems/commands/cert_command.rb +31 -6
- data/lib/rubygems/commands/cleanup_command.rb +10 -3
- data/lib/rubygems/commands/generate_index_command.rb +1 -1
- data/lib/rubygems/commands/help_command.rb +1 -1
- data/lib/rubygems/commands/open_command.rb +1 -1
- data/lib/rubygems/commands/owner_command.rb +4 -2
- data/lib/rubygems/commands/pristine_command.rb +11 -8
- data/lib/rubygems/commands/push_command.rb +3 -2
- data/lib/rubygems/commands/query_command.rb +17 -17
- data/lib/rubygems/commands/setup_command.rb +175 -70
- data/lib/rubygems/commands/signin_command.rb +33 -0
- data/lib/rubygems/commands/signout_command.rb +33 -0
- data/lib/rubygems/commands/sources_command.rb +1 -1
- data/lib/rubygems/commands/uninstall_command.rb +4 -3
- data/lib/rubygems/commands/unpack_command.rb +19 -7
- data/lib/rubygems/commands/update_command.rb +2 -2
- data/lib/rubygems/commands/which_command.rb +1 -1
- data/lib/rubygems/commands/yank_command.rb +4 -11
- data/lib/rubygems/config_file.rb +21 -28
- data/lib/rubygems/core_ext/kernel_require.rb +10 -9
- data/lib/rubygems/defaults.rb +18 -0
- data/lib/rubygems/dependency.rb +10 -4
- data/lib/rubygems/dependency_installer.rb +8 -2
- data/lib/rubygems/dependency_list.rb +1 -1
- data/lib/rubygems/errors.rb +4 -0
- data/lib/rubygems/exceptions.rb +11 -1
- data/lib/rubygems/ext/builder.rb +2 -2
- data/lib/rubygems/ext/ext_conf_builder.rb +7 -7
- data/lib/rubygems/ext/rake_builder.rb +2 -2
- data/lib/rubygems/gem_runner.rb +5 -1
- data/lib/rubygems/indexer.rb +6 -5
- data/lib/rubygems/install_update_options.rb +5 -28
- data/lib/rubygems/installer.rb +53 -22
- data/lib/rubygems/installer_test_case.rb +6 -3
- data/lib/rubygems/package/file_source.rb +2 -2
- data/lib/rubygems/package/old.rb +3 -3
- data/lib/rubygems/package/tar_header.rb +14 -9
- data/lib/rubygems/package/tar_writer.rb +12 -16
- data/lib/rubygems/package.rb +48 -9
- data/lib/rubygems/platform.rb +1 -1
- data/lib/rubygems/remote_fetcher.rb +13 -18
- data/lib/rubygems/request.rb +47 -1
- data/lib/rubygems/request_set/gem_dependency_api.rb +3 -3
- data/lib/rubygems/request_set/lockfile/tokenizer.rb +1 -1
- data/lib/rubygems/request_set/lockfile.rb +1 -1
- data/lib/rubygems/request_set.rb +22 -3
- data/lib/rubygems/requirement.rb +5 -1
- data/lib/rubygems/resolver/installer_set.rb +4 -6
- data/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/resolution_state.rb +50 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/specification_provider.rb +80 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/action.rb +35 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +65 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +61 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +62 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +60 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/log.rb +125 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/set_payload.rb +45 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/tag.rb +35 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/vertex.rb +125 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph.rb +78 -147
- data/lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb +1 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/gem_metadata.rb +1 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/modules/ui.rb +1 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/resolution.rb +110 -75
- data/lib/rubygems/resolver/molinillo/lib/molinillo/state.rb +4 -2
- data/lib/rubygems/resolver/set.rb +1 -1
- data/lib/rubygems/resolver.rb +61 -5
- data/lib/rubygems/safe_yaml.rb +51 -0
- data/lib/rubygems/security/signer.rb +2 -0
- data/lib/rubygems/security/trust_dir.rb +1 -1
- data/lib/rubygems/security.rb +12 -5
- data/lib/rubygems/security_option.rb +43 -0
- data/lib/rubygems/server.rb +49 -40
- data/lib/rubygems/source/git.rb +2 -1
- data/lib/rubygems/source/local.rb +38 -35
- data/lib/rubygems/source/lock.rb +4 -1
- data/lib/rubygems/source.rb +9 -6
- data/lib/rubygems/source_local.rb +3 -1
- data/lib/rubygems/source_specific_file.rb +3 -2
- data/lib/rubygems/spec_fetcher.rb +7 -3
- data/lib/rubygems/specification.rb +317 -251
- data/lib/rubygems/ssl_certs/index.rubygems.org/GlobalSignRootCA.pem +21 -0
- data/lib/rubygems/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem +25 -0
- data/lib/rubygems/stub_specification.rb +10 -4
- data/lib/rubygems/test_case.rb +51 -11
- data/lib/rubygems/test_utilities.rb +2 -2
- data/lib/rubygems/text.rb +14 -1
- data/lib/rubygems/user_interaction.rb +22 -20
- data/lib/rubygems/util/licenses.rb +37 -0
- data/lib/rubygems/util.rb +6 -16
- data/lib/rubygems/validator.rb +3 -3
- data/lib/rubygems/version.rb +24 -5
- data/lib/rubygems/version_option.rb +6 -1
- data/lib/rubygems.rb +147 -45
- data/lib/ubygems.rb +3 -0
- data/setup.rb +1 -1
- data/test/rubygems/alternate_cert.pem +10 -9
- data/test/rubygems/alternate_cert_32.pem +10 -9
- data/test/rubygems/child_cert.pem +11 -9
- data/test/rubygems/child_cert_32.pem +11 -9
- data/test/rubygems/encrypted_private_key.pem +26 -26
- data/test/rubygems/expired_cert.pem +9 -8
- data/test/rubygems/future_cert.pem +9 -8
- data/test/rubygems/future_cert_32.pem +9 -8
- data/test/rubygems/grandchild_cert.pem +11 -9
- data/test/rubygems/grandchild_cert_32.pem +11 -9
- data/test/rubygems/invalid_issuer_cert.pem +11 -9
- data/test/rubygems/invalid_issuer_cert_32.pem +11 -9
- data/test/rubygems/invalid_signer_cert.pem +10 -9
- data/test/rubygems/invalid_signer_cert_32.pem +10 -9
- data/test/rubygems/invalidchild_cert.pem +11 -9
- data/test/rubygems/invalidchild_cert_32.pem +11 -9
- data/test/rubygems/private3072_key.pem +40 -0
- data/test/rubygems/public3072_cert.pem +25 -0
- data/test/rubygems/public_cert.pem +11 -9
- data/test/rubygems/public_cert_32.pem +10 -9
- data/test/rubygems/rubygems_plugin.rb +4 -0
- data/test/rubygems/test_bundled_ca.rb +1 -1
- data/test/rubygems/test_config.rb +1 -1
- data/test/rubygems/test_gem.rb +168 -55
- data/test/rubygems/test_gem_bundler_version_finder.rb +125 -0
- data/test/rubygems/test_gem_command.rb +7 -1
- data/test/rubygems/test_gem_commands_build_command.rb +27 -1
- data/test/rubygems/test_gem_commands_cert_command.rb +64 -0
- data/test/rubygems/test_gem_commands_cleanup_command.rb +44 -1
- data/test/rubygems/test_gem_commands_install_command.rb +36 -2
- data/test/rubygems/test_gem_commands_open_command.rb +2 -1
- data/test/rubygems/test_gem_commands_owner_command.rb +25 -0
- data/test/rubygems/test_gem_commands_pristine_command.rb +1 -1
- data/test/rubygems/test_gem_commands_push_command.rb +5 -5
- data/test/rubygems/test_gem_commands_query_command.rb +154 -1
- data/test/rubygems/test_gem_commands_setup_command.rb +140 -10
- data/test/rubygems/test_gem_commands_signin_command.rb +98 -0
- data/test/rubygems/test_gem_commands_signout_command.rb +37 -0
- data/test/rubygems/test_gem_commands_sources_command.rb +52 -0
- data/test/rubygems/test_gem_commands_uninstall_command.rb +14 -2
- data/test/rubygems/test_gem_commands_update_command.rb +1 -7
- data/test/rubygems/test_gem_commands_which_command.rb +3 -3
- data/test/rubygems/test_gem_config_file.rb +1 -2
- data/test/rubygems/test_gem_dependency.rb +28 -0
- data/test/rubygems/test_gem_dependency_installer.rb +1 -1
- data/test/rubygems/test_gem_doctor.rb +2 -2
- data/test/rubygems/test_gem_ext_builder.rb +8 -8
- data/test/rubygems/test_gem_ext_configure_builder.rb +1 -1
- data/test/rubygems/test_gem_ext_ext_conf_builder.rb +23 -0
- data/test/rubygems/test_gem_ext_rake_builder.rb +33 -16
- data/test/rubygems/test_gem_gemcutter_utilities.rb +4 -4
- data/test/rubygems/test_gem_indexer.rb +1 -2
- data/test/rubygems/test_gem_install_update_options.rb +4 -1
- data/test/rubygems/test_gem_installer.rb +230 -32
- data/test/rubygems/test_gem_package.rb +156 -29
- data/test/rubygems/test_gem_package_old.rb +1 -1
- data/test/rubygems/test_gem_package_tar_header.rb +21 -0
- data/test/rubygems/test_gem_package_tar_writer.rb +24 -0
- data/test/rubygems/test_gem_rdoc.rb +2 -0
- data/test/rubygems/test_gem_remote_fetcher.rb +38 -19
- data/test/rubygems/test_gem_request.rb +132 -0
- data/test/rubygems/test_gem_request_connection_pools.rb +6 -7
- data/test/rubygems/test_gem_request_set.rb +7 -7
- data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +3 -3
- data/test/rubygems/test_gem_request_set_lockfile.rb +4 -4
- data/test/rubygems/test_gem_request_set_lockfile_parser.rb +1 -1
- data/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb +1 -1
- data/test/rubygems/test_gem_requirement.rb +6 -0
- data/test/rubygems/test_gem_resolver.rb +29 -3
- data/test/rubygems/test_gem_resolver_conflict.rb +1 -1
- data/test/rubygems/test_gem_resolver_git_specification.rb +1 -1
- data/test/rubygems/test_gem_security.rb +5 -0
- data/test/rubygems/test_gem_security_policy.rb +27 -27
- data/test/rubygems/test_gem_security_signer.rb +14 -6
- data/test/rubygems/test_gem_security_trust_dir.rb +2 -2
- data/test/rubygems/test_gem_server.rb +210 -12
- data/test/rubygems/test_gem_source.rb +12 -3
- data/test/rubygems/test_gem_source_fetch_problem.rb +8 -0
- data/test/rubygems/test_gem_source_git.rb +1 -1
- data/test/rubygems/test_gem_spec_fetcher.rb +20 -0
- data/test/rubygems/test_gem_specification.rb +163 -32
- data/test/rubygems/test_gem_stream_ui.rb +6 -6
- data/test/rubygems/test_gem_stub_specification.rb +85 -6
- data/test/rubygems/test_gem_text.rb +11 -0
- data/test/rubygems/test_gem_util.rb +26 -0
- data/test/rubygems/test_gem_version.rb +46 -7
- data/test/rubygems/test_gem_version_option.rb +15 -0
- data/test/rubygems/test_kernel.rb +30 -0
- data/test/rubygems/test_remote_fetch_error.rb +21 -0
- data/test/rubygems/test_require.rb +95 -21
- data/test/rubygems/wrong_key_cert.pem +10 -9
- data/test/rubygems/wrong_key_cert_32.pem +10 -9
- data/util/ci +74 -0
- data/util/create_certs.rb +64 -49
- data/util/generate_spdx_license_list.rb +2 -1
- data/util/patch_with_prs.rb +77 -0
- data/util/update_bundled_ca_certificates.rb +23 -2
- data/util/update_changelog.rb +67 -0
- metadata +301 -48
- data/README.rdoc +0 -54
- data/lib/gauntlet_rubygems.rb +0 -51
- data/lib/rubygems/ssl_certs/index.rubygems.org/GlobalSignRoot.pem +0 -18
- /data/{lib/rubygems/ssl_certs/rubygems.org/AddTrustExternalCARoot-2048.pem → bundler/lib/bundler/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem} +0 -0
@@ -0,0 +1,96 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bundler
|
4
|
+
# Handles the installation of plugin in appropriate directories.
|
5
|
+
#
|
6
|
+
# This class is supposed to be wrapper over the existing gem installation infra
|
7
|
+
# but currently it itself handles everything as the Source's subclasses (e.g. Source::RubyGems)
|
8
|
+
# are heavily dependent on the Gemfile.
|
9
|
+
module Plugin
|
10
|
+
class Installer
|
11
|
+
autoload :Rubygems, "bundler/plugin/installer/rubygems"
|
12
|
+
autoload :Git, "bundler/plugin/installer/git"
|
13
|
+
|
14
|
+
def install(names, options)
|
15
|
+
version = options[:version] || [">= 0"]
|
16
|
+
Bundler.settings.temporary(:lockfile_uses_separate_rubygems_sources => false, :disable_multisource => false) do
|
17
|
+
if options[:git]
|
18
|
+
install_git(names, version, options)
|
19
|
+
else
|
20
|
+
sources = options[:source] || Bundler.rubygems.sources
|
21
|
+
install_rubygems(names, version, sources)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
# Installs the plugin from Definition object created by limited parsing of
|
27
|
+
# Gemfile searching for plugins to be installed
|
28
|
+
#
|
29
|
+
# @param [Definition] definition object
|
30
|
+
# @return [Hash] map of names to their specs they are installed with
|
31
|
+
def install_definition(definition)
|
32
|
+
def definition.lock(*); end
|
33
|
+
definition.resolve_remotely!
|
34
|
+
specs = definition.specs
|
35
|
+
|
36
|
+
install_from_specs specs
|
37
|
+
end
|
38
|
+
|
39
|
+
private
|
40
|
+
|
41
|
+
def install_git(names, version, options)
|
42
|
+
uri = options.delete(:git)
|
43
|
+
options["uri"] = uri
|
44
|
+
|
45
|
+
source_list = SourceList.new
|
46
|
+
source_list.add_git_source(options)
|
47
|
+
|
48
|
+
# To support both sources
|
49
|
+
if options[:source]
|
50
|
+
source_list.add_rubygems_source("remotes" => options[:source])
|
51
|
+
end
|
52
|
+
|
53
|
+
deps = names.map {|name| Dependency.new name, version }
|
54
|
+
|
55
|
+
definition = Definition.new(nil, deps, source_list, true)
|
56
|
+
install_definition(definition)
|
57
|
+
end
|
58
|
+
|
59
|
+
# Installs the plugin from rubygems source and returns the path where the
|
60
|
+
# plugin was installed
|
61
|
+
#
|
62
|
+
# @param [String] name of the plugin gem to search in the source
|
63
|
+
# @param [Array] version of the gem to install
|
64
|
+
# @param [String, Array<String>] source(s) to resolve the gem
|
65
|
+
#
|
66
|
+
# @return [Hash] map of names to the specs of plugins installed
|
67
|
+
def install_rubygems(names, version, sources)
|
68
|
+
deps = names.map {|name| Dependency.new name, version }
|
69
|
+
|
70
|
+
source_list = SourceList.new
|
71
|
+
source_list.add_rubygems_source("remotes" => sources)
|
72
|
+
|
73
|
+
definition = Definition.new(nil, deps, source_list, true)
|
74
|
+
install_definition(definition)
|
75
|
+
end
|
76
|
+
|
77
|
+
# Installs the plugins and deps from the provided specs and returns map of
|
78
|
+
# gems to their paths
|
79
|
+
#
|
80
|
+
# @param specs to install
|
81
|
+
#
|
82
|
+
# @return [Hash] map of names to the specs
|
83
|
+
def install_from_specs(specs)
|
84
|
+
paths = {}
|
85
|
+
|
86
|
+
specs.each do |spec|
|
87
|
+
spec.source.install spec
|
88
|
+
|
89
|
+
paths[spec.name] = spec
|
90
|
+
end
|
91
|
+
|
92
|
+
paths
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bundler
|
4
|
+
# SourceList object to be used while parsing the Gemfile, setting the
|
5
|
+
# approptiate options to be used with Source classes for plugin installation
|
6
|
+
module Plugin
|
7
|
+
class SourceList < Bundler::SourceList
|
8
|
+
def add_git_source(options = {})
|
9
|
+
add_source_to_list Plugin::Installer::Git.new(options), git_sources
|
10
|
+
end
|
11
|
+
|
12
|
+
def add_rubygems_source(options = {})
|
13
|
+
add_source_to_list Plugin::Installer::Rubygems.new(options), @rubygems_sources
|
14
|
+
end
|
15
|
+
|
16
|
+
def all_sources
|
17
|
+
path_sources + git_sources + rubygems_sources + [metadata_source]
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def rubygems_aggregate_class
|
23
|
+
Plugin::Installer::Rubygems
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,285 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "bundler/plugin/api"
|
4
|
+
|
5
|
+
module Bundler
|
6
|
+
module Plugin
|
7
|
+
autoload :DSL, "bundler/plugin/dsl"
|
8
|
+
autoload :Index, "bundler/plugin/index"
|
9
|
+
autoload :Installer, "bundler/plugin/installer"
|
10
|
+
autoload :SourceList, "bundler/plugin/source_list"
|
11
|
+
|
12
|
+
class MalformattedPlugin < PluginError; end
|
13
|
+
class UndefinedCommandError < PluginError; end
|
14
|
+
class UnknownSourceError < PluginError; end
|
15
|
+
|
16
|
+
PLUGIN_FILE_NAME = "plugins.rb".freeze
|
17
|
+
|
18
|
+
module_function
|
19
|
+
|
20
|
+
def reset!
|
21
|
+
instance_variables.each {|i| remove_instance_variable(i) }
|
22
|
+
|
23
|
+
@sources = {}
|
24
|
+
@commands = {}
|
25
|
+
@hooks_by_event = Hash.new {|h, k| h[k] = [] }
|
26
|
+
@loaded_plugin_names = []
|
27
|
+
end
|
28
|
+
|
29
|
+
reset!
|
30
|
+
|
31
|
+
# Installs a new plugin by the given name
|
32
|
+
#
|
33
|
+
# @param [Array<String>] names the name of plugin to be installed
|
34
|
+
# @param [Hash] options various parameters as described in description.
|
35
|
+
# Refer to cli/plugin for available options
|
36
|
+
def install(names, options)
|
37
|
+
specs = Installer.new.install(names, options)
|
38
|
+
|
39
|
+
save_plugins names, specs
|
40
|
+
rescue PluginError => e
|
41
|
+
if specs
|
42
|
+
specs_to_delete = Hash[specs.select {|k, _v| names.include?(k) && !index.commands.values.include?(k) }]
|
43
|
+
specs_to_delete.values.each {|spec| Bundler.rm_rf(spec.full_gem_path) }
|
44
|
+
end
|
45
|
+
|
46
|
+
Bundler.ui.error "Failed to install plugin #{name}: #{e.message}\n #{e.backtrace.join("\n ")}"
|
47
|
+
end
|
48
|
+
|
49
|
+
# Evaluates the Gemfile with a limited DSL and installs the plugins
|
50
|
+
# specified by plugin method
|
51
|
+
#
|
52
|
+
# @param [Pathname] gemfile path
|
53
|
+
# @param [Proc] block that can be evaluated for (inline) Gemfile
|
54
|
+
def gemfile_install(gemfile = nil, &inline)
|
55
|
+
builder = DSL.new
|
56
|
+
if block_given?
|
57
|
+
builder.instance_eval(&inline)
|
58
|
+
else
|
59
|
+
builder.eval_gemfile(gemfile)
|
60
|
+
end
|
61
|
+
definition = builder.to_definition(nil, true)
|
62
|
+
|
63
|
+
return if definition.dependencies.empty?
|
64
|
+
|
65
|
+
plugins = definition.dependencies.map(&:name).reject {|p| index.installed? p }
|
66
|
+
installed_specs = Installer.new.install_definition(definition)
|
67
|
+
|
68
|
+
save_plugins plugins, installed_specs, builder.inferred_plugins
|
69
|
+
rescue => e
|
70
|
+
unless e.is_a?(GemfileError)
|
71
|
+
Bundler.ui.error "Failed to install plugin: #{e.message}\n #{e.backtrace[0]}"
|
72
|
+
end
|
73
|
+
raise
|
74
|
+
end
|
75
|
+
|
76
|
+
# The index object used to store the details about the plugin
|
77
|
+
def index
|
78
|
+
@index ||= Index.new
|
79
|
+
end
|
80
|
+
|
81
|
+
# The directory root for all plugin related data
|
82
|
+
#
|
83
|
+
# Points to root in app_config_path if ran in an app else points to the one
|
84
|
+
# in user_bundle_path
|
85
|
+
def root
|
86
|
+
@root ||= if SharedHelpers.in_bundle?
|
87
|
+
local_root
|
88
|
+
else
|
89
|
+
global_root
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
def local_root
|
94
|
+
Bundler.app_config_path.join("plugin")
|
95
|
+
end
|
96
|
+
|
97
|
+
# The global directory root for all plugin related data
|
98
|
+
def global_root
|
99
|
+
Bundler.user_bundle_path.join("plugin")
|
100
|
+
end
|
101
|
+
|
102
|
+
# The cache directory for plugin stuffs
|
103
|
+
def cache
|
104
|
+
@cache ||= root.join("cache")
|
105
|
+
end
|
106
|
+
|
107
|
+
# To be called via the API to register to handle a command
|
108
|
+
def add_command(command, cls)
|
109
|
+
@commands[command] = cls
|
110
|
+
end
|
111
|
+
|
112
|
+
# Checks if any plugin handles the command
|
113
|
+
def command?(command)
|
114
|
+
!index.command_plugin(command).nil?
|
115
|
+
end
|
116
|
+
|
117
|
+
# To be called from Cli class to pass the command and argument to
|
118
|
+
# approriate plugin class
|
119
|
+
def exec_command(command, args)
|
120
|
+
raise UndefinedCommandError, "Command `#{command}` not found" unless command? command
|
121
|
+
|
122
|
+
load_plugin index.command_plugin(command) unless @commands.key? command
|
123
|
+
|
124
|
+
@commands[command].new.exec(command, args)
|
125
|
+
end
|
126
|
+
|
127
|
+
# To be called via the API to register to handle a source plugin
|
128
|
+
def add_source(source, cls)
|
129
|
+
@sources[source] = cls
|
130
|
+
end
|
131
|
+
|
132
|
+
# Checks if any plugin declares the source
|
133
|
+
def source?(name)
|
134
|
+
!index.source_plugin(name.to_s).nil?
|
135
|
+
end
|
136
|
+
|
137
|
+
# @return [Class] that handles the source. The calss includes API::Source
|
138
|
+
def source(name)
|
139
|
+
raise UnknownSourceError, "Source #{name} not found" unless source? name
|
140
|
+
|
141
|
+
load_plugin(index.source_plugin(name)) unless @sources.key? name
|
142
|
+
|
143
|
+
@sources[name]
|
144
|
+
end
|
145
|
+
|
146
|
+
# @param [Hash] The options that are present in the lock file
|
147
|
+
# @return [API::Source] the instance of the class that handles the source
|
148
|
+
# type passed in locked_opts
|
149
|
+
def source_from_lock(locked_opts)
|
150
|
+
src = source(locked_opts["type"])
|
151
|
+
|
152
|
+
src.new(locked_opts.merge("uri" => locked_opts["remote"]))
|
153
|
+
end
|
154
|
+
|
155
|
+
# To be called via the API to register a hooks and corresponding block that
|
156
|
+
# will be called to handle the hook
|
157
|
+
def add_hook(event, &block)
|
158
|
+
@hooks_by_event[event.to_s] << block
|
159
|
+
end
|
160
|
+
|
161
|
+
# Runs all the hooks that are registered for the passed event
|
162
|
+
#
|
163
|
+
# It passes the passed arguments and block to the block registered with
|
164
|
+
# the api.
|
165
|
+
#
|
166
|
+
# @param [String] event
|
167
|
+
def hook(event, *args, &arg_blk)
|
168
|
+
return unless Bundler.feature_flag.plugins?
|
169
|
+
|
170
|
+
plugins = index.hook_plugins(event)
|
171
|
+
return unless plugins.any?
|
172
|
+
|
173
|
+
(plugins - @loaded_plugin_names).each {|name| load_plugin(name) }
|
174
|
+
|
175
|
+
@hooks_by_event[event].each {|blk| blk.call(*args, &arg_blk) }
|
176
|
+
end
|
177
|
+
|
178
|
+
# currently only intended for specs
|
179
|
+
#
|
180
|
+
# @return [String, nil] installed path
|
181
|
+
def installed?(plugin)
|
182
|
+
Index.new.installed?(plugin)
|
183
|
+
end
|
184
|
+
|
185
|
+
# Post installation processing and registering with index
|
186
|
+
#
|
187
|
+
# @param [Array<String>] plugins list to be installed
|
188
|
+
# @param [Hash] specs of plugins mapped to installation path (currently they
|
189
|
+
# contain all the installed specs, including plugins)
|
190
|
+
# @param [Array<String>] names of inferred source plugins that can be ignored
|
191
|
+
def save_plugins(plugins, specs, optional_plugins = [])
|
192
|
+
plugins.each do |name|
|
193
|
+
spec = specs[name]
|
194
|
+
validate_plugin! Pathname.new(spec.full_gem_path)
|
195
|
+
installed = register_plugin(name, spec, optional_plugins.include?(name))
|
196
|
+
Bundler.ui.info "Installed plugin #{name}" if installed
|
197
|
+
end
|
198
|
+
end
|
199
|
+
|
200
|
+
# Checks if the gem is good to be a plugin
|
201
|
+
#
|
202
|
+
# At present it only checks whether it contains plugins.rb file
|
203
|
+
#
|
204
|
+
# @param [Pathname] plugin_path the path plugin is installed at
|
205
|
+
# @raise [MalformattedPlugin] if plugins.rb file is not found
|
206
|
+
def validate_plugin!(plugin_path)
|
207
|
+
plugin_file = plugin_path.join(PLUGIN_FILE_NAME)
|
208
|
+
raise MalformattedPlugin, "#{PLUGIN_FILE_NAME} was not found in the plugin." unless plugin_file.file?
|
209
|
+
end
|
210
|
+
|
211
|
+
# Runs the plugins.rb file in an isolated namespace, records the plugin
|
212
|
+
# actions it registers for and then passes the data to index to be stored.
|
213
|
+
#
|
214
|
+
# @param [String] name the name of the plugin
|
215
|
+
# @param [Specification] spec of installed plugin
|
216
|
+
# @param [Boolean] optional_plugin, removed if there is conflict with any
|
217
|
+
# other plugin (used for default source plugins)
|
218
|
+
#
|
219
|
+
# @raise [MalformattedPlugin] if plugins.rb raises any error
|
220
|
+
def register_plugin(name, spec, optional_plugin = false)
|
221
|
+
commands = @commands
|
222
|
+
sources = @sources
|
223
|
+
hooks = @hooks_by_event
|
224
|
+
|
225
|
+
@commands = {}
|
226
|
+
@sources = {}
|
227
|
+
@hooks_by_event = Hash.new {|h, k| h[k] = [] }
|
228
|
+
|
229
|
+
load_paths = spec.load_paths
|
230
|
+
add_to_load_path(load_paths)
|
231
|
+
path = Pathname.new spec.full_gem_path
|
232
|
+
|
233
|
+
begin
|
234
|
+
load path.join(PLUGIN_FILE_NAME), true
|
235
|
+
rescue StandardError => e
|
236
|
+
raise MalformattedPlugin, "#{e.class}: #{e.message}"
|
237
|
+
end
|
238
|
+
|
239
|
+
if optional_plugin && @sources.keys.any? {|s| source? s }
|
240
|
+
Bundler.rm_rf(path)
|
241
|
+
false
|
242
|
+
else
|
243
|
+
index.register_plugin(name, path.to_s, load_paths, @commands.keys,
|
244
|
+
@sources.keys, @hooks_by_event.keys)
|
245
|
+
true
|
246
|
+
end
|
247
|
+
ensure
|
248
|
+
@commands = commands
|
249
|
+
@sources = sources
|
250
|
+
@hooks_by_event = hooks
|
251
|
+
end
|
252
|
+
|
253
|
+
# Executes the plugins.rb file
|
254
|
+
#
|
255
|
+
# @param [String] name of the plugin
|
256
|
+
def load_plugin(name)
|
257
|
+
# Need to ensure before this that plugin root where the rest of gems
|
258
|
+
# are installed to be on load path to support plugin deps. Currently not
|
259
|
+
# done to avoid conflicts
|
260
|
+
path = index.plugin_path(name)
|
261
|
+
|
262
|
+
add_to_load_path(index.load_paths(name))
|
263
|
+
|
264
|
+
load path.join(PLUGIN_FILE_NAME)
|
265
|
+
|
266
|
+
@loaded_plugin_names << name
|
267
|
+
rescue => e
|
268
|
+
Bundler.ui.error "Failed loading plugin #{name}: #{e.message}"
|
269
|
+
raise
|
270
|
+
end
|
271
|
+
|
272
|
+
def add_to_load_path(load_paths)
|
273
|
+
if insert_index = Bundler.rubygems.load_path_insert_index
|
274
|
+
$LOAD_PATH.insert(insert_index, *load_paths)
|
275
|
+
else
|
276
|
+
$LOAD_PATH.unshift(*load_paths)
|
277
|
+
end
|
278
|
+
end
|
279
|
+
|
280
|
+
class << self
|
281
|
+
private :load_plugin, :register_plugin, :save_plugins, :validate_plugin!,
|
282
|
+
:add_to_load_path
|
283
|
+
end
|
284
|
+
end
|
285
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bundler
|
4
|
+
class ProcessLock
|
5
|
+
def self.lock(bundle_path = Bundler.bundle_path)
|
6
|
+
lock_file_path = File.join(bundle_path, "bundler.lock")
|
7
|
+
has_lock = false
|
8
|
+
|
9
|
+
File.open(lock_file_path, "w") do |f|
|
10
|
+
f.flock(File::LOCK_EX)
|
11
|
+
has_lock = true
|
12
|
+
yield
|
13
|
+
f.flock(File::LOCK_UN)
|
14
|
+
end
|
15
|
+
rescue Errno::EACCES, Errno::ENOLCK
|
16
|
+
# In the case the user does not have access to
|
17
|
+
# create the lock file or is using NFS where
|
18
|
+
# locks are not available we skip locking.
|
19
|
+
yield
|
20
|
+
ensure
|
21
|
+
FileUtils.rm_f(lock_file_path) if has_lock
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Psych could be a gem, so try to ask for it
|
4
|
+
begin
|
5
|
+
gem "psych"
|
6
|
+
rescue LoadError
|
7
|
+
end if defined?(gem)
|
8
|
+
|
9
|
+
# Psych could be in the stdlib
|
10
|
+
# but it's too late if Syck is already loaded
|
11
|
+
begin
|
12
|
+
require "psych" unless defined?(Syck)
|
13
|
+
rescue LoadError
|
14
|
+
# Apparently Psych wasn't available. Oh well.
|
15
|
+
end
|
16
|
+
|
17
|
+
# At least load the YAML stdlib, whatever that may be
|
18
|
+
require "yaml" unless defined?(YAML.dump)
|
19
|
+
|
20
|
+
module Bundler
|
21
|
+
# On encountering invalid YAML,
|
22
|
+
# Psych raises Psych::SyntaxError
|
23
|
+
if defined?(::Psych::SyntaxError)
|
24
|
+
YamlLibrarySyntaxError = ::Psych::SyntaxError
|
25
|
+
else # Syck raises ArgumentError
|
26
|
+
YamlLibrarySyntaxError = ::ArgumentError
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
require "bundler/deprecate"
|
31
|
+
begin
|
32
|
+
Bundler::Deprecate.skip_during do
|
33
|
+
require "rubygems/safe_yaml"
|
34
|
+
end
|
35
|
+
rescue LoadError
|
36
|
+
# it's OK if the file isn't there
|
37
|
+
end
|
@@ -0,0 +1,114 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "uri"
|
4
|
+
|
5
|
+
module Bundler
|
6
|
+
# Represents a lazily loaded gem specification, where the full specification
|
7
|
+
# is on the source server in rubygems' "quick" index. The proxy object is to
|
8
|
+
# be seeded with what we're given from the source's abbreviated index - the
|
9
|
+
# full specification will only be fetched when necessary.
|
10
|
+
class RemoteSpecification
|
11
|
+
include MatchPlatform
|
12
|
+
include Comparable
|
13
|
+
|
14
|
+
attr_reader :name, :version, :platform
|
15
|
+
attr_writer :dependencies
|
16
|
+
attr_accessor :source, :remote
|
17
|
+
|
18
|
+
def initialize(name, version, platform, spec_fetcher)
|
19
|
+
@name = name
|
20
|
+
@version = Gem::Version.create version
|
21
|
+
@platform = platform
|
22
|
+
@spec_fetcher = spec_fetcher
|
23
|
+
@dependencies = nil
|
24
|
+
end
|
25
|
+
|
26
|
+
# Needed before installs, since the arch matters then and quick
|
27
|
+
# specs don't bother to include the arch in the platform string
|
28
|
+
def fetch_platform
|
29
|
+
@platform = _remote_specification.platform
|
30
|
+
end
|
31
|
+
|
32
|
+
def full_name
|
33
|
+
if platform == Gem::Platform::RUBY || platform.nil?
|
34
|
+
"#{@name}-#{@version}"
|
35
|
+
else
|
36
|
+
"#{@name}-#{@version}-#{platform}"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
# Compare this specification against another object. Using sort_obj
|
41
|
+
# is compatible with Gem::Specification and other Bundler or RubyGems
|
42
|
+
# objects. Otherwise, use the default Object comparison.
|
43
|
+
def <=>(other)
|
44
|
+
if other.respond_to?(:sort_obj)
|
45
|
+
sort_obj <=> other.sort_obj
|
46
|
+
else
|
47
|
+
super
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
# Because Rubyforge cannot be trusted to provide valid specifications
|
52
|
+
# once the remote gem is downloaded, the backend specification will
|
53
|
+
# be swapped out.
|
54
|
+
def __swap__(spec)
|
55
|
+
SharedHelpers.ensure_same_dependencies(self, dependencies, spec.dependencies)
|
56
|
+
@_remote_specification = spec
|
57
|
+
end
|
58
|
+
|
59
|
+
# Create a delegate used for sorting. This strategy is copied from
|
60
|
+
# RubyGems 2.23 and ensures that Bundler's specifications can be
|
61
|
+
# compared and sorted with RubyGems' own specifications.
|
62
|
+
#
|
63
|
+
# @see #<=>
|
64
|
+
# @see Gem::Specification#sort_obj
|
65
|
+
#
|
66
|
+
# @return [Array] an object you can use to compare and sort this
|
67
|
+
# specification against other specifications
|
68
|
+
def sort_obj
|
69
|
+
[@name, @version, @platform == Gem::Platform::RUBY ? -1 : 1]
|
70
|
+
end
|
71
|
+
|
72
|
+
def to_s
|
73
|
+
"#<#{self.class} name=#{name} version=#{version} platform=#{platform}>"
|
74
|
+
end
|
75
|
+
|
76
|
+
def dependencies
|
77
|
+
@dependencies ||= begin
|
78
|
+
deps = method_missing(:dependencies)
|
79
|
+
|
80
|
+
# allow us to handle when the specs dependencies are an array of array of string
|
81
|
+
# see https://github.com/bundler/bundler/issues/5797
|
82
|
+
deps = deps.map {|d| d.is_a?(Gem::Dependency) ? d : Gem::Dependency.new(*d) }
|
83
|
+
|
84
|
+
deps
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
def git_version
|
89
|
+
return unless loaded_from && source.is_a?(Bundler::Source::Git)
|
90
|
+
" #{source.revision[0..6]}"
|
91
|
+
end
|
92
|
+
|
93
|
+
private
|
94
|
+
|
95
|
+
def to_ary
|
96
|
+
nil
|
97
|
+
end
|
98
|
+
|
99
|
+
def _remote_specification
|
100
|
+
@_remote_specification ||= @spec_fetcher.fetch_spec([@name, @version, @platform])
|
101
|
+
@_remote_specification || raise(GemspecError, "Gemspec data for #{full_name} was" \
|
102
|
+
" missing from the server! Try installing with `--full-index` as a workaround.")
|
103
|
+
end
|
104
|
+
|
105
|
+
def method_missing(method, *args, &blk)
|
106
|
+
_remote_specification.send(method, *args, &blk)
|
107
|
+
end
|
108
|
+
|
109
|
+
def respond_to?(method, include_all = false)
|
110
|
+
super || _remote_specification.respond_to?(method, include_all)
|
111
|
+
end
|
112
|
+
public :respond_to?
|
113
|
+
end
|
114
|
+
end
|
@@ -0,0 +1,110 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bundler
|
4
|
+
class Resolver
|
5
|
+
class SpecGroup
|
6
|
+
include GemHelpers
|
7
|
+
|
8
|
+
attr_accessor :name, :version, :source
|
9
|
+
attr_accessor :ignores_bundler_dependencies
|
10
|
+
|
11
|
+
def initialize(all_specs)
|
12
|
+
raise ArgumentError, "cannot initialize with an empty value" unless exemplary_spec = all_specs.first
|
13
|
+
@name = exemplary_spec.name
|
14
|
+
@version = exemplary_spec.version
|
15
|
+
@source = exemplary_spec.source
|
16
|
+
|
17
|
+
@activated_platforms = []
|
18
|
+
@dependencies = nil
|
19
|
+
@specs = Hash.new do |specs, platform|
|
20
|
+
specs[platform] = select_best_platform_match(all_specs, platform)
|
21
|
+
end
|
22
|
+
@ignores_bundler_dependencies = true
|
23
|
+
end
|
24
|
+
|
25
|
+
def to_specs
|
26
|
+
@activated_platforms.map do |p|
|
27
|
+
next unless s = @specs[p]
|
28
|
+
lazy_spec = LazySpecification.new(name, version, s.platform, source)
|
29
|
+
lazy_spec.dependencies.replace s.dependencies
|
30
|
+
lazy_spec
|
31
|
+
end.compact
|
32
|
+
end
|
33
|
+
|
34
|
+
def activate_platform!(platform)
|
35
|
+
return unless for?(platform)
|
36
|
+
return if @activated_platforms.include?(platform)
|
37
|
+
@activated_platforms << platform
|
38
|
+
end
|
39
|
+
|
40
|
+
def for?(platform)
|
41
|
+
spec = @specs[platform]
|
42
|
+
!spec.nil?
|
43
|
+
end
|
44
|
+
|
45
|
+
def to_s
|
46
|
+
@to_s ||= "#{name} (#{version})"
|
47
|
+
end
|
48
|
+
|
49
|
+
def dependencies_for_activated_platforms
|
50
|
+
dependencies = @activated_platforms.map {|p| __dependencies[p] }
|
51
|
+
metadata_dependencies = @activated_platforms.map do |platform|
|
52
|
+
metadata_dependencies(@specs[platform], platform)
|
53
|
+
end
|
54
|
+
dependencies.concat(metadata_dependencies).flatten
|
55
|
+
end
|
56
|
+
|
57
|
+
def platforms_for_dependency_named(dependency)
|
58
|
+
__dependencies.select {|_, deps| deps.map(&:name).include? dependency }.keys
|
59
|
+
end
|
60
|
+
|
61
|
+
def ==(other)
|
62
|
+
return unless other.is_a?(SpecGroup)
|
63
|
+
name == other.name &&
|
64
|
+
version == other.version &&
|
65
|
+
source == other.source
|
66
|
+
end
|
67
|
+
|
68
|
+
def eql?(other)
|
69
|
+
name.eql?(other.name) &&
|
70
|
+
version.eql?(other.version) &&
|
71
|
+
source.eql?(other.source)
|
72
|
+
end
|
73
|
+
|
74
|
+
def hash
|
75
|
+
to_s.hash ^ source.hash
|
76
|
+
end
|
77
|
+
|
78
|
+
private
|
79
|
+
|
80
|
+
def __dependencies
|
81
|
+
@dependencies = Hash.new do |dependencies, platform|
|
82
|
+
dependencies[platform] = []
|
83
|
+
if spec = @specs[platform]
|
84
|
+
spec.dependencies.each do |dep|
|
85
|
+
next if dep.type == :development
|
86
|
+
next if @ignores_bundler_dependencies && dep.name == "bundler".freeze
|
87
|
+
dependencies[platform] << DepProxy.new(dep, platform)
|
88
|
+
end
|
89
|
+
end
|
90
|
+
dependencies[platform]
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
def metadata_dependencies(spec, platform)
|
95
|
+
return [] unless spec
|
96
|
+
# Only allow endpoint specifications since they won't hit the network to
|
97
|
+
# fetch the full gemspec when calling required_ruby_version
|
98
|
+
return [] if !spec.is_a?(EndpointSpecification) && !spec.is_a?(Gem::Specification)
|
99
|
+
dependencies = []
|
100
|
+
if !spec.required_ruby_version.nil? && !spec.required_ruby_version.none?
|
101
|
+
dependencies << DepProxy.new(Gem::Dependency.new("ruby\0", spec.required_ruby_version), platform)
|
102
|
+
end
|
103
|
+
if !spec.required_rubygems_version.nil? && !spec.required_rubygems_version.none?
|
104
|
+
dependencies << DepProxy.new(Gem::Dependency.new("rubygems\0", spec.required_rubygems_version), platform)
|
105
|
+
end
|
106
|
+
dependencies
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|