rubygems-update 4.0.18 → 4.0.20
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 +31 -0
- data/bundler/CHANGELOG.md +42 -0
- data/bundler/lib/bundler/build_metadata.rb +2 -2
- data/bundler/lib/bundler/cli/common.rb +11 -0
- data/bundler/lib/bundler/cli/doctor/diagnose.rb +1 -1
- data/bundler/lib/bundler/cli/exec.rb +15 -1
- data/bundler/lib/bundler/cli/init.rb +4 -0
- data/bundler/lib/bundler/cli/install.rb +1 -0
- data/bundler/lib/bundler/cli/lock.rb +7 -2
- data/bundler/lib/bundler/cli/outdated.rb +37 -7
- data/bundler/lib/bundler/cli/update.rb +1 -0
- data/bundler/lib/bundler/cli.rb +3 -3
- data/bundler/lib/bundler/definition.rb +13 -3
- data/bundler/lib/bundler/dsl.rb +1 -1
- data/bundler/lib/bundler/endpoint_specification.rb +13 -0
- data/bundler/lib/bundler/gem_helper.rb +2 -2
- data/bundler/lib/bundler/installer.rb +6 -0
- data/bundler/lib/bundler/lockfile_generator.rb +16 -0
- data/bundler/lib/bundler/man/bundle-config.1 +2 -2
- data/bundler/lib/bundler/man/bundle-config.1.ronn +5 -5
- data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
- data/bundler/lib/bundler/man/bundle-outdated.1.ronn +7 -1
- data/bundler/lib/bundler/man/bundle-platform.1 +4 -0
- data/bundler/lib/bundler/man/bundle-platform.1.ronn +4 -0
- data/bundler/lib/bundler/man/gemfile.5 +1 -1
- data/bundler/lib/bundler/man/gemfile.5.ronn +3 -1
- data/bundler/lib/bundler/resolver.rb +54 -1
- data/bundler/lib/bundler/runtime.rb +11 -11
- data/bundler/lib/bundler/shared_helpers.rb +15 -0
- data/bundler/lib/bundler/source/git/git_proxy.rb +70 -8
- data/bundler/lib/bundler/source/git.rb +4 -4
- data/bundler/lib/bundler/source/path.rb +1 -1
- data/bundler/lib/bundler/source/rubygems.rb +1 -1
- data/bundler/lib/bundler/stub_specification.rb +3 -1
- data/bundler/lib/bundler/version.rb +1 -1
- data/bundler/lib/bundler.rb +15 -5
- data/lib/rubygems/command.rb +1 -1
- data/lib/rubygems/commands/contents_command.rb +14 -6
- data/lib/rubygems/commands/exec_command.rb +1 -1
- data/lib/rubygems/commands/setup_command.rb +11 -38
- data/lib/rubygems/commands/stale_command.rb +1 -1
- data/lib/rubygems/config_file.rb +21 -10
- data/lib/rubygems/ext/builder.rb +3 -1
- data/lib/rubygems/installer.rb +1 -1
- data/lib/rubygems/safe_marshal/reader.rb +20 -9
- data/lib/rubygems/safe_marshal/visitors/to_ruby.rb +8 -1
- data/lib/rubygems/security/signer.rb +1 -3
- data/lib/rubygems/specification.rb +27 -15
- data/lib/rubygems/uninstaller.rb +2 -1
- data/lib/rubygems/update_suggestion.rb +6 -2
- data/lib/rubygems/util.rb +29 -5
- data/lib/rubygems.rb +6 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1c5b9e451752787719ea243e41b423937313b296fe80fcdb9e2278c47bce0311
|
|
4
|
+
data.tar.gz: 40407c5dda968a596b10a34cfe59e6884ed03a2224c43934aaf1b2dc86c7d0f3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a98a6944def23e28a4f45a8be9d1d7fa36b488cf1add3e542ffae3ca9ace3adfde5499ddd36a0e1a15ad0baf363ab05509d4bcfd7d714d4209c6fcba1dc2a6b2
|
|
7
|
+
data.tar.gz: 5f399d26a853785b4ead62f67c12f84f7225af52cb700fb39fd50e8895e481d91c667b51d9b2c8df925f3c46477044d9704039c86a67bcdaeaff80c529f97f64
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 4.0.20 / 2026-09-02
|
|
4
|
+
|
|
5
|
+
### Enhancements:
|
|
6
|
+
|
|
7
|
+
* Print a release notes link instead of the whole changelog on `gem update --system`. Pull request [#9794](https://github.com/ruby/rubygems/pull/9794) by hsbt
|
|
8
|
+
* Installs bundler 4.0.20 as a default gem.
|
|
9
|
+
|
|
10
|
+
### Bug fixes:
|
|
11
|
+
|
|
12
|
+
* Only coerce exact true and false gemrc values to booleans. Pull request [#9822](https://github.com/ruby/rubygems/pull/9822) by hsbt
|
|
13
|
+
* Make the gem CLI work under RUBY_BOX=1. Pull request [#9810](https://github.com/ruby/rubygems/pull/9810) by hsbt
|
|
14
|
+
|
|
15
|
+
### Documentation:
|
|
16
|
+
|
|
17
|
+
* Document and test all available gemrc configuration keys. Pull request [#9568](https://github.com/ruby/rubygems/pull/9568) by junaruga
|
|
18
|
+
|
|
19
|
+
## 4.0.19 / 2026-08-20
|
|
20
|
+
|
|
21
|
+
### Enhancements:
|
|
22
|
+
|
|
23
|
+
* Reject SafeMarshal collection lengths longer than the remaining input. Pull request [#9756](https://github.com/ruby/rubygems/pull/9756) by hsbt
|
|
24
|
+
* Installs bundler 4.0.19 as a default gem.
|
|
25
|
+
|
|
26
|
+
### Bug fixes:
|
|
27
|
+
|
|
28
|
+
* Fix gem uninstall --user-install crash when GEM_HOME does not exist. Pull request [#9749](https://github.com/ruby/rubygems/pull/9749) by hsbt
|
|
29
|
+
|
|
30
|
+
### Documentation:
|
|
31
|
+
|
|
32
|
+
* Document SPDX license handling for license= and licenses=. Pull request [#9766](https://github.com/ruby/rubygems/pull/9766) by hsbt
|
|
33
|
+
|
|
3
34
|
## 4.0.18 / 2026-08-05
|
|
4
35
|
|
|
5
36
|
### Enhancements:
|
data/bundler/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,47 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 4.0.20 / 2026-09-02
|
|
4
|
+
|
|
5
|
+
### Enhancements:
|
|
6
|
+
|
|
7
|
+
* Avoid duplicate relative path prefix in bundle exec. Pull request [#9596](https://github.com/ruby/rubygems/pull/9596) by samuel-williams-shopify
|
|
8
|
+
* Follow renamed default branch in git sources. Pull request [#9813](https://github.com/ruby/rubygems/pull/9813) by hsbt
|
|
9
|
+
* Bundler::Source::Git: avoid re-fetching the repo. Pull request [#9806](https://github.com/ruby/rubygems/pull/9806) by byroot
|
|
10
|
+
* Show the newest out-of-cooldown version in bundle outdated. Pull request [#9803](https://github.com/ruby/rubygems/pull/9803) by hsbt
|
|
11
|
+
|
|
12
|
+
### Bug fixes:
|
|
13
|
+
|
|
14
|
+
* Error out when `bundle init --gemspec` gets no specification. Pull request [#9818](https://github.com/ruby/rubygems/pull/9818) by hsbt
|
|
15
|
+
* Fix relative gemspec paths being expanded twice. Pull request [#9814](https://github.com/ruby/rubygems/pull/9814) by hsbt
|
|
16
|
+
* Fix gemspec evaluation under Ruby::Box. Pull request [#9809](https://github.com/ruby/rubygems/pull/9809) by hsbt
|
|
17
|
+
* Fix release date extraction for the current changelog header format. Pull request [#9767](https://github.com/ruby/rubygems/pull/9767) by meganemura
|
|
18
|
+
* Resolve globbed entries literally in Gem::Util.glob_files_in_dir. Pull request [#9802](https://github.com/ruby/rubygems/pull/9802) by hsbt
|
|
19
|
+
* Preserve native extensions during implicit clean. Pull request [#9800](https://github.com/ruby/rubygems/pull/9800) by sjh9714
|
|
20
|
+
|
|
21
|
+
### Documentation:
|
|
22
|
+
|
|
23
|
+
* Clarify :path expectations and cross-link platform docs in man pages. Pull request [#9724](https://github.com/ruby/rubygems/pull/9724) by hsbt
|
|
24
|
+
|
|
25
|
+
## 4.0.19 / 2026-08-20
|
|
26
|
+
|
|
27
|
+
### Enhancements:
|
|
28
|
+
|
|
29
|
+
* Validate the platform field in Gem::Installer#verify_spec. Pull request [#9780](https://github.com/ruby/rubygems/pull/9780) by hsbt
|
|
30
|
+
* Restrict UserDefined handling to explicit class set for Gem::SafeMashal. Pull request [#9770](https://github.com/ruby/rubygems/pull/9770) by jackorp
|
|
31
|
+
* Filter git command output against the configured URI. Pull request [#9778](https://github.com/ruby/rubygems/pull/9778) by hsbt
|
|
32
|
+
* Summarize cooldown-skipped versions at the end of install, update, and lock. Pull request [#9762](https://github.com/ruby/rubygems/pull/9762) by hsbt
|
|
33
|
+
|
|
34
|
+
### Bug fixes:
|
|
35
|
+
|
|
36
|
+
* Make repeated bundle lock options accumulate. Pull request [#9748](https://github.com/ruby/rubygems/pull/9748) by hsbt
|
|
37
|
+
* Fail instead of warning when frozen mode can't update the lockfile. Pull request [#9750](https://github.com/ruby/rubygems/pull/9750) by hsbt
|
|
38
|
+
* Fix wrong $LOAD_PATH for gems installed in the same process. Pull request [#9784](https://github.com/ruby/rubygems/pull/9784) by hsbt
|
|
39
|
+
|
|
40
|
+
### Documentation:
|
|
41
|
+
|
|
42
|
+
* Fix auto-clean default version in bundle config docs. Pull request [#9783](https://github.com/ruby/rubygems/pull/9783) by hsbt
|
|
43
|
+
* Correct Bundler 5 default path documentation. Pull request [#9771](https://github.com/ruby/rubygems/pull/9771) by alloutflo
|
|
44
|
+
|
|
3
45
|
## 4.0.18 / 2026-08-05
|
|
4
46
|
|
|
5
47
|
### Enhancements:
|
|
@@ -4,8 +4,8 @@ module Bundler
|
|
|
4
4
|
# Represents metadata from when the Bundler gem was built.
|
|
5
5
|
module BuildMetadata
|
|
6
6
|
# begin ivars
|
|
7
|
-
@built_at =
|
|
8
|
-
@git_commit_sha = "
|
|
7
|
+
@built_at = "2026-09-02".freeze
|
|
8
|
+
@git_commit_sha = "7f2502dc32b".freeze
|
|
9
9
|
# end ivars
|
|
10
10
|
|
|
11
11
|
# A hash representation of the build metadata.
|
|
@@ -20,6 +20,17 @@ module Bundler
|
|
|
20
20
|
Bundler.ui.info msg
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
+
def self.output_cooldown_skipped_summary(definition = Bundler.definition)
|
|
24
|
+
skipped = definition.cooldown_skipped
|
|
25
|
+
return if skipped.empty?
|
|
26
|
+
|
|
27
|
+
Bundler.ui.info "The following gem versions were skipped by the cooldown setting:"
|
|
28
|
+
skipped.each do |entry|
|
|
29
|
+
days = entry[:available_in_days]
|
|
30
|
+
Bundler.ui.info " * #{entry[:name]} #{entry[:version]} (available in #{days} #{days == 1 ? "day" : "days"}), resolved #{entry[:resolved]} instead"
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
23
34
|
def self.output_fund_metadata_summary
|
|
24
35
|
return if Bundler.settings["ignore_funding_requests"]
|
|
25
36
|
definition = Bundler.definition
|
|
@@ -23,7 +23,7 @@ module Bundler
|
|
|
23
23
|
bin_path.delete_suffix!(".bat") if Gem.win_platform?
|
|
24
24
|
kernel_load(bin_path, *args)
|
|
25
25
|
else
|
|
26
|
-
bin_path =
|
|
26
|
+
bin_path = explicit_path(bin_path)
|
|
27
27
|
kernel_exec(bin_path, *args)
|
|
28
28
|
end
|
|
29
29
|
else
|
|
@@ -71,6 +71,20 @@ module Bundler
|
|
|
71
71
|
"#{file} #{args.join(" ")}".strip
|
|
72
72
|
end
|
|
73
73
|
|
|
74
|
+
def explicit_path(path)
|
|
75
|
+
if File.absolute_path?(path) || explicit_relative_path?(path)
|
|
76
|
+
path
|
|
77
|
+
else
|
|
78
|
+
".#{File::SEPARATOR}#{path}"
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
def explicit_relative_path?(path)
|
|
83
|
+
[File::SEPARATOR, File::ALT_SEPARATOR].compact.any? do |separator|
|
|
84
|
+
path.start_with?(".#{separator}", "..#{separator}")
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
|
|
74
88
|
def directly_loadable?(file)
|
|
75
89
|
if Gem.win_platform?
|
|
76
90
|
script_wrapper?(file)
|
|
@@ -26,6 +26,10 @@ module Bundler
|
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
spec = Bundler.load_gemspec_uncached(gemspec)
|
|
29
|
+
unless spec
|
|
30
|
+
Bundler.ui.error "Gem specification #{gemspec} did not produce a specification"
|
|
31
|
+
exit 1
|
|
32
|
+
end
|
|
29
33
|
|
|
30
34
|
File.open(gemfile, "wb") do |file|
|
|
31
35
|
file << "# Generated from #{gemspec}\n"
|
|
@@ -26,6 +26,9 @@ module Bundler
|
|
|
26
26
|
Bundler::Fetcher.disable_endpoint = options["full-index"]
|
|
27
27
|
|
|
28
28
|
update = options[:update]
|
|
29
|
+
# --update is repeatable, so it parses as an array with one entry per
|
|
30
|
+
# occurrence, where a bare `--update` produces a `true` entry
|
|
31
|
+
update = update.include?(true) ? true : update.flatten if update.is_a?(Array)
|
|
29
32
|
conservative = options[:conservative]
|
|
30
33
|
bundler = options[:bundler]
|
|
31
34
|
|
|
@@ -44,12 +47,12 @@ module Bundler
|
|
|
44
47
|
|
|
45
48
|
Bundler::CLI::Common.configure_gem_version_promoter(definition, options) if options[:update]
|
|
46
49
|
|
|
47
|
-
options["remove-platform"].each do |platform_string|
|
|
50
|
+
options["remove-platform"].flatten.each do |platform_string|
|
|
48
51
|
platform = Gem::Platform.new(platform_string)
|
|
49
52
|
definition.remove_platform(platform)
|
|
50
53
|
end
|
|
51
54
|
|
|
52
|
-
options["add-platform"].each do |platform_string|
|
|
55
|
+
options["add-platform"].flatten.each do |platform_string|
|
|
53
56
|
platform = Gem::Platform.new(platform_string)
|
|
54
57
|
if platform.to_s == "unknown"
|
|
55
58
|
Bundler.ui.error "The platform `#{platform_string}` is unknown to RubyGems and can't be added to the lockfile."
|
|
@@ -77,6 +80,8 @@ module Bundler
|
|
|
77
80
|
puts "Writing lockfile to #{file}"
|
|
78
81
|
definition.write_lock(file, false)
|
|
79
82
|
end
|
|
83
|
+
|
|
84
|
+
Bundler::CLI::Common.output_cooldown_skipped_summary(definition)
|
|
80
85
|
end
|
|
81
86
|
|
|
82
87
|
Bundler.ui.output_stream = previous_output_stream
|
|
@@ -158,11 +158,29 @@ module Bundler
|
|
|
158
158
|
|
|
159
159
|
return active_spec if strict
|
|
160
160
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
161
|
+
matching_specs(active_spec, current_spec).last
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
def matching_specs(active_spec, current_spec)
|
|
165
|
+
@matching_specs ||= {}
|
|
166
|
+
@matching_specs[[active_spec.source, current_spec.name, current_spec.platform]] ||= begin
|
|
167
|
+
active_specs = active_spec.source.specs.search(current_spec.name).select {|spec| spec.installable_on_platform?(current_spec.platform) }.sort_by(&:version)
|
|
168
|
+
if !current_spec.version.prerelease? && !options[:pre] && active_specs.size > 1
|
|
169
|
+
active_specs.delete_if {|b| b.respond_to?(:version) && b.version.prerelease? }
|
|
170
|
+
end
|
|
171
|
+
active_specs
|
|
164
172
|
end
|
|
165
|
-
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# The newest version the cooldown setting would let bundler adopt right
|
|
176
|
+
# now, when the newest overall version is still inside the window. Only a
|
|
177
|
+
# version strictly between the installed one and the newest one is an
|
|
178
|
+
# adoptable update worth showing.
|
|
179
|
+
def newest_out_of_cooldown(active_spec, current_spec)
|
|
180
|
+
newest = matching_specs(active_spec, current_spec).reverse_each.find {|spec| cooldown_days_remaining(spec).nil? }
|
|
181
|
+
return unless newest
|
|
182
|
+
return if newest.version >= active_spec.version || newest.version <= current_spec.version
|
|
183
|
+
newest
|
|
166
184
|
end
|
|
167
185
|
|
|
168
186
|
def print_gems(gems_list)
|
|
@@ -208,7 +226,11 @@ module Bundler
|
|
|
208
226
|
spec_outdated_info += ", released #{release_date}" unless release_date.empty?
|
|
209
227
|
|
|
210
228
|
remaining = cooldown_days_remaining(active_spec)
|
|
211
|
-
|
|
229
|
+
if remaining
|
|
230
|
+
spec_outdated_info += ", in cooldown for #{remaining} more day#{"s" if remaining > 1}"
|
|
231
|
+
adoptable = newest_out_of_cooldown(active_spec, current_spec)
|
|
232
|
+
spec_outdated_info += ", newest out of cooldown #{adoptable.version}" if adoptable
|
|
233
|
+
end
|
|
212
234
|
|
|
213
235
|
spec_outdated_info += ")"
|
|
214
236
|
|
|
@@ -227,7 +249,11 @@ module Bundler
|
|
|
227
249
|
current_version = "#{current_spec.version}#{current_spec.git_version}"
|
|
228
250
|
spec_version = "#{active_spec.version}#{active_spec.git_version}"
|
|
229
251
|
remaining = cooldown_days_remaining(active_spec)
|
|
230
|
-
|
|
252
|
+
if remaining
|
|
253
|
+
adoptable = newest_out_of_cooldown(active_spec, current_spec)
|
|
254
|
+
adoptable_note = adoptable ? ", #{adoptable.version} out of cooldown" : ""
|
|
255
|
+
spec_version += " (cooldown #{remaining}d#{adoptable_note})"
|
|
256
|
+
end
|
|
231
257
|
dependency = dependency.requirement if dependency
|
|
232
258
|
|
|
233
259
|
ret_val = [active_spec.name, current_version, spec_version, dependency.to_s, groups.to_s]
|
|
@@ -236,7 +262,7 @@ module Bundler
|
|
|
236
262
|
ret_val
|
|
237
263
|
end
|
|
238
264
|
|
|
239
|
-
def cooldown_days_remaining(spec, now =
|
|
265
|
+
def cooldown_days_remaining(spec, now = cooldown_now)
|
|
240
266
|
return nil unless spec.respond_to?(:created_at) && spec.created_at
|
|
241
267
|
return nil unless spec.respond_to?(:remote) && spec.remote
|
|
242
268
|
days = spec.remote.effective_cooldown
|
|
@@ -245,6 +271,10 @@ module Bundler
|
|
|
245
271
|
remaining > 0 ? remaining.ceil : nil
|
|
246
272
|
end
|
|
247
273
|
|
|
274
|
+
def cooldown_now
|
|
275
|
+
@cooldown_now ||= Time.now
|
|
276
|
+
end
|
|
277
|
+
|
|
248
278
|
def check_for_deployment_mode!
|
|
249
279
|
return unless Bundler.frozen_bundle?
|
|
250
280
|
suggested_command = if Bundler.settings.locations("frozen").keys.&([:global, :local]).any?
|
|
@@ -118,6 +118,7 @@ module Bundler
|
|
|
118
118
|
Bundler.ui.confirm "Bundle updated!"
|
|
119
119
|
Bundler::CLI::Common.output_without_groups_message(:update)
|
|
120
120
|
Bundler::CLI::Common.output_post_install_messages installer.post_install_messages
|
|
121
|
+
Bundler::CLI::Common.output_cooldown_skipped_summary
|
|
121
122
|
|
|
122
123
|
Bundler::CLI::Common.output_fund_metadata_summary
|
|
123
124
|
end
|
data/bundler/lib/bundler/cli.rb
CHANGED
|
@@ -626,15 +626,15 @@ module Bundler
|
|
|
626
626
|
end
|
|
627
627
|
|
|
628
628
|
desc "lock", "Creates a lockfile without installing"
|
|
629
|
-
method_option "update", type: :array, lazy_default: true, banner: "ignore the existing lockfile, update all gems by default, or update list of given gems"
|
|
629
|
+
method_option "update", type: :array, lazy_default: true, repeatable: true, banner: "ignore the existing lockfile, update all gems by default, or update list of given gems"
|
|
630
630
|
method_option "local", type: :boolean, default: false, banner: "do not attempt to fetch remote gemspecs and use the local gem cache only"
|
|
631
631
|
method_option "print", type: :boolean, default: false, banner: "print the lockfile to STDOUT instead of writing to the file system"
|
|
632
632
|
method_option "gemfile", type: :string, banner: "Use the specified gemfile instead of Gemfile"
|
|
633
633
|
method_option "lockfile", type: :string, default: nil, banner: "the path the lockfile should be written to"
|
|
634
634
|
method_option "full-index", type: :boolean, default: false, banner: "Fall back to using the single-file index of all gems"
|
|
635
635
|
method_option "add-checksums", type: :boolean, default: false, banner: "Adds checksums to the lockfile"
|
|
636
|
-
method_option "add-platform", type: :array, default: [], banner: "Add a new platform to the lockfile"
|
|
637
|
-
method_option "remove-platform", type: :array, default: [], banner: "Remove a platform from the lockfile"
|
|
636
|
+
method_option "add-platform", type: :array, default: [], repeatable: true, banner: "Add a new platform to the lockfile"
|
|
637
|
+
method_option "remove-platform", type: :array, default: [], repeatable: true, banner: "Remove a platform from the lockfile"
|
|
638
638
|
method_option "normalize-platforms", type: :boolean, default: false, banner: "Normalize lockfile platforms"
|
|
639
639
|
method_option "patch", type: :boolean, banner: "If updating, prefer updating only to next patch version"
|
|
640
640
|
method_option "minor", type: :boolean, banner: "If updating, prefer updating only to next minor version"
|
|
@@ -366,6 +366,12 @@ module Bundler
|
|
|
366
366
|
sources.git_sources.filter_map {|s| File.realpath(s.path) if File.exist?(s.path) }
|
|
367
367
|
end
|
|
368
368
|
|
|
369
|
+
# Versions excluded by cooldown during the last resolution, one entry per
|
|
370
|
+
# gem with the newest skipped version. Empty when no resolution ran.
|
|
371
|
+
def cooldown_skipped
|
|
372
|
+
@cooldown_skipped || []
|
|
373
|
+
end
|
|
374
|
+
|
|
369
375
|
def groups
|
|
370
376
|
dependencies.flat_map(&:groups).uniq
|
|
371
377
|
end
|
|
@@ -404,7 +410,7 @@ module Bundler
|
|
|
404
410
|
updating_major = locked_major < current_major
|
|
405
411
|
end
|
|
406
412
|
|
|
407
|
-
preserve_unknown_sections ||=
|
|
413
|
+
preserve_unknown_sections ||= Bundler.frozen_bundle? || (!updating_major && !(unlocking? || @unlocking_bundler))
|
|
408
414
|
|
|
409
415
|
if File.exist?(file) && lockfiles_equal?(@lockfile_contents, contents, preserve_unknown_sections)
|
|
410
416
|
return if Bundler.frozen_bundle?
|
|
@@ -413,8 +419,10 @@ module Bundler
|
|
|
413
419
|
end
|
|
414
420
|
|
|
415
421
|
if Bundler.frozen_bundle?
|
|
416
|
-
|
|
417
|
-
|
|
422
|
+
msg = lockfile_changes_summary("frozen mode is set") ||
|
|
423
|
+
"Your lockfile needs to be updated, but it can't be because frozen mode is set.\n\n" \
|
|
424
|
+
"Run `bundle install` elsewhere and add the updated #{SharedHelpers.relative_lockfile_path} to version control."
|
|
425
|
+
raise ProductionError, msg
|
|
418
426
|
end
|
|
419
427
|
|
|
420
428
|
# Convert to \r\n if the existing lock has them, i.e., Windows with
|
|
@@ -770,6 +778,8 @@ module Bundler
|
|
|
770
778
|
|
|
771
779
|
result = SpecSet.new(resolver.start)
|
|
772
780
|
|
|
781
|
+
@cooldown_skipped = resolver.cooldown_skipped
|
|
782
|
+
|
|
773
783
|
@resolved_bundler_version = result.find {|spec| spec.name == "bundler" }&.version
|
|
774
784
|
|
|
775
785
|
@new_platforms.each do |platform|
|
data/bundler/lib/bundler/dsl.rb
CHANGED
|
@@ -68,7 +68,7 @@ module Bundler
|
|
|
68
68
|
development_group = opts[:development_group] || :development
|
|
69
69
|
expanded_path = gemfile_root.join(path)
|
|
70
70
|
|
|
71
|
-
gemspecs =
|
|
71
|
+
gemspecs = SharedHelpers.glob_files_in_dir("{,*}.gemspec", expanded_path).filter_map {|g| Bundler.load_gemspec(g) }
|
|
72
72
|
gemspecs.reject! {|s| s.name != name } if name
|
|
73
73
|
specs_by_name_and_version = gemspecs.group_by {|s| [s.name, s.version] }
|
|
74
74
|
|
|
@@ -50,6 +50,19 @@ module Bundler
|
|
|
50
50
|
end
|
|
51
51
|
end
|
|
52
52
|
|
|
53
|
+
# `require_paths` is overridden above, but `full_require_paths` (and so
|
|
54
|
+
# `load_paths`) is computed from `raw_require_paths`, which would otherwise
|
|
55
|
+
# report the default `lib` for every gem
|
|
56
|
+
def raw_require_paths
|
|
57
|
+
if @remote_specification
|
|
58
|
+
@remote_specification.raw_require_paths
|
|
59
|
+
elsif _local_specification
|
|
60
|
+
_local_specification.raw_require_paths
|
|
61
|
+
else
|
|
62
|
+
super
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
53
66
|
# needed for inline
|
|
54
67
|
def load_paths
|
|
55
68
|
# remote specs aren't installed, and can't have load_paths
|
|
@@ -32,7 +32,7 @@ module Bundler
|
|
|
32
32
|
|
|
33
33
|
def initialize(base = nil, name = nil)
|
|
34
34
|
@base = File.expand_path(base || SharedHelpers.pwd)
|
|
35
|
-
gemspecs = name ? [File.join(@base, "#{name}.gemspec")] :
|
|
35
|
+
gemspecs = name ? [File.join(@base, "#{name}.gemspec")] : SharedHelpers.glob_files_in_dir("{,*}.gemspec", @base)
|
|
36
36
|
raise "Unable to determine name from existing gemspec. Use :name => 'gemname' in #install_tasks to manually set it." unless gemspecs.size == 1
|
|
37
37
|
@spec_path = gemspecs.first
|
|
38
38
|
@gemspec = Bundler.load_gemspec(@spec_path)
|
|
@@ -124,7 +124,7 @@ module Bundler
|
|
|
124
124
|
end
|
|
125
125
|
|
|
126
126
|
def built_gem_path
|
|
127
|
-
|
|
127
|
+
SharedHelpers.glob_files_in_dir("#{name}-*.gem", base).sort_by {|f| File.mtime(f) }.last
|
|
128
128
|
end
|
|
129
129
|
|
|
130
130
|
def git_push(remote = nil)
|
|
@@ -83,6 +83,12 @@ module Bundler
|
|
|
83
83
|
install(options)
|
|
84
84
|
|
|
85
85
|
Gem::Specification.reset # invalidate gem specification cache so that installed gems are immediately available
|
|
86
|
+
# Drop the source caches too, since releasing resolution memory dropped
|
|
87
|
+
# the source indexes. A resolution happening after this point would
|
|
88
|
+
# otherwise rebuild them around a snapshot of installed gems taken
|
|
89
|
+
# before the install, and materialize against remote specs that don't
|
|
90
|
+
# know where the gems they stand for ended up.
|
|
91
|
+
@definition.sources.clear_cache
|
|
86
92
|
|
|
87
93
|
lock
|
|
88
94
|
Standalone.new(options[:standalone], @definition).generate if options[:standalone]
|
|
@@ -103,6 +103,11 @@ module Bundler
|
|
|
103
103
|
end
|
|
104
104
|
|
|
105
105
|
def bundler_checksum
|
|
106
|
+
# In frozen mode the lockfile can't change, so reproduce whatever bundler
|
|
107
|
+
# entry is already locked instead of recording one for the running bundler
|
|
108
|
+
# version, which may legitimately differ from the locked one.
|
|
109
|
+
return locked_bundler_checksum if Bundler.frozen_bundle?
|
|
110
|
+
|
|
106
111
|
# `.dev` versions and `SKIP_BUNDLER_CHECKSUM` are deliberate opt-outs (used
|
|
107
112
|
# by Bundler/RubyGems' own development and release tasks): never record a
|
|
108
113
|
# checksum for Bundler itself in those cases.
|
|
@@ -138,5 +143,16 @@ module Bundler
|
|
|
138
143
|
|
|
139
144
|
locked_gems.bundler_version != definition.bundler_version_to_lock
|
|
140
145
|
end
|
|
146
|
+
|
|
147
|
+
def locked_bundler_checksum
|
|
148
|
+
locked_version = definition.locked_gems&.bundler_version
|
|
149
|
+
return [] unless locked_version
|
|
150
|
+
|
|
151
|
+
metadata_source = definition.sources.metadata_source
|
|
152
|
+
locked_spec = LazySpecification.new("bundler", locked_version, Gem::Platform::RUBY, metadata_source)
|
|
153
|
+
return [] if metadata_source.checksum_store.missing?(locked_spec)
|
|
154
|
+
|
|
155
|
+
[metadata_source.checksum_store.to_lock(locked_spec)]
|
|
156
|
+
end
|
|
141
157
|
end
|
|
142
158
|
end
|
|
@@ -82,7 +82,7 @@ The following is a list of all configuration keys and their purpose\. You can le
|
|
|
82
82
|
.IP "\(bu" 4
|
|
83
83
|
\fBcache_path\fR (\fBBUNDLE_CACHE_PATH\fR): The directory that bundler will place cached gems in when running \fBbundle package\fR, and that bundler will look in when installing gems\. Defaults to \fBvendor/cache\fR\.
|
|
84
84
|
.IP "\(bu" 4
|
|
85
|
-
\fBclean\fR (\fBBUNDLE_CLEAN\fR): Whether Bundler should run \fBbundle clean\fR automatically after \fBbundle install\fR\. Defaults to \fBtrue\fR in Bundler
|
|
85
|
+
\fBclean\fR (\fBBUNDLE_CLEAN\fR): Whether Bundler should run \fBbundle clean\fR automatically after \fBbundle install\fR\. Defaults to \fBtrue\fR in Bundler 5, as long as \fBpath\fR is not explicitly configured\.
|
|
86
86
|
.IP "\(bu" 4
|
|
87
87
|
\fBconsole\fR (\fBBUNDLE_CONSOLE\fR): The console that \fBbundle console\fR starts\. Defaults to \fBirb\fR\.
|
|
88
88
|
.IP "\(bu" 4
|
|
@@ -147,7 +147,7 @@ Cooldown filtering depends on the gem server providing a per\-version \fBcreated
|
|
|
147
147
|
.IP "\(bu" 4
|
|
148
148
|
\fBonly\fR (\fBBUNDLE_ONLY\fR): A space\-separated list of groups to install only gems of the specified groups\. Please check carefully if you want to install also gems without a group, because they get put inside \fBdefault\fR group\. For example \fBonly test:default\fR will install all gems specified in test group and without one\.
|
|
149
149
|
.IP "\(bu" 4
|
|
150
|
-
\fBpath\fR (\fBBUNDLE_PATH\fR): The location on disk where all gems in your bundle will be located regardless of \fB$GEM_HOME\fR or \fB$GEM_PATH\fR values\. Bundle gems not found in this location will be installed by \fBbundle install\fR\. When not set, Bundler install by default to a \fB\.bundle\fR directory relative to repository root in Bundler
|
|
150
|
+
\fBpath\fR (\fBBUNDLE_PATH\fR): The location on disk where all gems in your bundle will be located regardless of \fB$GEM_HOME\fR or \fB$GEM_PATH\fR values\. Bundle gems not found in this location will be installed by \fBbundle install\fR\. When not set, Bundler install by default to a \fB\.bundle\fR directory relative to repository root in Bundler 5, and to the default system path (\fBGem\.dir\fR) before Bundler 5\. That means that before Bundler 5, Bundler shares this location with Rubygems, and \fBgem install \|\.\|\.\|\.\fR will have gems installed in the same location and therefore, gems installed without \fBpath\fR set will show up by calling \fBgem list\fR\. This will not be the case in Bundler 5\.
|
|
151
151
|
.IP "\(bu" 4
|
|
152
152
|
\fBpath\.system\fR (\fBBUNDLE_PATH__SYSTEM\fR): Whether Bundler will install gems into the default system path (\fBGem\.dir\fR)\.
|
|
153
153
|
.IP "\(bu" 4
|
|
@@ -133,7 +133,7 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
|
|
|
133
133
|
Defaults to `vendor/cache`.
|
|
134
134
|
* `clean` (`BUNDLE_CLEAN`):
|
|
135
135
|
Whether Bundler should run `bundle clean` automatically after
|
|
136
|
-
`bundle install`. Defaults to `true` in Bundler
|
|
136
|
+
`bundle install`. Defaults to `true` in Bundler 5, as long as `path` is not
|
|
137
137
|
explicitly configured.
|
|
138
138
|
* `console` (`BUNDLE_CONSOLE`):
|
|
139
139
|
The console that `bundle console` starts. Defaults to `irb`.
|
|
@@ -245,12 +245,12 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
|
|
|
245
245
|
The location on disk where all gems in your bundle will be located regardless
|
|
246
246
|
of `$GEM_HOME` or `$GEM_PATH` values. Bundle gems not found in this location
|
|
247
247
|
will be installed by `bundle install`. When not set, Bundler install by
|
|
248
|
-
default to a `.bundle` directory relative to repository root in Bundler
|
|
249
|
-
and to the default system path (`Gem.dir`) before Bundler
|
|
250
|
-
before Bundler
|
|
248
|
+
default to a `.bundle` directory relative to repository root in Bundler 5,
|
|
249
|
+
and to the default system path (`Gem.dir`) before Bundler 5. That means that
|
|
250
|
+
before Bundler 5, Bundler shares this location with Rubygems, and `gem
|
|
251
251
|
install ...` will have gems installed in the same location and therefore,
|
|
252
252
|
gems installed without `path` set will show up by calling `gem list`. This
|
|
253
|
-
will not be the case in Bundler
|
|
253
|
+
will not be the case in Bundler 5.
|
|
254
254
|
* `path.system` (`BUNDLE_PATH__SYSTEM`):
|
|
255
255
|
Whether Bundler will install gems into the default system path (`Gem.dir`).
|
|
256
256
|
* `plugins` (`BUNDLE_PLUGINS`):
|
|
@@ -55,7 +55,7 @@ Only list patch newer versions\.
|
|
|
55
55
|
Only list gems specified in your Gemfile, not their dependencies\.
|
|
56
56
|
.TP
|
|
57
57
|
\fB\-\-cooldown=<number>\fR
|
|
58
|
-
Annotate (rather than hide) versions that are still inside the cooldown window of \fInumber\fR days\. The prose output appends "in cooldown for Nd more days" and the table form adds "(cooldown Nd)" to the Latest column\. See \fBcooldown\fR in bundle\-config(1)\.
|
|
58
|
+
Annotate (rather than hide) versions that are still inside the cooldown window of \fInumber\fR days\. The prose output appends "in cooldown for Nd more days" and the table form adds "(cooldown Nd)" to the Latest column\. When a version outside the window is newer than the installed one, the prose output also appends "newest out of cooldown X" and the table form becomes "(cooldown Nd, X out of cooldown)"\. With \fB\-\-filter\-strict\fR (or \fB\-\-patch\fR, \fB\-\-minor\fR, \fB\-\-major\fR, which imply it), "newest" is already the cooldown\-filtered resolved version, so none of these annotations appear\. See \fBcooldown\fR in bundle\-config(1)\.
|
|
59
59
|
.SH "PATCH LEVEL OPTIONS"
|
|
60
60
|
See bundle update(1) \fIbundle\-update\.1\.html\fR for details\.
|
|
61
61
|
.SH "FILTERING OUTPUT"
|
|
@@ -76,7 +76,13 @@ are up to date, Bundler will exit with a status of 0. Otherwise, it will exit 1.
|
|
|
76
76
|
Annotate (rather than hide) versions that are still inside the
|
|
77
77
|
cooldown window of <number> days. The prose output appends "in
|
|
78
78
|
cooldown for Nd more days" and the table form adds "(cooldown Nd)" to
|
|
79
|
-
the Latest column.
|
|
79
|
+
the Latest column. When a version outside the window is newer than the
|
|
80
|
+
installed one, the prose output also appends "newest out of cooldown
|
|
81
|
+
X" and the table form becomes "(cooldown Nd, X out of cooldown)".
|
|
82
|
+
With `--filter-strict` (or `--patch`, `--minor`, `--major`, which
|
|
83
|
+
imply it), "newest" is already the cooldown-filtered resolved version,
|
|
84
|
+
so none of these annotations appear. See `cooldown` in
|
|
85
|
+
bundle-config(1).
|
|
80
86
|
|
|
81
87
|
## PATCH LEVEL OPTIONS
|
|
82
88
|
|
|
@@ -38,6 +38,8 @@ Your current platform satisfies the Ruby version requirement\.
|
|
|
38
38
|
.IP "" 0
|
|
39
39
|
.P
|
|
40
40
|
\fBplatform\fR lists all the platforms in your \fBGemfile\.lock\fR as well as the \fBruby\fR directive if applicable from your Gemfile(5)\. It also lets you know if the \fBruby\fR directive requirement has been met\. If \fBruby\fR directive doesn't match the running Ruby VM, it tells you what part does not\.
|
|
41
|
+
.P
|
|
42
|
+
For a detailed explanation of how bundler handles platforms, see the \fBPLATFORMS\fR section in Gemfile(5)\.
|
|
41
43
|
.SH "OPTIONS"
|
|
42
44
|
.TP
|
|
43
45
|
\fB\-\-ruby\fR
|
|
@@ -45,5 +47,7 @@ It will display the ruby directive information, so you don't have to parse it fr
|
|
|
45
47
|
.SH "SEE ALSO"
|
|
46
48
|
.IP "\(bu" 4
|
|
47
49
|
bundle\-lock(1) \fIbundle\-lock\.1\.html\fR
|
|
50
|
+
.IP "\(bu" 4
|
|
51
|
+
Gemfile(5) \fIgemfile\.5\.html\fR
|
|
48
52
|
.IP "" 0
|
|
49
53
|
|
|
@@ -38,6 +38,9 @@ If you run `bundle platform` on Ruby 3.1.2, it displays the following output:
|
|
|
38
38
|
if the `ruby` directive requirement has been met. If `ruby` directive doesn't
|
|
39
39
|
match the running Ruby VM, it tells you what part does not.
|
|
40
40
|
|
|
41
|
+
For a detailed explanation of how bundler handles platforms, see the
|
|
42
|
+
`PLATFORMS` section in Gemfile(5).
|
|
43
|
+
|
|
41
44
|
## OPTIONS
|
|
42
45
|
|
|
43
46
|
* `--ruby`:
|
|
@@ -47,3 +50,4 @@ match the running Ruby VM, it tells you what part does not.
|
|
|
47
50
|
## SEE ALSO
|
|
48
51
|
|
|
49
52
|
* [bundle-lock(1)](bundle-lock.1.html)
|
|
53
|
+
* [Gemfile(5)](gemfile.5.html)
|
|
@@ -392,7 +392,7 @@ gem "rails", git: "https://rails@bitbucket\.org/rails/rails\.git"
|
|
|
392
392
|
.P
|
|
393
393
|
Since the \fBbitbucket\fR method is a specialization of \fBgit_source\fR, it accepts a \fB:branch\fR named argument\.
|
|
394
394
|
.SS "PATH"
|
|
395
|
-
You can specify that a gem is located in a particular location on the file system\. Relative paths are resolved relative to the directory containing the \fBGemfile\fR\.
|
|
395
|
+
You can specify that a gem is located in a particular location on the file system\. Relative paths are resolved relative to the directory containing the \fBGemfile\fR\. The path must point to a directory containing the gem's unpacked source code, not to a packaged \fB\.gem\fR file\.
|
|
396
396
|
.P
|
|
397
397
|
Similar to the semantics of the \fB:git\fR option, the \fB:path\fR option requires that the directory in question either contains a \fB\.gemspec\fR for the gem, or that you specify an explicit version that bundler should use\.
|
|
398
398
|
.P
|
|
@@ -451,7 +451,9 @@ Since the `bitbucket` method is a specialization of `git_source`, it accepts a `
|
|
|
451
451
|
|
|
452
452
|
You can specify that a gem is located in a particular location
|
|
453
453
|
on the file system. Relative paths are resolved relative to the
|
|
454
|
-
directory containing the `Gemfile`.
|
|
454
|
+
directory containing the `Gemfile`. The path must point to a
|
|
455
|
+
directory containing the gem's unpacked source code, not to a
|
|
456
|
+
packaged `.gem` file.
|
|
455
457
|
|
|
456
458
|
Similar to the semantics of the `:git` option, the `:path`
|
|
457
459
|
option requires that the directory in question either contains
|