bundler 1.17.2 → 2.2.33
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2095 -1251
- data/LICENSE.md +18 -19
- data/README.md +10 -11
- data/bundler.gemspec +10 -28
- data/exe/bundle +22 -3
- data/lib/bundler/build_metadata.rb +4 -12
- data/lib/bundler/capistrano.rb +4 -4
- data/lib/bundler/cli/add.rb +28 -16
- data/lib/bundler/cli/binstubs.rb +6 -2
- data/lib/bundler/cli/cache.rb +24 -17
- data/lib/bundler/cli/check.rb +4 -2
- data/lib/bundler/cli/clean.rb +1 -1
- data/lib/bundler/cli/common.rb +39 -13
- data/lib/bundler/cli/config.rb +161 -86
- data/lib/bundler/cli/console.rb +1 -1
- data/lib/bundler/cli/doctor.rb +20 -9
- data/lib/bundler/cli/exec.rb +8 -25
- data/lib/bundler/cli/fund.rb +36 -0
- data/lib/bundler/cli/gem.rb +213 -32
- data/lib/bundler/cli/info.rb +42 -7
- data/lib/bundler/cli/init.rb +2 -2
- data/lib/bundler/cli/inject.rb +1 -1
- data/lib/bundler/cli/install.rb +34 -44
- data/lib/bundler/cli/issue.rb +8 -7
- data/lib/bundler/cli/list.rb +19 -11
- data/lib/bundler/cli/lock.rb +5 -1
- data/lib/bundler/cli/open.rb +11 -8
- data/lib/bundler/cli/outdated.rb +142 -118
- data/lib/bundler/cli/plugin.rb +19 -2
- data/lib/bundler/cli/pristine.rb +6 -1
- data/lib/bundler/cli/remove.rb +1 -2
- data/lib/bundler/cli/show.rb +2 -2
- data/lib/bundler/cli/update.rb +43 -16
- data/lib/bundler/cli.rb +211 -150
- data/lib/bundler/compact_index_client/cache.rb +6 -14
- data/lib/bundler/compact_index_client/gem_parser.rb +28 -0
- data/lib/bundler/compact_index_client/updater.rb +15 -28
- data/lib/bundler/compact_index_client.rb +28 -12
- data/lib/bundler/current_ruby.rb +14 -11
- data/lib/bundler/definition.rb +207 -368
- data/lib/bundler/dep_proxy.rb +16 -9
- data/lib/bundler/dependency.rb +19 -14
- data/lib/bundler/deployment.rb +1 -1
- data/lib/bundler/digest.rb +71 -0
- data/lib/bundler/dsl.rb +81 -81
- data/lib/bundler/endpoint_specification.rb +1 -1
- data/lib/bundler/env.rb +9 -14
- data/lib/bundler/environment_preserver.rb +29 -3
- data/lib/bundler/errors.rb +20 -3
- data/lib/bundler/feature_flag.rb +14 -33
- data/lib/bundler/fetcher/base.rb +1 -1
- data/lib/bundler/fetcher/compact_index.rb +28 -14
- data/lib/bundler/fetcher/dependency.rb +1 -1
- data/lib/bundler/fetcher/downloader.rb +14 -8
- data/lib/bundler/fetcher/index.rb +8 -8
- data/lib/bundler/fetcher.rb +22 -17
- data/lib/bundler/friendly_errors.rb +29 -48
- data/lib/bundler/gem_helper.rb +79 -43
- data/lib/bundler/gem_helpers.rb +38 -29
- data/lib/bundler/gem_tasks.rb +1 -1
- data/lib/bundler/gem_version_promoter.rb +5 -5
- data/lib/bundler/graph.rb +3 -3
- data/lib/bundler/index.rb +9 -9
- data/lib/bundler/injector.rb +33 -13
- data/lib/bundler/inline.rb +41 -30
- data/lib/bundler/installer/gem_installer.rb +9 -18
- data/lib/bundler/installer/parallel_installer.rb +50 -33
- data/lib/bundler/installer/standalone.rb +30 -11
- data/lib/bundler/installer.rb +39 -66
- data/lib/bundler/lazy_specification.rb +63 -28
- data/lib/bundler/lockfile_generator.rb +1 -1
- data/lib/bundler/lockfile_parser.rb +19 -52
- data/lib/bundler/{ssl_certs → man}/.document +0 -0
- data/{man → lib/bundler/man}/bundle-add.1 +10 -2
- data/{man/bundle-add.ronn → lib/bundler/man/bundle-add.1.ronn} +7 -1
- data/{man → lib/bundler/man}/bundle-binstubs.1 +6 -4
- data/{man/bundle-binstubs.ronn → lib/bundler/man/bundle-binstubs.1.ronn} +3 -5
- data/lib/bundler/man/bundle-cache.1 +55 -0
- data/{man/bundle-package.ronn → lib/bundler/man/bundle-cache.1.ronn} +15 -15
- data/{man → lib/bundler/man}/bundle-check.1 +1 -1
- data/{man/bundle-check.ronn → lib/bundler/man/bundle-check.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-clean.1 +1 -1
- data/{man/bundle-clean.ronn → lib/bundler/man/bundle-clean.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-config.1 +59 -60
- data/{man/bundle-config.ronn → lib/bundler/man/bundle-config.1.ronn} +77 -78
- data/{man → lib/bundler/man}/bundle-doctor.1 +1 -1
- data/{man/bundle-doctor.ronn → lib/bundler/man/bundle-doctor.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-exec.1 +2 -2
- data/{man/bundle-exec.ronn → lib/bundler/man/bundle-exec.1.ronn} +1 -1
- data/{man → lib/bundler/man}/bundle-gem.1 +38 -3
- data/{man/bundle-gem.ronn → lib/bundler/man/bundle-gem.1.ronn} +46 -7
- data/{man → lib/bundler/man}/bundle-info.1 +1 -1
- data/{man/bundle-info.ronn → lib/bundler/man/bundle-info.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-init.1 +2 -2
- data/{man/bundle-init.ronn → lib/bundler/man/bundle-init.1.ronn} +1 -1
- data/{man → lib/bundler/man}/bundle-inject.1 +1 -1
- data/{man/bundle-inject.ronn → lib/bundler/man/bundle-inject.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-install.1 +37 -7
- data/{man/bundle-install.ronn → lib/bundler/man/bundle-install.1.ronn} +34 -7
- data/{man → lib/bundler/man}/bundle-list.1 +7 -7
- data/{man/bundle-list.ronn → lib/bundler/man/bundle-list.1.ronn} +6 -6
- data/{man → lib/bundler/man}/bundle-lock.1 +1 -1
- data/{man/bundle-lock.ronn → lib/bundler/man/bundle-lock.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-open.1 +1 -1
- data/{man/bundle-open.ronn → lib/bundler/man/bundle-open.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-outdated.1 +1 -1
- data/{man/bundle-outdated.ronn → lib/bundler/man/bundle-outdated.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-platform.1 +1 -1
- data/{man/bundle-platform.ronn → lib/bundler/man/bundle-platform.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-pristine.1 +1 -1
- data/{man/bundle-pristine.ronn → lib/bundler/man/bundle-pristine.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-remove.1 +1 -1
- data/{man/bundle-remove.ronn → lib/bundler/man/bundle-remove.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-show.1 +1 -1
- data/{man/bundle-show.ronn → lib/bundler/man/bundle-show.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-update.1 +7 -7
- data/{man/bundle-update.ronn → lib/bundler/man/bundle-update.1.ronn} +6 -6
- data/{man → lib/bundler/man}/bundle-viz.1 +1 -1
- data/{man/bundle-viz.ronn → lib/bundler/man/bundle-viz.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle.1 +7 -3
- data/{man/bundle.ronn → lib/bundler/man/bundle.1.ronn} +5 -2
- data/{man → lib/bundler/man}/gemfile.5 +44 -21
- data/{man → lib/bundler/man}/gemfile.5.ronn +24 -20
- data/{man → lib/bundler/man}/index.txt +1 -1
- data/lib/bundler/match_platform.rb +1 -1
- data/lib/bundler/mirror.rb +5 -5
- data/lib/bundler/plugin/api/source.rb +27 -7
- data/lib/bundler/plugin/api.rb +1 -1
- data/lib/bundler/plugin/dsl.rb +1 -1
- data/lib/bundler/plugin/index.rb +27 -4
- data/lib/bundler/plugin/installer/rubygems.rb +1 -1
- data/lib/bundler/plugin/installer.rb +35 -22
- data/lib/bundler/plugin/source_list.rb +5 -1
- data/lib/bundler/plugin.rb +100 -42
- data/lib/bundler/psyched_yaml.rb +0 -15
- data/lib/bundler/remote_specification.rb +5 -4
- data/lib/bundler/resolver/spec_group.rb +57 -53
- data/lib/bundler/resolver.rb +127 -113
- data/lib/bundler/retry.rb +4 -4
- data/lib/bundler/ruby_version.rb +5 -20
- data/lib/bundler/rubygems_ext.rb +103 -79
- data/lib/bundler/rubygems_gem_installer.rb +69 -8
- data/lib/bundler/rubygems_integration.rb +181 -446
- data/lib/bundler/runtime.rb +24 -34
- data/lib/bundler/settings.rb +159 -110
- data/lib/bundler/setup.rb +11 -12
- data/lib/bundler/shared_helpers.rb +56 -90
- data/lib/bundler/similarity_detector.rb +3 -3
- data/lib/bundler/source/git/git_proxy.rb +106 -105
- data/lib/bundler/source/git.rb +66 -39
- data/lib/bundler/source/metadata.rb +9 -9
- data/lib/bundler/source/path/installer.rb +10 -10
- data/lib/bundler/source/path.rb +23 -12
- data/lib/bundler/source/rubygems/remote.rb +3 -4
- data/lib/bundler/source/rubygems.rb +136 -120
- data/lib/bundler/source/rubygems_aggregate.rb +68 -0
- data/lib/bundler/source.rb +27 -6
- data/lib/bundler/source_list.rb +101 -66
- data/lib/bundler/source_map.rb +58 -0
- data/lib/bundler/spec_set.rb +49 -53
- data/lib/bundler/stub_specification.rb +40 -34
- data/lib/bundler/templates/Executable.bundler +24 -15
- data/lib/bundler/templates/Gemfile +1 -1
- data/lib/bundler/templates/gems.rb +1 -1
- data/lib/bundler/templates/newgem/CHANGELOG.md.tt +5 -0
- data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +57 -47
- data/lib/bundler/templates/newgem/Gemfile.tt +19 -2
- data/lib/bundler/templates/newgem/README.md.tt +7 -5
- data/lib/bundler/templates/newgem/Rakefile.tt +23 -5
- data/lib/bundler/templates/newgem/bin/console.tt +1 -0
- data/lib/bundler/templates/newgem/circleci/config.yml.tt +13 -0
- data/lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt +2 -0
- data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +27 -0
- data/lib/bundler/templates/newgem/gitlab-ci.yml.tt +9 -0
- data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +2 -0
- data/lib/bundler/templates/newgem/lib/newgem.rb.tt +4 -2
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +29 -40
- data/lib/bundler/templates/newgem/rubocop.yml.tt +13 -0
- data/lib/bundler/templates/newgem/sig/newgem.rbs.tt +8 -0
- data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +2 -0
- data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +2 -1
- data/lib/bundler/templates/newgem/standard.yml.tt +2 -0
- data/lib/bundler/templates/newgem/test/{newgem_test.rb.tt → minitest/newgem_test.rb.tt} +2 -0
- data/lib/bundler/templates/newgem/test/minitest/test_helper.rb.tt +6 -0
- data/lib/bundler/templates/newgem/test/test-unit/newgem_test.rb.tt +15 -0
- data/lib/bundler/templates/newgem/test/test-unit/test_helper.rb.tt +6 -0
- data/lib/bundler/templates/newgem/travis.yml.tt +0 -1
- data/lib/bundler/ui/rg_proxy.rb +1 -1
- data/lib/bundler/ui/shell.rb +7 -11
- data/lib/bundler/ui.rb +3 -3
- data/lib/bundler/uri_credentials_filter.rb +10 -4
- data/lib/bundler/vendor/.document +1 -0
- data/lib/bundler/vendor/connection_pool/LICENSE +20 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +174 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +3 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +57 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +126 -0
- data/lib/bundler/vendor/fileutils/LICENSE.txt +22 -0
- data/lib/bundler/vendor/fileutils/lib/fileutils.rb +273 -147
- data/lib/bundler/vendor/molinillo/LICENSE +9 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +7 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +6 -6
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +3 -3
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +39 -11
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +38 -6
- data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +4 -4
- data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +12 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +53 -51
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +2 -2
- data/lib/bundler/vendor/molinillo/lib/molinillo.rb +5 -6
- data/lib/bundler/vendor/net-http-persistent/README.rdoc +82 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb +40 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb +53 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +79 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +302 -462
- data/lib/bundler/vendor/thor/LICENSE.md +20 -0
- data/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +3 -2
- data/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +7 -17
- data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +20 -9
- data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +19 -8
- data/lib/bundler/vendor/thor/lib/thor/actions.rb +28 -13
- data/lib/bundler/vendor/thor/lib/thor/base.rb +63 -43
- data/lib/bundler/vendor/thor/lib/thor/command.rb +21 -14
- data/lib/bundler/vendor/thor/lib/thor/error.rb +78 -0
- data/lib/bundler/vendor/thor/lib/thor/group.rb +3 -3
- data/lib/bundler/vendor/thor/lib/thor/invocation.rb +1 -0
- data/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb +6 -6
- data/lib/bundler/vendor/thor/lib/thor/line_editor.rb +2 -2
- data/lib/bundler/vendor/thor/lib/thor/nested_context.rb +29 -0
- data/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +7 -3
- data/lib/bundler/vendor/thor/lib/thor/parser/option.rb +20 -7
- data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +21 -5
- data/lib/bundler/vendor/thor/lib/thor/parser.rb +4 -4
- data/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +1 -0
- data/lib/bundler/vendor/thor/lib/thor/runner.rb +15 -14
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +65 -8
- data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +10 -2
- data/lib/bundler/vendor/thor/lib/thor/shell/html.rb +3 -3
- data/lib/bundler/vendor/thor/lib/thor/shell.rb +4 -4
- data/lib/bundler/vendor/thor/lib/thor/util.rb +18 -2
- data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor.rb +16 -9
- data/lib/bundler/vendor/tmpdir/lib/tmpdir.rb +154 -0
- data/lib/bundler/vendor/tsort/LICENSE.txt +22 -0
- data/lib/bundler/vendor/tsort/lib/tsort.rb +453 -0
- data/lib/bundler/vendor/uri/LICENSE.txt +22 -0
- data/lib/bundler/vendor/uri/lib/uri/common.rb +744 -0
- data/lib/bundler/vendor/uri/lib/uri/file.rb +94 -0
- data/lib/bundler/vendor/uri/lib/uri/ftp.rb +267 -0
- data/lib/bundler/vendor/uri/lib/uri/generic.rb +1568 -0
- data/lib/bundler/vendor/uri/lib/uri/http.rb +88 -0
- data/lib/bundler/vendor/uri/lib/uri/https.rb +23 -0
- data/lib/bundler/vendor/uri/lib/uri/ldap.rb +261 -0
- data/lib/bundler/vendor/uri/lib/uri/ldaps.rb +21 -0
- data/lib/bundler/vendor/uri/lib/uri/mailto.rb +294 -0
- data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +546 -0
- data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +125 -0
- data/lib/bundler/vendor/uri/lib/uri/version.rb +6 -0
- data/lib/bundler/vendor/uri/lib/uri.rb +104 -0
- data/lib/bundler/vendored_fileutils.rb +1 -6
- data/lib/bundler/vendored_molinillo.rb +1 -1
- data/lib/bundler/vendored_persistent.rb +7 -12
- data/lib/bundler/vendored_thor.rb +2 -2
- data/lib/bundler/vendored_tmpdir.rb +4 -0
- data/lib/bundler/vendored_tsort.rb +4 -0
- data/lib/bundler/vendored_uri.rb +4 -0
- data/lib/bundler/version.rb +1 -20
- data/lib/bundler/version_ranges.rb +51 -5
- data/lib/bundler/vlad.rb +2 -2
- data/lib/bundler/worker.rb +21 -8
- data/lib/bundler/yaml_serializer.rb +3 -4
- data/lib/bundler.rb +248 -118
- metadata +115 -190
- data/exe/bundle_ruby +0 -60
- data/lib/bundler/cli/package.rb +0 -49
- data/lib/bundler/compatibility_guard.rb +0 -14
- data/lib/bundler/gem_remote_fetcher.rb +0 -43
- data/lib/bundler/ssl_certs/certificate_manager.rb +0 -66
- data/lib/bundler/ssl_certs/index.rubygems.org/GlobalSignRootCA.pem +0 -21
- data/lib/bundler/ssl_certs/rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem +0 -23
- data/lib/bundler/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem +0 -25
- data/lib/bundler/templates/newgem/test/test_helper.rb.tt +0 -4
- data/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb +0 -26
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/faster.rb +0 -27
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/ssl_reuse.rb +0 -129
- data/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb +0 -12
- data/lib/bundler/vendor/thor/lib/thor/core_ext/ordered_hash.rb +0 -129
- data/man/bundle-add.1.txt +0 -52
- data/man/bundle-binstubs.1.txt +0 -48
- data/man/bundle-check.1.txt +0 -33
- data/man/bundle-clean.1.txt +0 -26
- data/man/bundle-config.1.txt +0 -529
- data/man/bundle-doctor.1.txt +0 -44
- data/man/bundle-exec.1.txt +0 -178
- data/man/bundle-gem.1.txt +0 -91
- data/man/bundle-info.1.txt +0 -21
- data/man/bundle-init.1.txt +0 -34
- data/man/bundle-inject.1.txt +0 -32
- data/man/bundle-install.1.txt +0 -396
- data/man/bundle-list.1.txt +0 -43
- data/man/bundle-lock.1.txt +0 -93
- data/man/bundle-open.1.txt +0 -29
- data/man/bundle-outdated.1.txt +0 -131
- data/man/bundle-package.1 +0 -55
- data/man/bundle-package.1.txt +0 -79
- data/man/bundle-platform.1.txt +0 -57
- data/man/bundle-pristine.1.txt +0 -44
- data/man/bundle-remove.1.txt +0 -34
- data/man/bundle-show.1.txt +0 -27
- data/man/bundle-update.1.txt +0 -391
- data/man/bundle-viz.1.txt +0 -39
- data/man/bundle.1.txt +0 -113
- data/man/gemfile.5.txt +0 -653
data/lib/bundler/rubygems_ext.rb
CHANGED
@@ -2,53 +2,34 @@
|
|
2
2
|
|
3
3
|
require "pathname"
|
4
4
|
|
5
|
-
if defined?(Gem::QuickLoader)
|
6
|
-
# Gem Prelude makes me a sad panda :'(
|
7
|
-
Gem::QuickLoader.load_full_rubygems_library
|
8
|
-
end
|
9
|
-
|
10
|
-
require "rubygems"
|
11
5
|
require "rubygems/specification"
|
12
6
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
require "rubygems/source"
|
17
|
-
rescue LoadError
|
18
|
-
# Not available before RubyGems 2.0.0, ignore
|
19
|
-
nil
|
20
|
-
end
|
7
|
+
# Possible use in Gem::Specification#source below and require
|
8
|
+
# shouldn't be deferred.
|
9
|
+
require "rubygems/source"
|
21
10
|
|
22
|
-
|
11
|
+
require_relative "match_platform"
|
23
12
|
|
24
13
|
module Gem
|
25
|
-
@loaded_stacks = Hash.new {|h, k| h[k] = [] }
|
26
|
-
|
27
14
|
class Specification
|
28
15
|
attr_accessor :remote, :location, :relative_loaded_from
|
29
16
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
(defined?(@source) && @source) || Gem::Source::Installed.new
|
35
|
-
end
|
36
|
-
else
|
37
|
-
attr_accessor :source
|
17
|
+
remove_method :source
|
18
|
+
attr_writer :source
|
19
|
+
def source
|
20
|
+
(defined?(@source) && @source) || Gem::Source::Installed.new
|
38
21
|
end
|
39
22
|
|
40
23
|
alias_method :rg_full_gem_path, :full_gem_path
|
41
24
|
alias_method :rg_loaded_from, :loaded_from
|
42
25
|
|
43
|
-
attr_writer :full_gem_path unless instance_methods.include?(:full_gem_path=)
|
44
|
-
|
45
26
|
def full_gem_path
|
46
27
|
# this cannot check source.is_a?(Bundler::Plugin::API::Source)
|
47
28
|
# because that _could_ trip the autoload, and if there are unresolved
|
48
29
|
# gems at that time, this method could be called inside another require,
|
49
30
|
# thus raising with that constant being undefined. Better to check a method
|
50
31
|
if source.respond_to?(:path) || (source.respond_to?(:bundler_plugin_api_source?) && source.bundler_plugin_api_source?)
|
51
|
-
Pathname.new(loaded_from).dirname.expand_path(source.root).to_s.untaint
|
32
|
+
Pathname.new(loaded_from).dirname.expand_path(source.root).to_s.tap{|x| x.untaint if RUBY_VERSION < "2.7" }
|
52
33
|
else
|
53
34
|
rg_full_gem_path
|
54
35
|
end
|
@@ -63,32 +44,20 @@ module Gem
|
|
63
44
|
end
|
64
45
|
|
65
46
|
def load_paths
|
66
|
-
|
67
|
-
|
68
|
-
require_paths.map do |require_path|
|
69
|
-
if require_path.include?(full_gem_path)
|
70
|
-
require_path
|
71
|
-
else
|
72
|
-
File.join(full_gem_path, require_path)
|
73
|
-
end
|
74
|
-
end
|
47
|
+
full_require_paths
|
75
48
|
end
|
76
49
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
end
|
50
|
+
alias_method :rg_extension_dir, :extension_dir
|
51
|
+
def extension_dir
|
52
|
+
@bundler_extension_dir ||= if source.respond_to?(:extension_dir_name)
|
53
|
+
unique_extension_dir = [source.extension_dir_name, File.basename(full_gem_path)].uniq.join("-")
|
54
|
+
File.expand_path(File.join(extensions_dir, unique_extension_dir))
|
55
|
+
else
|
56
|
+
rg_extension_dir
|
85
57
|
end
|
86
58
|
end
|
87
59
|
|
88
|
-
|
89
|
-
methods = instance_methods(false)
|
90
|
-
gem_dir = methods.first.is_a?(String) ? "gem_dir" : :gem_dir
|
91
|
-
remove_method :gem_dir if methods.include?(gem_dir)
|
60
|
+
remove_method :gem_dir if instance_methods(false).include?(:gem_dir)
|
92
61
|
def gem_dir
|
93
62
|
full_gem_path
|
94
63
|
end
|
@@ -116,7 +85,11 @@ module Gem
|
|
116
85
|
dependencies - development_dependencies
|
117
86
|
end
|
118
87
|
|
119
|
-
|
88
|
+
def deleted_gem?
|
89
|
+
!default_gem? && !File.directory?(full_gem_path)
|
90
|
+
end
|
91
|
+
|
92
|
+
private
|
120
93
|
|
121
94
|
def dependencies_to_gemfile(dependencies, group = nil)
|
122
95
|
gemfile = String.new
|
@@ -136,7 +109,7 @@ module Gem
|
|
136
109
|
end
|
137
110
|
|
138
111
|
class Dependency
|
139
|
-
attr_accessor :source, :groups
|
112
|
+
attr_accessor :source, :groups
|
140
113
|
|
141
114
|
alias_method :eql?, :==
|
142
115
|
|
@@ -147,7 +120,7 @@ module Gem
|
|
147
120
|
end
|
148
121
|
|
149
122
|
def to_yaml_properties
|
150
|
-
instance_variables.reject {|p| ["@source", "@groups"
|
123
|
+
instance_variables.reject {|p| ["@source", "@groups"].include?(p.to_s) }
|
151
124
|
end
|
152
125
|
|
153
126
|
def to_lock
|
@@ -158,48 +131,99 @@ module Gem
|
|
158
131
|
end
|
159
132
|
out
|
160
133
|
end
|
134
|
+
end
|
161
135
|
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
136
|
+
# comparison is done order independently since rubygems 3.2.0.rc.2
|
137
|
+
unless Gem::Requirement.new("> 1", "< 2") == Gem::Requirement.new("< 2", "> 1")
|
138
|
+
class Requirement
|
139
|
+
module OrderIndependentComparison
|
140
|
+
def ==(other)
|
141
|
+
if _requirements_sorted? && other._requirements_sorted?
|
142
|
+
super
|
143
|
+
else
|
144
|
+
_with_sorted_requirements == other._with_sorted_requirements
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
protected
|
167
149
|
|
168
|
-
|
169
|
-
|
150
|
+
def _requirements_sorted?
|
151
|
+
return @_are_requirements_sorted if defined?(@_are_requirements_sorted)
|
152
|
+
strings = as_list
|
153
|
+
@_are_requirements_sorted = strings == strings.sort
|
154
|
+
end
|
155
|
+
|
156
|
+
def _with_sorted_requirements
|
157
|
+
@_with_sorted_requirements ||= _requirements_sorted? ? self : self.class.new(as_list.sort)
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
161
|
+
prepend OrderIndependentComparison
|
162
|
+
end
|
170
163
|
end
|
171
164
|
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
end unless allocate.respond_to?(:exact?)
|
165
|
+
if Gem::Requirement.new("~> 2.0").hash == Gem::Requirement.new("~> 2.0.0").hash
|
166
|
+
class Requirement
|
167
|
+
module CorrectHashForLambdaOperator
|
168
|
+
def hash
|
169
|
+
if requirements.any? {|r| r.first == "~>" }
|
170
|
+
requirements.map {|r| r.first == "~>" ? [r[0], r[1].to_s] : r }.sort.hash
|
171
|
+
else
|
172
|
+
super
|
173
|
+
end
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
prepend CorrectHashForLambdaOperator
|
178
|
+
end
|
187
179
|
end
|
188
180
|
|
181
|
+
require "rubygems/platform"
|
182
|
+
|
189
183
|
class Platform
|
190
184
|
JAVA = Gem::Platform.new("java") unless defined?(JAVA)
|
191
185
|
MSWIN = Gem::Platform.new("mswin32") unless defined?(MSWIN)
|
192
186
|
MSWIN64 = Gem::Platform.new("mswin64") unless defined?(MSWIN64)
|
193
187
|
MINGW = Gem::Platform.new("x86-mingw32") unless defined?(MINGW)
|
194
188
|
X64_MINGW = Gem::Platform.new("x64-mingw32") unless defined?(X64_MINGW)
|
189
|
+
end
|
190
|
+
|
191
|
+
Platform.singleton_class.module_eval do
|
192
|
+
unless Platform.singleton_methods.include?(:match_spec?)
|
193
|
+
def match_spec?(spec)
|
194
|
+
match_gem?(spec.platform, spec.name)
|
195
|
+
end
|
196
|
+
|
197
|
+
def match_gem?(platform, gem_name)
|
198
|
+
match_platforms?(platform, Gem.platforms)
|
199
|
+
end
|
200
|
+
|
201
|
+
private
|
195
202
|
|
196
|
-
|
197
|
-
|
198
|
-
|
203
|
+
def match_platforms?(platform, platforms)
|
204
|
+
platforms.any? do |local_platform|
|
205
|
+
platform.nil? ||
|
206
|
+
local_platform == platform ||
|
207
|
+
(local_platform != Gem::Platform::RUBY && local_platform =~ platform)
|
208
|
+
end
|
209
|
+
end
|
199
210
|
end
|
211
|
+
end
|
200
212
|
|
201
|
-
|
202
|
-
|
213
|
+
require "rubygems/util"
|
214
|
+
|
215
|
+
Util.singleton_class.module_eval do
|
216
|
+
if Util.singleton_methods.include?(:glob_files_in_dir) # since 3.0.0.beta.2
|
217
|
+
remove_method :glob_files_in_dir
|
218
|
+
end
|
219
|
+
|
220
|
+
def glob_files_in_dir(glob, base_path)
|
221
|
+
if RUBY_VERSION >= "2.5"
|
222
|
+
Dir.glob(glob, :base => base_path).map! {|f| File.expand_path(f, base_path) }
|
223
|
+
else
|
224
|
+
Dir.glob(File.join(base_path.to_s.gsub(/[\[\]]/, '\\\\\\&'), glob)).map! {|f| File.expand_path(f) }
|
225
|
+
end
|
226
|
+
end
|
203
227
|
end
|
204
228
|
end
|
205
229
|
|
@@ -4,14 +4,60 @@ require "rubygems/installer"
|
|
4
4
|
|
5
5
|
module Bundler
|
6
6
|
class RubyGemsGemInstaller < Gem::Installer
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
def check_executable_overwrite(filename)
|
8
|
+
# Bundler needs to install gems regardless of binstub overwriting
|
9
|
+
end
|
10
|
+
|
11
|
+
def install
|
12
|
+
pre_install_checks
|
13
|
+
|
14
|
+
run_pre_install_hooks
|
15
|
+
|
16
|
+
spec.loaded_from = spec_file
|
17
|
+
|
18
|
+
# Completely remove any previous gem files
|
19
|
+
strict_rm_rf gem_dir
|
20
|
+
strict_rm_rf spec.extension_dir
|
21
|
+
|
22
|
+
SharedHelpers.filesystem_access(gem_dir, :create) do
|
23
|
+
FileUtils.mkdir_p gem_dir, :mode => 0o755
|
24
|
+
end
|
25
|
+
|
26
|
+
extract_files
|
27
|
+
|
28
|
+
build_extensions
|
29
|
+
write_build_info_file
|
30
|
+
run_post_build_hooks
|
31
|
+
|
32
|
+
generate_bin
|
33
|
+
generate_plugins
|
34
|
+
|
35
|
+
write_spec
|
36
|
+
|
37
|
+
SharedHelpers.filesystem_access("#{gem_home}/cache", :write) do
|
38
|
+
write_cache_file
|
10
39
|
end
|
40
|
+
|
41
|
+
say spec.post_install_message unless spec.post_install_message.nil?
|
42
|
+
|
43
|
+
run_post_install_hooks
|
44
|
+
|
45
|
+
spec
|
11
46
|
end
|
12
47
|
|
13
|
-
def
|
14
|
-
|
48
|
+
def generate_plugins
|
49
|
+
return unless Gem::Installer.instance_methods(false).include?(:generate_plugins)
|
50
|
+
|
51
|
+
latest = Gem::Specification.stubs_for(spec.name).first
|
52
|
+
return if latest && latest.version > spec.version
|
53
|
+
|
54
|
+
ensure_writable_dir @plugins_dir
|
55
|
+
|
56
|
+
if spec.plugins.empty?
|
57
|
+
remove_plugins_for(spec, @plugins_dir)
|
58
|
+
else
|
59
|
+
regenerate_plugins_for(spec, @plugins_dir)
|
60
|
+
end
|
15
61
|
end
|
16
62
|
|
17
63
|
def pre_install_checks
|
@@ -20,7 +66,10 @@ module Bundler
|
|
20
66
|
|
21
67
|
def build_extensions
|
22
68
|
extension_cache_path = options[:bundler_extension_cache_path]
|
23
|
-
|
69
|
+
unless extension_cache_path && extension_dir = spec.extension_dir
|
70
|
+
require "shellwords" # compensate missing require in rubygems before version 3.2.25
|
71
|
+
return super
|
72
|
+
end
|
24
73
|
|
25
74
|
extension_dir = Pathname.new(extension_dir)
|
26
75
|
build_complete = SharedHelpers.filesystem_access(extension_cache_path.join("gem.build_complete"), :read, &:file?)
|
@@ -30,6 +79,7 @@ module Bundler
|
|
30
79
|
FileUtils.cp_r extension_cache_path, spec.extension_dir
|
31
80
|
end
|
32
81
|
else
|
82
|
+
require "shellwords" # compensate missing require in rubygems before version 3.2.25
|
33
83
|
super
|
34
84
|
if extension_dir.directory? # not made for gems without extensions
|
35
85
|
SharedHelpers.filesystem_access(extension_cache_path.parent, &:mkpath)
|
@@ -40,7 +90,18 @@ module Bundler
|
|
40
90
|
end
|
41
91
|
end
|
42
92
|
|
43
|
-
|
93
|
+
private
|
94
|
+
|
95
|
+
def strict_rm_rf(dir)
|
96
|
+
# FileUtils.rm_rf should probably rise in case of permission issues like
|
97
|
+
# `rm -rf` does. However, it fails to delete the folder silently due to
|
98
|
+
# https://github.com/ruby/fileutils/issues/57. It should probably be fixed
|
99
|
+
# inside `fileutils` but for now I`m checking whether the folder was
|
100
|
+
# removed after it completes, and raising otherwise.
|
101
|
+
FileUtils.rm_rf dir
|
102
|
+
|
103
|
+
raise PermissionError.new(dir, :delete) if File.directory?(dir)
|
104
|
+
end
|
44
105
|
|
45
106
|
def validate_bundler_checksum(checksum)
|
46
107
|
return true if Bundler.settings[:disable_checksum_validation]
|
@@ -66,7 +127,7 @@ module Bundler
|
|
66
127
|
|
67
128
|
If you wish to continue installing the downloaded gem, and are certain it does not pose a \
|
68
129
|
security issue despite the mismatching checksum, do the following:
|
69
|
-
1. run `bundle config disable_checksum_validation true` to turn off checksum verification
|
130
|
+
1. run `bundle config set --local disable_checksum_validation true` to turn off checksum verification
|
70
131
|
2. run `bundle install`
|
71
132
|
|
72
133
|
(More info: The expected SHA256 checksum was #{checksum.inspect}, but the \
|