bundler 2.7.1 → 4.0.0.beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1001 -902
- data/README.md +4 -4
- data/bundler.gemspec +3 -3
- data/lib/bundler/build_metadata.rb +2 -2
- data/lib/bundler/capistrano.rb +1 -19
- data/lib/bundler/checksum.rb +6 -0
- data/lib/bundler/cli/cache.rb +1 -12
- data/lib/bundler/cli/common.rb +21 -4
- data/lib/bundler/cli/config.rb +1 -2
- data/lib/bundler/cli/console.rb +5 -0
- data/lib/bundler/cli/exec.rb +29 -4
- data/lib/bundler/cli/gem.rb +19 -33
- data/lib/bundler/cli/install.rb +7 -84
- data/lib/bundler/cli/issue.rb +2 -2
- data/lib/bundler/cli/list.rb +33 -2
- data/lib/bundler/cli/lock.rb +5 -5
- data/lib/bundler/cli/plugin.rb +5 -1
- data/lib/bundler/cli/show.rb +3 -7
- data/lib/bundler/cli/update.rb +3 -3
- data/lib/bundler/cli.rb +97 -95
- data/lib/bundler/compact_index_client.rb +0 -1
- data/lib/bundler/current_ruby.rb +3 -15
- data/lib/bundler/definition.rb +122 -95
- data/lib/bundler/deployment.rb +1 -64
- data/lib/bundler/digest.rb +1 -1
- data/lib/bundler/dsl.rb +14 -36
- data/lib/bundler/endpoint_specification.rb +0 -22
- data/lib/bundler/errors.rb +1 -5
- data/lib/bundler/feature_flag.rb +0 -33
- data/lib/bundler/fetcher/compact_index.rb +1 -1
- data/lib/bundler/friendly_errors.rb +2 -2
- data/lib/bundler/index.rb +0 -7
- data/lib/bundler/inline.rb +1 -1
- data/lib/bundler/installer/gem_installer.rb +0 -11
- data/lib/bundler/installer.rb +0 -6
- data/lib/bundler/lockfile_generator.rb +1 -1
- data/lib/bundler/lockfile_parser.rb +2 -12
- data/lib/bundler/man/bundle-add.1 +1 -1
- data/lib/bundler/man/bundle-binstubs.1 +3 -6
- data/lib/bundler/man/bundle-binstubs.1.ronn +4 -6
- data/lib/bundler/man/bundle-cache.1 +2 -14
- data/lib/bundler/man/bundle-cache.1.ronn +1 -14
- data/lib/bundler/man/bundle-check.1 +2 -5
- data/lib/bundler/man/bundle-check.1.ronn +0 -5
- data/lib/bundler/man/bundle-clean.1 +1 -1
- data/lib/bundler/man/bundle-config.1 +36 -46
- data/lib/bundler/man/bundle-config.1.ronn +69 -75
- data/lib/bundler/man/bundle-console.1 +1 -1
- data/lib/bundler/man/bundle-doctor.1 +4 -4
- data/lib/bundler/man/bundle-doctor.1.ronn +4 -4
- data/lib/bundler/man/bundle-env.1 +1 -1
- data/lib/bundler/man/bundle-exec.1 +2 -5
- data/lib/bundler/man/bundle-exec.1.ronn +1 -5
- data/lib/bundler/man/bundle-fund.1 +1 -1
- data/lib/bundler/man/bundle-gem.1 +3 -6
- data/lib/bundler/man/bundle-gem.1.ronn +2 -5
- data/lib/bundler/man/bundle-help.1 +1 -1
- data/lib/bundler/man/bundle-info.1 +1 -1
- data/lib/bundler/man/bundle-init.1 +1 -1
- data/lib/bundler/man/bundle-install.1 +8 -59
- data/lib/bundler/man/bundle-install.1.ronn +12 -107
- data/lib/bundler/man/bundle-issue.1 +1 -1
- data/lib/bundler/man/bundle-licenses.1 +1 -1
- data/lib/bundler/man/bundle-list.1 +6 -1
- data/lib/bundler/man/bundle-list.1.ronn +5 -0
- data/lib/bundler/man/bundle-lock.1 +1 -1
- data/lib/bundler/man/bundle-open.1 +1 -1
- data/lib/bundler/man/bundle-outdated.1 +1 -1
- data/lib/bundler/man/bundle-platform.1 +1 -1
- data/lib/bundler/man/bundle-plugin.1 +33 -15
- data/lib/bundler/man/bundle-plugin.1.ronn +36 -15
- data/lib/bundler/man/bundle-pristine.1 +1 -1
- data/lib/bundler/man/bundle-remove.1 +2 -8
- data/lib/bundler/man/bundle-remove.1.ronn +1 -8
- data/lib/bundler/man/bundle-show.1 +2 -5
- data/lib/bundler/man/bundle-show.1.ronn +0 -4
- data/lib/bundler/man/bundle-update.1 +1 -1
- data/lib/bundler/man/bundle-version.1 +1 -1
- data/lib/bundler/man/bundle.1 +1 -10
- data/lib/bundler/man/bundle.1.ronn +0 -9
- data/lib/bundler/man/gemfile.5 +1 -1
- data/lib/bundler/man/index.txt +0 -2
- data/lib/bundler/materialization.rb +1 -1
- data/lib/bundler/plugin/installer.rb +0 -10
- data/lib/bundler/plugin/source_list.rb +1 -1
- data/lib/bundler/plugin.rb +1 -1
- data/lib/bundler/resolver/package.rb +1 -0
- data/lib/bundler/resolver.rb +1 -1
- data/lib/bundler/ruby_dsl.rb +2 -0
- data/lib/bundler/ruby_version.rb +1 -3
- data/lib/bundler/rubygems_ext.rb +1 -1
- data/lib/bundler/rubygems_gem_installer.rb +1 -1
- data/lib/bundler/rubygems_integration.rb +1 -5
- data/lib/bundler/self_manager.rb +1 -1
- data/lib/bundler/settings.rb +8 -27
- data/lib/bundler/shared_helpers.rb +8 -20
- data/lib/bundler/source/gemspec.rb +4 -0
- data/lib/bundler/source/git/git_proxy.rb +3 -11
- data/lib/bundler/source/git.rb +2 -3
- data/lib/bundler/source/path.rb +5 -7
- data/lib/bundler/source/rubygems.rb +11 -17
- data/lib/bundler/source.rb +1 -1
- data/lib/bundler/source_list.rb +4 -45
- data/lib/bundler/source_map.rb +2 -5
- data/lib/bundler/spec_set.rb +6 -15
- data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +7 -129
- data/lib/bundler/templates/newgem/circleci/config.yml.tt +12 -0
- data/lib/bundler/templates/newgem/ext/newgem/Cargo.toml.tt +1 -1
- data/lib/bundler/templates/newgem/ext/newgem/extconf-go.rb.tt +11 -0
- data/lib/bundler/templates/newgem/ext/newgem/go.mod.tt +5 -0
- data/lib/bundler/templates/newgem/ext/newgem/newgem-go.c.tt +2 -0
- data/lib/bundler/templates/newgem/ext/newgem/newgem.go.tt +31 -0
- data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +6 -0
- data/lib/bundler/templates/newgem/gitlab-ci.yml.tt +9 -0
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +7 -4
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +26 -23
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +1 -1
- data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +50 -6
- data/lib/bundler/vendor/fileutils/lib/fileutils.rb +57 -52
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +5 -2
- data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +42 -6
- data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/runner.rb +2 -2
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +3 -7
- data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/lib/bundler/vendor/uri/lib/uri/common.rb +57 -15
- data/lib/bundler/vendor/uri/lib/uri/file.rb +1 -1
- data/lib/bundler/vendor/uri/lib/uri/generic.rb +34 -21
- data/lib/bundler/vendor/uri/lib/uri/http.rb +12 -0
- data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +9 -8
- data/lib/bundler/vendor/uri/lib/uri/version.rb +2 -2
- data/lib/bundler/version.rb +1 -1
- data/lib/bundler/vlad.rb +1 -14
- data/lib/bundler.rb +6 -28
- metadata +9 -13
- data/lib/bundler/cli/inject.rb +0 -60
- data/lib/bundler/cli/viz.rb +0 -31
- data/lib/bundler/graph.rb +0 -152
- data/lib/bundler/man/bundle-inject.1 +0 -31
- data/lib/bundler/man/bundle-inject.1.ronn +0 -32
- data/lib/bundler/man/bundle-viz.1 +0 -30
- data/lib/bundler/man/bundle-viz.1.ronn +0 -36
- data/lib/bundler/similarity_detector.rb +0 -63
|
@@ -43,16 +43,6 @@ module Bundler
|
|
|
43
43
|
private
|
|
44
44
|
|
|
45
45
|
def check_sources_consistency!(options)
|
|
46
|
-
if options.key?(:git) && options.key?(:local_git)
|
|
47
|
-
raise InvalidOption, "Remote and local plugin git sources can't be both specified"
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
# back-compat; local_git is an alias for git
|
|
51
|
-
if options.key?(:local_git)
|
|
52
|
-
Bundler::SharedHelpers.major_deprecation(2, "--local_git is deprecated, use --git")
|
|
53
|
-
options[:git] = options.delete(:local_git)
|
|
54
|
-
end
|
|
55
|
-
|
|
56
46
|
if (options.keys & [:source, :git, :path]).length > 1
|
|
57
47
|
raise InvalidOption, "Only one of --source, --git, or --path may be specified"
|
|
58
48
|
end
|
data/lib/bundler/plugin.rb
CHANGED
|
@@ -220,7 +220,7 @@ module Bundler
|
|
|
220
220
|
#
|
|
221
221
|
# @param [String] event
|
|
222
222
|
def hook(event, *args, &arg_blk)
|
|
223
|
-
return unless Bundler.
|
|
223
|
+
return unless Bundler.settings[:plugins]
|
|
224
224
|
unless Events.defined_event?(event)
|
|
225
225
|
raise ArgumentError, "Event '#{event}' not defined in Bundler::Plugin::Events"
|
|
226
226
|
end
|
|
@@ -21,6 +21,7 @@ module Bundler
|
|
|
21
21
|
@locked_version = locked_specs.version_for(name)
|
|
22
22
|
@unlock = unlock
|
|
23
23
|
@dependency = dependency || Dependency.new(name, @locked_version)
|
|
24
|
+
@platforms |= [Gem::Platform::RUBY] if @dependency.default_force_ruby_platform
|
|
24
25
|
@top_level = !dependency.nil?
|
|
25
26
|
@prerelease = @dependency.prerelease? || @locked_version&.prerelease? || prerelease ? :consider_first : :ignore
|
|
26
27
|
@prefer_local = prefer_local
|
data/lib/bundler/resolver.rb
CHANGED
|
@@ -165,7 +165,7 @@ module Bundler
|
|
|
165
165
|
PubGrub::VersionConstraint.new(package, range: range)
|
|
166
166
|
end
|
|
167
167
|
|
|
168
|
-
def versions_for(package, range=VersionRange.any)
|
|
168
|
+
def versions_for(package, range = VersionRange.any)
|
|
169
169
|
range.select_versions(@sorted_versions[package])
|
|
170
170
|
end
|
|
171
171
|
|
data/lib/bundler/ruby_dsl.rb
CHANGED
data/lib/bundler/ruby_version.rb
CHANGED
|
@@ -43,7 +43,6 @@ module Bundler
|
|
|
43
43
|
|
|
44
44
|
def to_s(versions = self.versions)
|
|
45
45
|
output = String.new("ruby #{versions_string(versions)}")
|
|
46
|
-
output << "p#{patchlevel}" if patchlevel && patchlevel != "-1"
|
|
47
46
|
output << " (#{engine} #{versions_string(engine_versions)})" unless engine == "ruby"
|
|
48
47
|
|
|
49
48
|
output
|
|
@@ -72,8 +71,7 @@ module Bundler
|
|
|
72
71
|
def ==(other)
|
|
73
72
|
versions == other.versions &&
|
|
74
73
|
engine == other.engine &&
|
|
75
|
-
engine_versions == other.engine_versions
|
|
76
|
-
patchlevel == other.patchlevel
|
|
74
|
+
engine_versions == other.engine_versions
|
|
77
75
|
end
|
|
78
76
|
|
|
79
77
|
def host
|
data/lib/bundler/rubygems_ext.rb
CHANGED
|
@@ -417,7 +417,7 @@ module Gem
|
|
|
417
417
|
unless Gem::NameTuple.new("a", Gem::Version.new("1"), Gem::Platform.new("x86_64-linux")).platform.is_a?(String)
|
|
418
418
|
alias_method :initialize_with_platform, :initialize
|
|
419
419
|
|
|
420
|
-
def initialize(name, version, platform=Gem::Platform::RUBY)
|
|
420
|
+
def initialize(name, version, platform = Gem::Platform::RUBY)
|
|
421
421
|
if Gem::Platform === platform
|
|
422
422
|
initialize_with_platform(name, version, platform.to_s)
|
|
423
423
|
else
|
|
@@ -69,7 +69,7 @@ module Bundler
|
|
|
69
69
|
end
|
|
70
70
|
|
|
71
71
|
def generate_plugins
|
|
72
|
-
return unless Gem::Installer.
|
|
72
|
+
return unless Gem::Installer.method_defined?(:generate_plugins, false)
|
|
73
73
|
|
|
74
74
|
latest = Gem::Specification.stubs_for(spec.name).first
|
|
75
75
|
return if latest && latest.version > spec.version
|
|
@@ -416,11 +416,7 @@ module Bundler
|
|
|
416
416
|
end
|
|
417
417
|
|
|
418
418
|
def all_specs
|
|
419
|
-
SharedHelpers.
|
|
420
|
-
|
|
421
|
-
Gem::Specification.stubs.map do |stub|
|
|
422
|
-
StubSpecification.from_stub(stub)
|
|
423
|
-
end
|
|
419
|
+
SharedHelpers.feature_removed! "Bundler.rubygems.all_specs has been removed in favor of Bundler.rubygems.installed_specs"
|
|
424
420
|
end
|
|
425
421
|
|
|
426
422
|
def installed_specs
|
data/lib/bundler/self_manager.rb
CHANGED
data/lib/bundler/settings.rb
CHANGED
|
@@ -7,7 +7,6 @@ module Bundler
|
|
|
7
7
|
autoload :Validator, File.expand_path("settings/validator", __dir__)
|
|
8
8
|
|
|
9
9
|
BOOL_KEYS = %w[
|
|
10
|
-
allow_offline_install
|
|
11
10
|
auto_install
|
|
12
11
|
cache_all
|
|
13
12
|
cache_all_platforms
|
|
@@ -20,7 +19,6 @@ module Bundler
|
|
|
20
19
|
disable_shared_gems
|
|
21
20
|
disable_version_check
|
|
22
21
|
force_ruby_platform
|
|
23
|
-
forget_cli_options
|
|
24
22
|
frozen
|
|
25
23
|
gem.changelog
|
|
26
24
|
gem.coc
|
|
@@ -43,20 +41,6 @@ module Bundler
|
|
|
43
41
|
verbose
|
|
44
42
|
].freeze
|
|
45
43
|
|
|
46
|
-
REMEMBERED_KEYS = %w[
|
|
47
|
-
bin
|
|
48
|
-
cache_all
|
|
49
|
-
clean
|
|
50
|
-
deployment
|
|
51
|
-
frozen
|
|
52
|
-
no_prune
|
|
53
|
-
path
|
|
54
|
-
shebang
|
|
55
|
-
path.system
|
|
56
|
-
without
|
|
57
|
-
with
|
|
58
|
-
].freeze
|
|
59
|
-
|
|
60
44
|
NUMBER_KEYS = %w[
|
|
61
45
|
jobs
|
|
62
46
|
redirect
|
|
@@ -97,6 +81,11 @@ module Bundler
|
|
|
97
81
|
"BUNDLE_RETRY" => 3,
|
|
98
82
|
"BUNDLE_TIMEOUT" => 10,
|
|
99
83
|
"BUNDLE_VERSION" => "lockfile",
|
|
84
|
+
"BUNDLE_LOCKFILE_CHECKSUMS" => true,
|
|
85
|
+
"BUNDLE_CACHE_ALL" => true,
|
|
86
|
+
"BUNDLE_PLUGINS" => true,
|
|
87
|
+
"BUNDLE_GLOBAL_GEM_CACHE" => false,
|
|
88
|
+
"BUNDLE_UPDATE_REQUIRES_ALL_FLAG" => false,
|
|
100
89
|
}.freeze
|
|
101
90
|
|
|
102
91
|
def initialize(root = nil)
|
|
@@ -128,12 +117,8 @@ module Bundler
|
|
|
128
117
|
end
|
|
129
118
|
|
|
130
119
|
def set_command_option(key, value)
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
value
|
|
134
|
-
else
|
|
135
|
-
set_local(key, value)
|
|
136
|
-
end
|
|
120
|
+
temporary(key => value)
|
|
121
|
+
value
|
|
137
122
|
end
|
|
138
123
|
|
|
139
124
|
def set_command_option_if_given(key, value)
|
|
@@ -272,7 +257,7 @@ module Bundler
|
|
|
272
257
|
def use_system_gems?
|
|
273
258
|
return true if system_path
|
|
274
259
|
return false if explicit_path
|
|
275
|
-
!Bundler.feature_flag.
|
|
260
|
+
!Bundler.feature_flag.bundler_5_mode?
|
|
276
261
|
end
|
|
277
262
|
|
|
278
263
|
def base_path
|
|
@@ -387,10 +372,6 @@ module Bundler
|
|
|
387
372
|
ARRAY_KEYS.include?(self.class.key_to_s(key))
|
|
388
373
|
end
|
|
389
374
|
|
|
390
|
-
def is_remembered(key)
|
|
391
|
-
REMEMBERED_KEYS.include?(self.class.key_to_s(key))
|
|
392
|
-
end
|
|
393
|
-
|
|
394
375
|
def is_credential(key)
|
|
395
376
|
key == "gem.push_key"
|
|
396
377
|
end
|
|
@@ -4,8 +4,6 @@ require_relative "version"
|
|
|
4
4
|
require_relative "rubygems_integration"
|
|
5
5
|
require_relative "current_ruby"
|
|
6
6
|
|
|
7
|
-
autoload :Pathname, "pathname"
|
|
8
|
-
|
|
9
7
|
module Bundler
|
|
10
8
|
autoload :WINDOWS, File.expand_path("constants", __dir__)
|
|
11
9
|
autoload :FREEBSD, File.expand_path("constants", __dir__)
|
|
@@ -57,7 +55,7 @@ module Bundler
|
|
|
57
55
|
|
|
58
56
|
def pwd
|
|
59
57
|
Bundler.rubygems.ext_lock.synchronize do
|
|
60
|
-
|
|
58
|
+
Dir.pwd
|
|
61
59
|
end
|
|
62
60
|
end
|
|
63
61
|
|
|
@@ -125,27 +123,17 @@ module Bundler
|
|
|
125
123
|
raise GenericSystemCallError.new(e, "There was an error #{[:create, :write].include?(action) ? "creating" : "accessing"} `#{path}`.")
|
|
126
124
|
end
|
|
127
125
|
|
|
128
|
-
def
|
|
129
|
-
|
|
130
|
-
caller_location = caller_locations(2, 2).first
|
|
131
|
-
suffix = " (called at #{caller_location.path}:#{caller_location.lineno})"
|
|
132
|
-
message += suffix
|
|
133
|
-
removed_message += suffix if removed_message
|
|
134
|
-
end
|
|
135
|
-
|
|
136
|
-
require_relative "../bundler"
|
|
137
|
-
|
|
138
|
-
feature_flag = Bundler.feature_flag
|
|
126
|
+
def feature_deprecated!(message)
|
|
127
|
+
return unless prints_major_deprecations?
|
|
139
128
|
|
|
140
|
-
if feature_flag.removed_major?(major_version)
|
|
141
|
-
require_relative "errors"
|
|
142
|
-
raise DeprecatedError, "[REMOVED] #{removed_message || message}"
|
|
143
|
-
end
|
|
144
|
-
|
|
145
|
-
return unless feature_flag.deprecated_major?(major_version) && prints_major_deprecations?
|
|
146
129
|
Bundler.ui.warn("[DEPRECATED] #{message}")
|
|
147
130
|
end
|
|
148
131
|
|
|
132
|
+
def feature_removed!(message)
|
|
133
|
+
require_relative "errors"
|
|
134
|
+
raise RemovedError, "[REMOVED] #{message}"
|
|
135
|
+
end
|
|
136
|
+
|
|
149
137
|
def print_major_deprecations!
|
|
150
138
|
multiple_gemfiles = search_up(".") do |dir|
|
|
151
139
|
gemfiles = gemfile_names.select {|gf| File.file? File.expand_path(gf, dir) }
|
|
@@ -16,7 +16,7 @@ module Bundler
|
|
|
16
16
|
def initialize(command)
|
|
17
17
|
msg = String.new
|
|
18
18
|
msg << "Bundler is trying to run `#{command}` at runtime. You probably need to run `bundle install`. However, "
|
|
19
|
-
msg << "this error message could probably be more useful. Please submit a ticket at https://github.com/
|
|
19
|
+
msg << "this error message could probably be more useful. Please submit a ticket at https://github.com/ruby/rubygems/issues/new?labels=Bundler&template=bundler-related-issue.md "
|
|
20
20
|
msg << "with steps to reproduce as well as the following\n\nCALLER: #{caller.join("\n")}"
|
|
21
21
|
super msg
|
|
22
22
|
end
|
|
@@ -121,7 +121,7 @@ module Bundler
|
|
|
121
121
|
FileUtils.rm_rf(p)
|
|
122
122
|
end
|
|
123
123
|
git "clone", "--no-checkout", "--quiet", path.to_s, destination.to_s
|
|
124
|
-
File.chmod((
|
|
124
|
+
File.chmod((File.stat(destination).mode | 0o777) & ~File.umask, destination)
|
|
125
125
|
rescue Errno::EEXIST => e
|
|
126
126
|
file_path = e.message[%r{.*?((?:[a-zA-Z]:)?/.*)}, 1]
|
|
127
127
|
raise GitError, "Bundler could not install a gem because it needs to " \
|
|
@@ -408,11 +408,7 @@ module Bundler
|
|
|
408
408
|
def capture3_args_for(cmd, dir)
|
|
409
409
|
return ["git", *cmd] unless dir
|
|
410
410
|
|
|
411
|
-
|
|
412
|
-
["git", "-C", dir.to_s, *cmd]
|
|
413
|
-
else
|
|
414
|
-
["git", *cmd, { chdir: dir.to_s }]
|
|
415
|
-
end
|
|
411
|
+
["git", "-C", dir.to_s, *cmd]
|
|
416
412
|
end
|
|
417
413
|
|
|
418
414
|
def extra_clone_args
|
|
@@ -451,10 +447,6 @@ module Bundler
|
|
|
451
447
|
depth.nil?
|
|
452
448
|
end
|
|
453
449
|
|
|
454
|
-
def supports_minus_c?
|
|
455
|
-
@supports_minus_c ||= Gem::Version.new(version) >= Gem::Version.new("1.8.5")
|
|
456
|
-
end
|
|
457
|
-
|
|
458
450
|
def needs_allow_any_sha1_in_want?
|
|
459
451
|
@needs_allow_any_sha1_in_want ||= Gem::Version.new(version) <= Gem::Version.new("2.13.7")
|
|
460
452
|
end
|
data/lib/bundler/source/git.rb
CHANGED
|
@@ -238,7 +238,7 @@ module Bundler
|
|
|
238
238
|
# across different projects, this cache will be shared.
|
|
239
239
|
# When using local git repos, this is set to the local repo.
|
|
240
240
|
def cache_path
|
|
241
|
-
@cache_path ||= if Bundler.
|
|
241
|
+
@cache_path ||= if Bundler.settings[:global_gem_cache]
|
|
242
242
|
Bundler.user_cache
|
|
243
243
|
else
|
|
244
244
|
Bundler.bundle_path.join("cache", "bundler")
|
|
@@ -268,7 +268,7 @@ module Bundler
|
|
|
268
268
|
private
|
|
269
269
|
|
|
270
270
|
def cache_to(custom_path, try_migrate: false)
|
|
271
|
-
return unless Bundler.
|
|
271
|
+
return unless Bundler.settings[:cache_all]
|
|
272
272
|
|
|
273
273
|
app_cache_path = app_cache_path(custom_path)
|
|
274
274
|
|
|
@@ -416,7 +416,6 @@ module Bundler
|
|
|
416
416
|
def fetch
|
|
417
417
|
git_proxy.checkout
|
|
418
418
|
rescue GitError => e
|
|
419
|
-
raise unless Bundler.feature_flag.allow_offline_install?
|
|
420
419
|
Bundler.ui.warn "Using cached git data because of network errors:\n#{e}"
|
|
421
420
|
end
|
|
422
421
|
|
data/lib/bundler/source/path.rb
CHANGED
|
@@ -24,7 +24,7 @@ module Bundler
|
|
|
24
24
|
@path = Pathname.new(options["path"])
|
|
25
25
|
expanded_path = expand(@path)
|
|
26
26
|
@path = if @path.relative?
|
|
27
|
-
expanded_path.relative_path_from(
|
|
27
|
+
expanded_path.relative_path_from(File.expand_path(root_path))
|
|
28
28
|
else
|
|
29
29
|
expanded_path
|
|
30
30
|
end
|
|
@@ -53,6 +53,8 @@ module Bundler
|
|
|
53
53
|
"source at `#{@path}`"
|
|
54
54
|
end
|
|
55
55
|
|
|
56
|
+
alias_method :identifier, :to_s
|
|
57
|
+
|
|
56
58
|
alias_method :to_gemfile, :path
|
|
57
59
|
|
|
58
60
|
def hash
|
|
@@ -81,7 +83,7 @@ module Bundler
|
|
|
81
83
|
|
|
82
84
|
def cache(spec, custom_path = nil)
|
|
83
85
|
app_cache_path = app_cache_path(custom_path)
|
|
84
|
-
return unless Bundler.
|
|
86
|
+
return unless Bundler.settings[:cache_all]
|
|
85
87
|
return if expand(@original_path).to_s.index(root_path.to_s + "/") == 0
|
|
86
88
|
|
|
87
89
|
unless @original_path.exist?
|
|
@@ -124,11 +126,7 @@ module Bundler
|
|
|
124
126
|
end
|
|
125
127
|
|
|
126
128
|
def expand(somepath)
|
|
127
|
-
|
|
128
|
-
somepath.expand_path(root_path).expand_path
|
|
129
|
-
else
|
|
130
|
-
somepath.expand_path(root_path)
|
|
131
|
-
end
|
|
129
|
+
somepath.expand_path(root_path)
|
|
132
130
|
rescue ArgumentError => e
|
|
133
131
|
Bundler.ui.debug(e)
|
|
134
132
|
raise PathError, "There was an error while trying to use the path " \
|
|
@@ -8,7 +8,7 @@ module Bundler
|
|
|
8
8
|
autoload :Remote, File.expand_path("rubygems/remote", __dir__)
|
|
9
9
|
|
|
10
10
|
# Ask for X gems per API request
|
|
11
|
-
API_REQUEST_SIZE =
|
|
11
|
+
API_REQUEST_SIZE = 100
|
|
12
12
|
|
|
13
13
|
attr_accessor :remotes
|
|
14
14
|
|
|
@@ -168,12 +168,6 @@ module Bundler
|
|
|
168
168
|
return nil # no post-install message
|
|
169
169
|
end
|
|
170
170
|
|
|
171
|
-
if spec.remote
|
|
172
|
-
# Check for this spec from other sources
|
|
173
|
-
uris = [spec.remote, *remotes_for_spec(spec)].map(&:anonymized_uri).uniq
|
|
174
|
-
Installer.ambiguous_gems << [spec.name, *uris] if uris.length > 1
|
|
175
|
-
end
|
|
176
|
-
|
|
177
171
|
path = fetch_gem_if_possible(spec, options[:previous_spec])
|
|
178
172
|
raise GemNotFound, "Could not find #{spec.file_name} for installation" unless path
|
|
179
173
|
|
|
@@ -217,7 +211,11 @@ module Bundler
|
|
|
217
211
|
message += " with native extensions" if spec.extensions.any?
|
|
218
212
|
Bundler.ui.confirm message
|
|
219
213
|
|
|
220
|
-
installed_spec =
|
|
214
|
+
installed_spec = nil
|
|
215
|
+
|
|
216
|
+
Gem.time("Installed #{spec.name} in", 0, true) do
|
|
217
|
+
installed_spec = installer.install
|
|
218
|
+
end
|
|
221
219
|
|
|
222
220
|
spec.full_gem_path = installed_spec.full_gem_path
|
|
223
221
|
spec.loaded_from = installed_spec.loaded_from
|
|
@@ -332,13 +330,6 @@ module Bundler
|
|
|
332
330
|
remotes.map(&method(:remove_auth))
|
|
333
331
|
end
|
|
334
332
|
|
|
335
|
-
def remotes_for_spec(spec)
|
|
336
|
-
specs.search_all(spec.name).inject([]) do |uris, s|
|
|
337
|
-
uris << s.remote if s.remote
|
|
338
|
-
uris
|
|
339
|
-
end
|
|
340
|
-
end
|
|
341
|
-
|
|
342
333
|
def cached_gem(spec)
|
|
343
334
|
global_cache_path = download_cache_path(spec)
|
|
344
335
|
caches << global_cache_path if global_cache_path
|
|
@@ -491,7 +482,10 @@ module Bundler
|
|
|
491
482
|
uri = spec.remote.uri
|
|
492
483
|
Bundler.ui.confirm("Fetching #{version_message(spec, previous_spec)}")
|
|
493
484
|
gem_remote_fetcher = remote_fetchers.fetch(spec.remote).gem_remote_fetcher
|
|
494
|
-
|
|
485
|
+
|
|
486
|
+
Gem.time("Downloaded #{spec.name} in", 0, true) do
|
|
487
|
+
Bundler.rubygems.download_gem(spec, uri, download_cache_path, gem_remote_fetcher)
|
|
488
|
+
end
|
|
495
489
|
end
|
|
496
490
|
|
|
497
491
|
# Returns the global cache path of the calling Rubygems::Source object.
|
|
@@ -506,7 +500,7 @@ module Bundler
|
|
|
506
500
|
# @return [Pathname] The global cache path.
|
|
507
501
|
#
|
|
508
502
|
def download_cache_path(spec)
|
|
509
|
-
return unless Bundler.
|
|
503
|
+
return unless Bundler.settings[:global_gem_cache]
|
|
510
504
|
return unless remote = spec.remote
|
|
511
505
|
return unless cache_slug = remote.cache_slug
|
|
512
506
|
|
data/lib/bundler/source.rb
CHANGED
|
@@ -79,7 +79,7 @@ module Bundler
|
|
|
79
79
|
end
|
|
80
80
|
|
|
81
81
|
def extension_cache_path(spec)
|
|
82
|
-
return unless Bundler.
|
|
82
|
+
return unless Bundler.settings[:global_gem_cache]
|
|
83
83
|
return unless source_slug = extension_cache_slug(spec)
|
|
84
84
|
Bundler.user_cache.join(
|
|
85
85
|
"extensions", Gem::Platform.local.to_s, Bundler.ruby_scope,
|
data/lib/bundler/source_list.rb
CHANGED
|
@@ -9,7 +9,7 @@ module Bundler
|
|
|
9
9
|
:metadata_source
|
|
10
10
|
|
|
11
11
|
def global_rubygems_source
|
|
12
|
-
@global_rubygems_source ||=
|
|
12
|
+
@global_rubygems_source ||= source_class.new("allow_local" => true)
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
def initialize
|
|
@@ -21,19 +21,9 @@ module Bundler
|
|
|
21
21
|
@rubygems_sources = []
|
|
22
22
|
@metadata_source = Source::Metadata.new
|
|
23
23
|
|
|
24
|
-
@merged_gem_lockfile_sections = false
|
|
25
24
|
@local_mode = true
|
|
26
25
|
end
|
|
27
26
|
|
|
28
|
-
def merged_gem_lockfile_sections?
|
|
29
|
-
@merged_gem_lockfile_sections
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
def merged_gem_lockfile_sections!(replacement_source)
|
|
33
|
-
@merged_gem_lockfile_sections = true
|
|
34
|
-
@global_rubygems_source = replacement_source
|
|
35
|
-
end
|
|
36
|
-
|
|
37
27
|
def aggregate_global_source?
|
|
38
28
|
global_rubygems_source.multiple_remotes?
|
|
39
29
|
end
|
|
@@ -90,10 +80,6 @@ module Bundler
|
|
|
90
80
|
@rubygems_sources
|
|
91
81
|
end
|
|
92
82
|
|
|
93
|
-
def rubygems_remotes
|
|
94
|
-
rubygems_sources.flat_map(&:remotes).uniq
|
|
95
|
-
end
|
|
96
|
-
|
|
97
83
|
def all_sources
|
|
98
84
|
path_sources + git_sources + plugin_sources + rubygems_sources + [metadata_source]
|
|
99
85
|
end
|
|
@@ -115,11 +101,7 @@ module Bundler
|
|
|
115
101
|
end
|
|
116
102
|
|
|
117
103
|
def lock_rubygems_sources
|
|
118
|
-
|
|
119
|
-
[combine_rubygems_sources]
|
|
120
|
-
else
|
|
121
|
-
rubygems_sources.sort_by(&:identifier)
|
|
122
|
-
end
|
|
104
|
+
rubygems_sources.sort_by(&:identifier)
|
|
123
105
|
end
|
|
124
106
|
|
|
125
107
|
# Returns true if there are changes
|
|
@@ -129,16 +111,7 @@ module Bundler
|
|
|
129
111
|
@rubygems_sources, @path_sources, @git_sources, @plugin_sources = map_sources(replacement_sources)
|
|
130
112
|
@global_rubygems_source = global_replacement_source(replacement_sources)
|
|
131
113
|
|
|
132
|
-
|
|
133
|
-
end
|
|
134
|
-
|
|
135
|
-
# Returns true if there are changes
|
|
136
|
-
def expired_sources?(replacement_sources)
|
|
137
|
-
return false if replacement_sources.empty?
|
|
138
|
-
|
|
139
|
-
lock_sources = dup_with_replaced_sources(replacement_sources).lock_sources
|
|
140
|
-
|
|
141
|
-
different_sources?(lock_sources, replacement_sources)
|
|
114
|
+
!equivalent_sources?(lock_sources, replacement_sources)
|
|
142
115
|
end
|
|
143
116
|
|
|
144
117
|
def prefer_local!
|
|
@@ -165,12 +138,6 @@ module Bundler
|
|
|
165
138
|
|
|
166
139
|
private
|
|
167
140
|
|
|
168
|
-
def dup_with_replaced_sources(replacement_sources)
|
|
169
|
-
new_source_list = dup
|
|
170
|
-
new_source_list.replace_sources!(replacement_sources)
|
|
171
|
-
new_source_list
|
|
172
|
-
end
|
|
173
|
-
|
|
174
141
|
def map_sources(replacement_sources)
|
|
175
142
|
rubygems = @rubygems_sources.map do |source|
|
|
176
143
|
replace_rubygems_source(replacement_sources, source)
|
|
@@ -224,11 +191,7 @@ module Bundler
|
|
|
224
191
|
end
|
|
225
192
|
end
|
|
226
193
|
|
|
227
|
-
def
|
|
228
|
-
!equivalent_sources?(lock_sources, replacement_sources)
|
|
229
|
-
end
|
|
230
|
-
|
|
231
|
-
def rubygems_aggregate_class
|
|
194
|
+
def source_class
|
|
232
195
|
Source::Rubygems
|
|
233
196
|
end
|
|
234
197
|
|
|
@@ -247,10 +210,6 @@ module Bundler
|
|
|
247
210
|
end
|
|
248
211
|
end
|
|
249
212
|
|
|
250
|
-
def combine_rubygems_sources
|
|
251
|
-
Source::Rubygems.new("remotes" => rubygems_remotes)
|
|
252
|
-
end
|
|
253
|
-
|
|
254
213
|
def warn_on_git_protocol(source)
|
|
255
214
|
return if Bundler.settings["git.allow_insecure"]
|
|
256
215
|
|
data/lib/bundler/source_map.rb
CHANGED
|
@@ -23,15 +23,12 @@ module Bundler
|
|
|
23
23
|
if previous_source.nil?
|
|
24
24
|
requirements[indirect_dependency_name] = source
|
|
25
25
|
else
|
|
26
|
-
no_ambiguous_sources = Bundler.feature_flag.bundler_4_mode?
|
|
27
|
-
|
|
28
26
|
msg = ["The gem '#{indirect_dependency_name}' was found in multiple relevant sources."]
|
|
29
27
|
msg.concat [previous_source, source].map {|s| " * #{s}" }.sort
|
|
30
|
-
msg << "You
|
|
28
|
+
msg << "You must add this gem to the source block for the source you wish it to be installed from."
|
|
31
29
|
msg = msg.join("\n")
|
|
32
30
|
|
|
33
|
-
raise SecurityError, msg
|
|
34
|
-
Bundler.ui.warn "Warning: #{msg}"
|
|
31
|
+
raise SecurityError, msg
|
|
35
32
|
end
|
|
36
33
|
end
|
|
37
34
|
|
data/lib/bundler/spec_set.rb
CHANGED
|
@@ -11,16 +11,11 @@ module Bundler
|
|
|
11
11
|
@specs = specs
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
-
def for(dependencies,
|
|
15
|
-
|
|
16
|
-
Bundler::SharedHelpers.
|
|
14
|
+
def for(dependencies, platforms = [nil], legacy_platforms = [nil], skips: [])
|
|
15
|
+
if [true, false].include?(platforms)
|
|
16
|
+
Bundler::SharedHelpers.feature_removed! \
|
|
17
17
|
"SpecSet#for received a `check` parameter, but that's no longer used and deprecated. " \
|
|
18
|
-
"SpecSet#for always implicitly performs validation. Please remove this parameter"
|
|
19
|
-
print_caller_location: true
|
|
20
|
-
|
|
21
|
-
legacy_platforms
|
|
22
|
-
else
|
|
23
|
-
platforms_or_legacy_check
|
|
18
|
+
"SpecSet#for always implicitly performs validation. Please remove this parameter"
|
|
24
19
|
end
|
|
25
20
|
|
|
26
21
|
materialize_dependencies(dependencies, platforms, skips: skips)
|
|
@@ -179,9 +174,7 @@ module Bundler
|
|
|
179
174
|
end
|
|
180
175
|
|
|
181
176
|
def -(other)
|
|
182
|
-
SharedHelpers.
|
|
183
|
-
|
|
184
|
-
SpecSet.new(to_a - other.to_a)
|
|
177
|
+
SharedHelpers.feature_removed! "SpecSet#- has been removed with no replacement"
|
|
185
178
|
end
|
|
186
179
|
|
|
187
180
|
def find_by_name_and_platform(name, platform)
|
|
@@ -212,9 +205,7 @@ module Bundler
|
|
|
212
205
|
end
|
|
213
206
|
|
|
214
207
|
def <<(spec)
|
|
215
|
-
SharedHelpers.
|
|
216
|
-
|
|
217
|
-
@specs << spec
|
|
208
|
+
SharedHelpers.feature_removed! "SpecSet#<< has been removed with no replacement"
|
|
218
209
|
end
|
|
219
210
|
|
|
220
211
|
def length
|