Skip to content

Commit 69f47cf

Browse files
Merge pull request #6730 from rubygems/release/bundler_2.4.14_rubygems_3.4.14
Prepare RubyGems 3.4.14 and Bundler 2.4.14
2 parents 26eb456 + 5a8342b commit 69f47cf

33 files changed

+293
-91
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# 3.4.14 / 2023-06-12
2+
3+
## Enhancements:
4+
5+
* Load plugin immediately. Pull request
6+
[#6673](https://github.com/rubygems/rubygems/pull/6673) by kou
7+
* Installs bundler 2.4.14 as a default gem.
8+
9+
## Documentation:
10+
11+
* Clarify what the `rubygems-update` gem is for, and link to source code
12+
and guides. Pull request
13+
[#6710](https://github.com/rubygems/rubygems/pull/6710) by davetron5000
14+
115
# 3.4.13 / 2023-05-09
216

317
## Enhancements:

bundler/CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
# 2.4.14 (June 12, 2023)
2+
3+
## Enhancements:
4+
5+
- Stop publishing Gemfile in default gem template [#6723](https://github.com/rubygems/rubygems/pull/6723)
6+
- Avoid infinite loops when hitting resolution bugs [#6722](https://github.com/rubygems/rubygems/pull/6722)
7+
- Make `LockfileParser` usable with just a lockfile [#6694](https://github.com/rubygems/rubygems/pull/6694)
8+
- Always rely on `$LOAD_PATH` when jumping from `exe/` to `lib/` [#6702](https://github.com/rubygems/rubygems/pull/6702)
9+
- Make `frozen` setting take precedence over `deployment` setting [#6685](https://github.com/rubygems/rubygems/pull/6685)
10+
- Show an error when trying to update bundler in frozen mode [#6684](https://github.com/rubygems/rubygems/pull/6684)
11+
12+
## Bug fixes:
13+
14+
- Fix `deployment` vs `path` precedence [#6703](https://github.com/rubygems/rubygems/pull/6703)
15+
- Fix inline mode with multiple sources [#6699](https://github.com/rubygems/rubygems/pull/6699)
16+
117
# 2.4.13 (May 9, 2023)
218

319
## Bug fixes:

bundler/exe/bundle

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ end
1010
base_path = File.expand_path("../lib", __dir__)
1111

1212
if File.exist?(base_path)
13-
require_relative "../lib/bundler"
14-
else
15-
require "bundler"
13+
$LOAD_PATH.unshift(base_path)
1614
end
1715

16+
require "bundler"
17+
1818
if Gem.rubygems_version < Gem::Version.new("3.2.3") && Gem.ruby_version < Gem::Version.new("2.7.a") && !ENV["BUNDLER_NO_OLD_RUBYGEMS_WARNING"]
1919
Bundler.ui.warn \
2020
"Your RubyGems version (#{Gem::VERSION}) has a bug that prevents " \
@@ -24,18 +24,10 @@ if Gem.rubygems_version < Gem::Version.new("3.2.3") && Gem.ruby_version < Gem::V
2424
"and silence this warning by running `gem update --system 3.2.3`"
2525
end
2626

27-
if File.exist?(base_path)
28-
require_relative "../lib/bundler/friendly_errors"
29-
else
30-
require "bundler/friendly_errors"
31-
end
27+
require "bundler/friendly_errors"
3228

3329
Bundler.with_friendly_errors do
34-
if File.exist?(base_path)
35-
require_relative "../lib/bundler/cli"
36-
else
37-
require "bundler/cli"
38-
end
30+
require "bundler/cli"
3931

4032
# Allow any command to use --help flag to show help for that command
4133
help_flags = %w[--help -h]

bundler/lib/bundler.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,10 @@ def definition(unlock = nil)
210210
end
211211

212212
def frozen_bundle?
213-
frozen = settings[:deployment]
214-
frozen ||= settings[:frozen]
215-
frozen
213+
frozen = settings[:frozen]
214+
return frozen unless frozen.nil?
215+
216+
settings[:deployment]
216217
end
217218

218219
def locked_gems

bundler/lib/bundler/definition.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ def missing_specs?
217217
rescue BundlerError => e
218218
@resolve = nil
219219
@resolver = nil
220+
@resolution_packages = nil
220221
@specs = nil
221222
@gem_version_promoter = nil
222223

@@ -361,10 +362,8 @@ def ensure_equivalent_gemfile_and_lockfile(explicit_flag = false)
361362
"updated #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)} to version control."
362363

363364
unless explicit_flag
364-
suggested_command = if Bundler.settings.locations("frozen").keys.&([:global, :local]).any?
365-
"bundle config unset frozen"
366-
elsif Bundler.settings.locations("deployment").keys.&([:global, :local]).any?
367-
"bundle config unset deployment"
365+
suggested_command = unless Bundler.settings.locations("frozen").keys.include?(:env)
366+
"bundle config set frozen false"
368367
end
369368
msg << "\n\nIf this is a development machine, remove the #{Bundler.default_gemfile} " \
370369
"freeze \nby running `#{suggested_command}`." if suggested_command
@@ -886,7 +885,8 @@ def lockfiles_equal?(current, proposed, preserve_unknown_sections)
886885
if preserve_unknown_sections
887886
sections_to_ignore = LockfileParser.sections_to_ignore(@locked_bundler_version)
888887
sections_to_ignore += LockfileParser.unknown_sections_in_lockfile(current)
889-
sections_to_ignore += LockfileParser::ENVIRONMENT_VERSION_SECTIONS
888+
sections_to_ignore << LockfileParser::RUBY
889+
sections_to_ignore << LockfileParser::BUNDLED unless @unlocking_bundler
890890
pattern = /#{Regexp.union(sections_to_ignore)}\n(\s{2,}.*\n)+/
891891
whitespace_cleanup = /\n{2,}/
892892
current = current.gsub(pattern, "\n").gsub(whitespace_cleanup, "\n\n").strip

bundler/lib/bundler/installer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def run(options)
9090

9191
Gem::Specification.reset # invalidate gem specification cache so that installed gems are immediately available
9292

93-
lock unless Bundler.frozen_bundle?
93+
lock
9494
Standalone.new(options[:standalone], @definition).generate if options[:standalone]
9595
end
9696
end

bundler/lib/bundler/lockfile_parser.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class LockfileParser
2626
KNOWN_SECTIONS = SECTIONS_BY_VERSION_INTRODUCED.values.flatten.freeze
2727

2828
ENVIRONMENT_VERSION_SECTIONS = [BUNDLED, RUBY].freeze
29+
deprecate_constant(:ENVIRONMENT_VERSION_SECTIONS)
2930

3031
def self.sections_in_lockfile(lockfile_contents)
3132
lockfile_contents.scan(/^\w[\w ]*$/).uniq

bundler/lib/bundler/settings.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,15 +219,16 @@ def processor_count
219219
def path
220220
configs.each do |_level, settings|
221221
path = value_for("path", settings)
222-
path = "vendor/bundle" if value_for("deployment", settings) && path.nil?
223222
path_system = value_for("path.system", settings)
224223
disabled_shared_gems = value_for("disable_shared_gems", settings)
225224
next if path.nil? && path_system.nil? && disabled_shared_gems.nil?
226225
system_path = path_system || (disabled_shared_gems == false)
227226
return Path.new(path, system_path)
228227
end
229228

230-
Path.new(nil, false)
229+
path = "vendor/bundle" if self[:deployment]
230+
231+
Path.new(path, false)
231232
end
232233

233234
Path = Struct.new(:explicit_path, :system_path) do

bundler/lib/bundler/source/rubygems.rb

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class Rubygems < Source
1010
# Ask for X gems per API request
1111
API_REQUEST_SIZE = 50
1212

13-
attr_reader :remotes, :caches
13+
attr_reader :remotes
1414

1515
def initialize(options = {})
1616
@options = options
@@ -19,11 +19,14 @@ def initialize(options = {})
1919
@allow_remote = false
2020
@allow_cached = false
2121
@allow_local = options["allow_local"] || false
22-
@caches = [cache_path, *Bundler.rubygems.gem_cache]
2322

2423
Array(options["remotes"]).reverse_each {|r| add_remote(r) }
2524
end
2625

26+
def caches
27+
@caches ||= [cache_path, *Bundler.rubygems.gem_cache]
28+
end
29+
2730
def local_only!
2831
@specs = nil
2932
@allow_local = true
@@ -324,9 +327,9 @@ def cached_gem(spec)
324327

325328
def cached_path(spec)
326329
global_cache_path = download_cache_path(spec)
327-
@caches << global_cache_path if global_cache_path
330+
caches << global_cache_path if global_cache_path
328331

329-
possibilities = @caches.map {|p| package_path(p, spec) }
332+
possibilities = caches.map {|p| package_path(p, spec) }
330333
possibilities.find {|p| File.exist?(p) }
331334
end
332335

bundler/lib/bundler/templates/newgem/newgem.gemspec.tt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ Gem::Specification.new do |spec|
2929
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
3030
spec.files = Dir.chdir(__dir__) do
3131
`git ls-files -z`.split("\x0").reject do |f|
32-
(File.expand_path(f) == __FILE__) || f.start_with?(*%w[bin/ test/ spec/ features/ .git .circleci appveyor])
32+
(File.expand_path(f) == __FILE__) ||
33+
f.start_with?(*%w[bin/ test/ spec/ features/ .git .circleci appveyor Gemfile])
3334
end
3435
end
3536
spec.bindir = "exe"

0 commit comments

Comments
 (0)