bundler 2.1.4 → 2.3.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2164 -1430
- data/README.md +7 -9
- data/bundler.gemspec +5 -6
- data/exe/bundle +10 -8
- data/exe/bundler +1 -1
- data/lib/bundler/.document +1 -0
- data/lib/bundler/build_metadata.rb +3 -11
- data/lib/bundler/cli/add.rb +1 -1
- data/lib/bundler/cli/binstubs.rb +6 -2
- data/lib/bundler/cli/cache.rb +3 -8
- data/lib/bundler/cli/check.rb +4 -2
- data/lib/bundler/cli/clean.rb +1 -1
- data/lib/bundler/cli/common.rb +30 -3
- data/lib/bundler/cli/config.rb +10 -1
- data/lib/bundler/cli/console.rb +1 -1
- data/lib/bundler/cli/doctor.rb +25 -6
- data/lib/bundler/cli/exec.rb +5 -10
- data/lib/bundler/cli/fund.rb +36 -0
- data/lib/bundler/cli/gem.rb +219 -28
- data/lib/bundler/cli/info.rb +38 -6
- data/lib/bundler/cli/init.rb +3 -3
- data/lib/bundler/cli/inject.rb +1 -1
- data/lib/bundler/cli/install.rb +20 -52
- data/lib/bundler/cli/issue.rb +5 -4
- data/lib/bundler/cli/list.rb +19 -11
- data/lib/bundler/cli/lock.rb +5 -1
- data/lib/bundler/cli/open.rb +1 -2
- data/lib/bundler/cli/outdated.rb +95 -75
- data/lib/bundler/cli/platform.rb +1 -1
- data/lib/bundler/cli/plugin.rb +10 -0
- data/lib/bundler/cli/pristine.rb +5 -0
- data/lib/bundler/cli/remove.rb +1 -2
- data/lib/bundler/cli/show.rb +2 -2
- data/lib/bundler/cli/update.rb +20 -9
- data/lib/bundler/cli.rb +101 -81
- data/lib/bundler/compact_index_client/cache.rb +6 -23
- data/lib/bundler/compact_index_client/gem_parser.rb +28 -0
- data/lib/bundler/compact_index_client/updater.rb +13 -22
- data/lib/bundler/compact_index_client.rb +3 -9
- data/lib/bundler/current_ruby.rb +6 -4
- data/lib/bundler/definition.rb +201 -385
- data/lib/bundler/dep_proxy.rb +16 -9
- data/lib/bundler/dependency.rb +23 -14
- data/lib/bundler/digest.rb +71 -0
- data/lib/bundler/dsl.rb +71 -74
- data/lib/bundler/endpoint_specification.rb +22 -12
- data/lib/bundler/env.rb +2 -2
- data/lib/bundler/environment_preserver.rb +29 -2
- data/lib/bundler/errors.rb +20 -3
- data/lib/bundler/feature_flag.rb +0 -8
- data/lib/bundler/fetcher/base.rb +1 -1
- data/lib/bundler/fetcher/compact_index.rb +11 -16
- data/lib/bundler/fetcher/downloader.rb +10 -7
- data/lib/bundler/fetcher/index.rb +2 -30
- data/lib/bundler/fetcher.rb +18 -23
- data/lib/bundler/friendly_errors.rb +25 -43
- data/lib/bundler/gem_helper.rb +53 -31
- data/lib/bundler/gem_helpers.rb +36 -25
- data/lib/bundler/gem_version_promoter.rb +4 -4
- data/lib/bundler/graph.rb +1 -1
- data/lib/bundler/index.rb +9 -9
- data/lib/bundler/injector.rb +33 -6
- data/lib/bundler/inline.rb +3 -2
- data/lib/bundler/installer/gem_installer.rb +7 -25
- data/lib/bundler/installer/parallel_installer.rb +46 -25
- data/lib/bundler/installer/standalone.rb +30 -10
- data/lib/bundler/installer.rb +36 -59
- data/lib/bundler/lazy_specification.rb +62 -26
- data/lib/bundler/lockfile_generator.rb +2 -2
- data/lib/bundler/lockfile_parser.rb +17 -46
- data/lib/bundler/man/.document +1 -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 +5 -3
- data/{man/bundle-binstubs.ronn → lib/bundler/man/bundle-binstubs.1.ronn} +2 -4
- data/{man → lib/bundler/man}/bundle-cache.1 +1 -1
- data/{man → lib/bundler/man}/bundle-check.1 +1 -1
- data/{man → lib/bundler/man}/bundle-clean.1 +1 -1
- data/{man → lib/bundler/man}/bundle-config.1 +44 -45
- data/{man/bundle-config.ronn → lib/bundler/man/bundle-config.1.ronn} +59 -60
- data/{man → lib/bundler/man}/bundle-doctor.1 +1 -1
- data/{man → lib/bundler/man}/bundle-exec.1 +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 → lib/bundler/man}/bundle-init.1 +1 -1
- data/{man → lib/bundler/man}/bundle-inject.1 +1 -1
- data/{man → lib/bundler/man}/bundle-install.1 +31 -4
- data/{man/bundle-install.ronn → lib/bundler/man/bundle-install.1.ronn} +27 -5
- 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 → lib/bundler/man}/bundle-open.1 +1 -1
- data/{man → lib/bundler/man}/bundle-outdated.1 +3 -10
- data/{man/bundle-outdated.ronn → lib/bundler/man/bundle-outdated.1.ronn} +1 -10
- data/{man → lib/bundler/man}/bundle-platform.1 +1 -1
- data/{man → lib/bundler/man}/bundle-pristine.1 +1 -1
- data/{man → lib/bundler/man}/bundle-remove.1 +1 -1
- data/{man → lib/bundler/man}/bundle-show.1 +1 -1
- data/{man → lib/bundler/man}/bundle-update.1 +5 -5
- data/{man/bundle-update.ronn → lib/bundler/man/bundle-update.1.ronn} +5 -4
- data/{man → lib/bundler/man}/bundle-viz.1 +1 -1
- data/{man → lib/bundler/man}/bundle.1 +1 -1
- data/{man → lib/bundler/man}/gemfile.5 +31 -5
- data/{man → lib/bundler/man}/gemfile.5.ronn +13 -5
- data/lib/bundler/mirror.rb +2 -2
- data/lib/bundler/plugin/api/source.rb +23 -7
- data/lib/bundler/plugin/dsl.rb +1 -1
- data/lib/bundler/plugin/index.rb +13 -1
- data/lib/bundler/plugin/installer/rubygems.rb +1 -1
- data/lib/bundler/plugin/installer.rb +11 -11
- data/lib/bundler/plugin/source_list.rb +5 -1
- data/lib/bundler/plugin.rb +56 -11
- data/lib/bundler/process_lock.rb +1 -1
- data/lib/bundler/remote_specification.rb +12 -2
- data/lib/bundler/resolver/spec_group.rb +58 -55
- data/lib/bundler/resolver.rb +176 -177
- data/lib/bundler/retry.rb +2 -2
- data/lib/bundler/ruby_version.rb +2 -15
- data/lib/bundler/rubygems_ext.rb +137 -28
- data/lib/bundler/rubygems_gem_installer.rb +69 -8
- data/lib/bundler/rubygems_integration.rb +69 -133
- data/lib/bundler/runtime.rb +22 -25
- data/lib/bundler/self_manager.rb +168 -0
- data/lib/bundler/settings.rb +144 -65
- data/lib/bundler/setup.rb +2 -2
- data/lib/bundler/shared_helpers.rb +12 -27
- data/lib/bundler/similarity_detector.rb +1 -1
- data/lib/bundler/source/git/git_proxy.rb +88 -84
- data/lib/bundler/source/git.rb +43 -23
- data/lib/bundler/source/metadata.rb +3 -7
- data/lib/bundler/source/path/installer.rb +10 -10
- data/lib/bundler/source/path.rb +10 -4
- data/lib/bundler/source/rubygems/remote.rb +1 -1
- data/lib/bundler/source/rubygems.rb +126 -116
- data/lib/bundler/source/rubygems_aggregate.rb +68 -0
- data/lib/bundler/source.rb +22 -1
- data/lib/bundler/source_list.rb +101 -63
- data/lib/bundler/source_map.rb +71 -0
- data/lib/bundler/spec_set.rb +26 -41
- data/lib/bundler/stub_specification.rb +25 -7
- data/lib/bundler/templates/Executable +2 -4
- data/lib/bundler/templates/Executable.bundler +8 -8
- data/lib/bundler/templates/Executable.standalone +2 -4
- data/lib/bundler/templates/Gemfile +0 -2
- data/lib/bundler/templates/gems.rb +0 -3
- 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 +12 -1
- data/lib/bundler/templates/newgem/README.md.tt +9 -14
- data/lib/bundler/templates/newgem/Rakefile.tt +32 -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 +27 -17
- 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 +3 -0
- data/lib/bundler/templates/newgem/test/{test_helper.rb.tt → minitest/test_helper.rb.tt} +2 -0
- data/lib/bundler/templates/newgem/test/{newgem_test.rb.tt → minitest/test_newgem.rb.tt} +3 -1
- 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/ui/shell.rb +6 -6
- data/lib/bundler/uri_credentials_filter.rb +3 -1
- 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 +19 -21
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +1 -1
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +57 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +39 -74
- data/lib/bundler/vendor/fileutils/LICENSE.txt +22 -0
- 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/tag.rb +2 -2
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +11 -5
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +37 -5
- data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +34 -28
- 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 +49 -47
- data/lib/bundler/vendor/molinillo/lib/molinillo.rb +0 -1
- data/lib/bundler/vendor/net-http-persistent/README.rdoc +82 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +82 -189
- data/lib/bundler/vendor/thor/LICENSE.md +20 -0
- data/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +2 -1
- data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +9 -7
- data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +1 -2
- data/lib/bundler/vendor/thor/lib/thor/actions.rb +7 -3
- data/lib/bundler/vendor/thor/lib/thor/base.rb +9 -0
- data/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +6 -0
- data/lib/bundler/vendor/thor/lib/thor/error.rb +10 -5
- data/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +5 -1
- data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +28 -9
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +27 -6
- data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +5 -1
- data/lib/bundler/vendor/thor/lib/thor/shell.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/util.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor.rb +5 -13
- 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 +452 -0
- data/lib/bundler/vendor/uri/LICENSE.txt +22 -0
- data/lib/bundler/vendor/uri/lib/uri/common.rb +17 -80
- data/lib/bundler/vendor/uri/lib/uri/ftp.rb +0 -1
- data/lib/bundler/vendor/uri/lib/uri/generic.rb +5 -6
- data/lib/bundler/vendor/uri/lib/uri/http.rb +0 -1
- data/lib/bundler/vendor/uri/lib/uri/https.rb +0 -1
- data/lib/bundler/vendor/uri/lib/uri/ldap.rb +1 -1
- data/lib/bundler/vendor/uri/lib/uri/mailto.rb +0 -1
- data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +1 -14
- data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +1 -12
- data/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
- data/lib/bundler/vendor/uri/lib/uri/ws.rb +84 -0
- data/lib/bundler/vendor/uri/lib/uri/wss.rb +22 -0
- data/lib/bundler/vendor/uri/lib/uri.rb +0 -1
- data/lib/bundler/vendored_persistent.rb +0 -7
- data/lib/bundler/vendored_tmpdir.rb +4 -0
- data/lib/bundler/vendored_tsort.rb +4 -0
- data/lib/bundler/version.rb +1 -1
- data/lib/bundler/worker.rb +20 -5
- data/lib/bundler/yaml_serializer.rb +1 -1
- data/lib/bundler.rb +64 -43
- metadata +94 -91
- data/lib/bundler/gemdeps.rb +0 -29
- data/lib/bundler/psyched_yaml.rb +0 -37
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/monotonic_time.rb +0 -66
- data/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb +0 -26
- data/man/bundle-add.1.txt +0 -58
- data/man/bundle-binstubs.1.txt +0 -48
- data/man/bundle-cache.1.txt +0 -78
- data/man/bundle-check.1.txt +0 -33
- data/man/bundle-clean.1.txt +0 -26
- data/man/bundle-config.1.txt +0 -528
- 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 -401
- 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-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 -390
- data/man/bundle-viz.1.txt +0 -39
- data/man/bundle.1.txt +0 -116
- data/man/gemfile.5.txt +0 -649
- /data/{man/bundle-cache.ronn → lib/bundler/man/bundle-cache.1.ronn} +0 -0
- /data/{man/bundle-check.ronn → lib/bundler/man/bundle-check.1.ronn} +0 -0
- /data/{man/bundle-clean.ronn → lib/bundler/man/bundle-clean.1.ronn} +0 -0
- /data/{man/bundle-doctor.ronn → lib/bundler/man/bundle-doctor.1.ronn} +0 -0
- /data/{man/bundle-exec.ronn → lib/bundler/man/bundle-exec.1.ronn} +0 -0
- /data/{man/bundle-info.ronn → lib/bundler/man/bundle-info.1.ronn} +0 -0
- /data/{man/bundle-init.ronn → lib/bundler/man/bundle-init.1.ronn} +0 -0
- /data/{man/bundle-inject.ronn → lib/bundler/man/bundle-inject.1.ronn} +0 -0
- /data/{man/bundle-lock.ronn → lib/bundler/man/bundle-lock.1.ronn} +0 -0
- /data/{man/bundle-open.ronn → lib/bundler/man/bundle-open.1.ronn} +0 -0
- /data/{man/bundle-platform.ronn → lib/bundler/man/bundle-platform.1.ronn} +0 -0
- /data/{man/bundle-pristine.ronn → lib/bundler/man/bundle-pristine.1.ronn} +0 -0
- /data/{man/bundle-remove.ronn → lib/bundler/man/bundle-remove.1.ronn} +0 -0
- /data/{man/bundle-show.ronn → lib/bundler/man/bundle-show.1.ronn} +0 -0
- /data/{man/bundle-viz.ronn → lib/bundler/man/bundle-viz.1.ronn} +0 -0
- /data/{man/bundle.ronn → lib/bundler/man/bundle.1.ronn} +0 -0
- /data/{man → lib/bundler/man}/index.txt +0 -0
data/lib/bundler/rubygems_ext.rb
CHANGED
@@ -4,14 +4,23 @@ require "pathname"
|
|
4
4
|
|
5
5
|
require "rubygems/specification"
|
6
6
|
|
7
|
-
#
|
8
|
-
#
|
7
|
+
# We can't let `Gem::Source` be autoloaded in the `Gem::Specification#source`
|
8
|
+
# redefinition below, so we need to load it upfront. The reason is that if
|
9
|
+
# Bundler monkeypatches are loaded before RubyGems activates an executable (for
|
10
|
+
# example, through `ruby -rbundler -S irb`), gem activation might end up calling
|
11
|
+
# the redefined `Gem::Specification#source` and triggering the `Gem::Source`
|
12
|
+
# autoload. That would result in requiring "rubygems/source" inside another
|
13
|
+
# require, which would trigger a monitor error and cause the `autoload` to
|
14
|
+
# eventually fail. A better solution is probably to completely avoid autoloading
|
15
|
+
# `Gem::Source` from the redefined `Gem::Specification#source`.
|
9
16
|
require "rubygems/source"
|
10
17
|
|
11
18
|
require_relative "match_platform"
|
12
19
|
|
13
20
|
module Gem
|
14
21
|
class Specification
|
22
|
+
include ::Bundler::MatchPlatform
|
23
|
+
|
15
24
|
attr_accessor :remote, :location, :relative_loaded_from
|
16
25
|
|
17
26
|
remove_method :source
|
@@ -24,11 +33,7 @@ module Gem
|
|
24
33
|
alias_method :rg_loaded_from, :loaded_from
|
25
34
|
|
26
35
|
def full_gem_path
|
27
|
-
|
28
|
-
# because that _could_ trip the autoload, and if there are unresolved
|
29
|
-
# gems at that time, this method could be called inside another require,
|
30
|
-
# thus raising with that constant being undefined. Better to check a method
|
31
|
-
if source.respond_to?(:path) || (source.respond_to?(:bundler_plugin_api_source?) && source.bundler_plugin_api_source?)
|
36
|
+
if source.respond_to?(:root)
|
32
37
|
Pathname.new(loaded_from).dirname.expand_path(source.root).to_s.tap{|x| x.untaint if RUBY_VERSION < "2.7" }
|
33
38
|
else
|
34
39
|
rg_full_gem_path
|
@@ -47,14 +52,13 @@ module Gem
|
|
47
52
|
full_require_paths
|
48
53
|
end
|
49
54
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
end
|
55
|
+
alias_method :rg_extension_dir, :extension_dir
|
56
|
+
def extension_dir
|
57
|
+
@bundler_extension_dir ||= if source.respond_to?(:extension_dir_name)
|
58
|
+
unique_extension_dir = [source.extension_dir_name, File.basename(full_gem_path)].uniq.join("-")
|
59
|
+
File.expand_path(File.join(extensions_dir, unique_extension_dir))
|
60
|
+
else
|
61
|
+
rg_extension_dir
|
58
62
|
end
|
59
63
|
end
|
60
64
|
|
@@ -63,6 +67,23 @@ module Gem
|
|
63
67
|
full_gem_path
|
64
68
|
end
|
65
69
|
|
70
|
+
unless const_defined?(:LATEST_RUBY_WITHOUT_PATCH_VERSIONS)
|
71
|
+
LATEST_RUBY_WITHOUT_PATCH_VERSIONS = Gem::Version.new("2.1")
|
72
|
+
|
73
|
+
alias_method :rg_required_ruby_version=, :required_ruby_version=
|
74
|
+
def required_ruby_version=(req)
|
75
|
+
self.rg_required_ruby_version = req
|
76
|
+
|
77
|
+
@required_ruby_version.requirements.map! do |op, v|
|
78
|
+
if v >= LATEST_RUBY_WITHOUT_PATCH_VERSIONS && v.release.segments.size == 4
|
79
|
+
[op == "~>" ? "=" : op, Gem::Version.new(v.segments.tap {|s| s.delete_at(3) }.join("."))]
|
80
|
+
else
|
81
|
+
[op, v]
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
66
87
|
def groups
|
67
88
|
@groups ||= []
|
68
89
|
end
|
@@ -82,11 +103,26 @@ module Gem
|
|
82
103
|
gemfile
|
83
104
|
end
|
84
105
|
|
106
|
+
# Backfill missing YAML require when not defined. Fixed since 3.1.0.pre1.
|
107
|
+
module YamlBackfiller
|
108
|
+
def to_yaml(opts = {})
|
109
|
+
Gem.load_yaml unless defined?(::YAML)
|
110
|
+
|
111
|
+
super(opts)
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
prepend YamlBackfiller
|
116
|
+
|
85
117
|
def nondevelopment_dependencies
|
86
118
|
dependencies - development_dependencies
|
87
119
|
end
|
88
120
|
|
89
|
-
|
121
|
+
def deleted_gem?
|
122
|
+
!default_gem? && !File.directory?(full_gem_path)
|
123
|
+
end
|
124
|
+
|
125
|
+
private
|
90
126
|
|
91
127
|
def dependencies_to_gemfile(dependencies, group = nil)
|
92
128
|
gemfile = String.new
|
@@ -106,7 +142,7 @@ module Gem
|
|
106
142
|
end
|
107
143
|
|
108
144
|
class Dependency
|
109
|
-
attr_accessor :source, :groups
|
145
|
+
attr_accessor :source, :groups
|
110
146
|
|
111
147
|
alias_method :eql?, :==
|
112
148
|
|
@@ -117,7 +153,7 @@ module Gem
|
|
117
153
|
end
|
118
154
|
|
119
155
|
def to_yaml_properties
|
120
|
-
instance_variables.reject {|p| ["@source", "@groups"
|
156
|
+
instance_variables.reject {|p| ["@source", "@groups"].include?(p.to_s) }
|
121
157
|
end
|
122
158
|
|
123
159
|
def to_lock
|
@@ -130,25 +166,98 @@ module Gem
|
|
130
166
|
end
|
131
167
|
end
|
132
168
|
|
169
|
+
# comparison is done order independently since rubygems 3.2.0.rc.2
|
170
|
+
unless Gem::Requirement.new("> 1", "< 2") == Gem::Requirement.new("< 2", "> 1")
|
171
|
+
class Requirement
|
172
|
+
module OrderIndependentComparison
|
173
|
+
def ==(other)
|
174
|
+
return unless Gem::Requirement === other
|
175
|
+
|
176
|
+
if _requirements_sorted? && other._requirements_sorted?
|
177
|
+
super
|
178
|
+
else
|
179
|
+
_with_sorted_requirements == other._with_sorted_requirements
|
180
|
+
end
|
181
|
+
end
|
182
|
+
|
183
|
+
protected
|
184
|
+
|
185
|
+
def _requirements_sorted?
|
186
|
+
return @_are_requirements_sorted if defined?(@_are_requirements_sorted)
|
187
|
+
strings = as_list
|
188
|
+
@_are_requirements_sorted = strings == strings.sort
|
189
|
+
end
|
190
|
+
|
191
|
+
def _with_sorted_requirements
|
192
|
+
@_with_sorted_requirements ||= _requirements_sorted? ? self : self.class.new(as_list.sort)
|
193
|
+
end
|
194
|
+
end
|
195
|
+
|
196
|
+
prepend OrderIndependentComparison
|
197
|
+
end
|
198
|
+
end
|
199
|
+
|
200
|
+
if Gem::Requirement.new("~> 2.0").hash == Gem::Requirement.new("~> 2.0.0").hash
|
201
|
+
class Requirement
|
202
|
+
module CorrectHashForLambdaOperator
|
203
|
+
def hash
|
204
|
+
if requirements.any? {|r| r.first == "~>" }
|
205
|
+
requirements.map {|r| r.first == "~>" ? [r[0], r[1].to_s] : r }.sort.hash
|
206
|
+
else
|
207
|
+
super
|
208
|
+
end
|
209
|
+
end
|
210
|
+
end
|
211
|
+
|
212
|
+
prepend CorrectHashForLambdaOperator
|
213
|
+
end
|
214
|
+
end
|
215
|
+
|
216
|
+
require "rubygems/platform"
|
217
|
+
|
133
218
|
class Platform
|
134
219
|
JAVA = Gem::Platform.new("java") unless defined?(JAVA)
|
135
220
|
MSWIN = Gem::Platform.new("mswin32") unless defined?(MSWIN)
|
136
221
|
MSWIN64 = Gem::Platform.new("mswin64") unless defined?(MSWIN64)
|
137
222
|
MINGW = Gem::Platform.new("x86-mingw32") unless defined?(MINGW)
|
138
223
|
X64_MINGW = Gem::Platform.new("x64-mingw32") unless defined?(X64_MINGW)
|
224
|
+
end
|
139
225
|
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
226
|
+
Platform.singleton_class.module_eval do
|
227
|
+
unless Platform.singleton_methods.include?(:match_spec?)
|
228
|
+
def match_spec?(spec)
|
229
|
+
match_gem?(spec.platform, spec.name)
|
230
|
+
end
|
144
231
|
|
145
|
-
|
146
|
-
|
232
|
+
def match_gem?(platform, gem_name)
|
233
|
+
match_platforms?(platform, Gem.platforms)
|
234
|
+
end
|
235
|
+
|
236
|
+
private
|
237
|
+
|
238
|
+
def match_platforms?(platform, platforms)
|
239
|
+
platforms.any? do |local_platform|
|
240
|
+
platform.nil? ||
|
241
|
+
local_platform == platform ||
|
242
|
+
(local_platform != Gem::Platform::RUBY && local_platform =~ platform)
|
243
|
+
end
|
244
|
+
end
|
245
|
+
end
|
147
246
|
end
|
148
|
-
end
|
149
247
|
|
150
|
-
|
151
|
-
|
152
|
-
|
248
|
+
require "rubygems/util"
|
249
|
+
|
250
|
+
Util.singleton_class.module_eval do
|
251
|
+
if Util.singleton_methods.include?(:glob_files_in_dir) # since 3.0.0.beta.2
|
252
|
+
remove_method :glob_files_in_dir
|
253
|
+
end
|
254
|
+
|
255
|
+
def glob_files_in_dir(glob, base_path)
|
256
|
+
if RUBY_VERSION >= "2.5"
|
257
|
+
Dir.glob(glob, :base => base_path).map! {|f| File.expand_path(f, base_path) }
|
258
|
+
else
|
259
|
+
Dir.glob(File.join(base_path.to_s.gsub(/[\[\]]/, '\\\\\\&'), glob)).map! {|f| File.expand_path(f) }
|
260
|
+
end
|
261
|
+
end
|
153
262
|
end
|
154
263
|
end
|
@@ -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" unless Bundler.rubygems.provides?(">= 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 set 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 \
|