bundler 4.0.0 → 4.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ff773a79d243042d8e5f038f26bed5bb2d2b7278b8c1917874e63d5a49824c33
4
- data.tar.gz: b201596e375da2a5928dc5a907f11af3a6f2327730b20e54bcb00a1ac7f731d3
3
+ metadata.gz: bc795eb4fad5cfda77ee10bf7d3dd7ebbd9fbbbfe243f4741d6d927d0dbc1783
4
+ data.tar.gz: aff16ee9ee860d6907e7861eb457b1fc469ab3d61474a2052dbee902c0109f6b
5
5
  SHA512:
6
- metadata.gz: 9c8b6e998ebb4a1c77d35148a1ff2ceaf04061552080db9dca5d39c743980d285142139cb469f5e8ea4640259314e2300c3397460594d7b795c7e5c426ed191a
7
- data.tar.gz: 0d6f774a34a05a23074b74e19d6a776c8d771affe729aa83292df730d28bb5e80b038c6c16645198f6dd29c11c2d9da49f589291fc85370813596910cc967bad
6
+ metadata.gz: 9fedd026b308dc0529dba0e6e2363f3162eca30cd4bc45d302348531eae3f10485a5142cdd2bff81b746c3538bebca71b2baf2a6f8beac320589e162fbf21de0
7
+ data.tar.gz: 48acb62c12160b55a8caee93ffbe77cb59bdf2164a7e3280c44bd74f2246b575d9fc31ec85c753f886d6c64896761dfcd8ad562ca10bdb782e0e81c5e524d857
data/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.0.2 (2025-12-17)
4
+
5
+ ### Enhancements:
6
+
7
+ - Support single quotes in mise format ruby version [#9183](https://github.com/ruby/rubygems/pull/9183)
8
+ - Tweak the Bundler's "X gems now installed message": [#9194](https://github.com/ruby/rubygems/pull/9194)
9
+
10
+ ### Bug fixes:
11
+
12
+ - Allow to show cli_help with `bundler` executable [#9198](https://github.com/ruby/rubygems/pull/9198)
13
+ - Allow bundle pristine to work for git gems in the same repo [#9196](https://github.com/ruby/rubygems/pull/9196)
14
+
15
+ ## 4.0.1 (2025-12-09)
16
+
17
+ ### Performance:
18
+
19
+ - Increase connection pool to allow for up to 70% speed increase on `bundle install` [#9087](https://github.com/ruby/rubygems/pull/9087)
20
+
21
+ ### Enhancements:
22
+
23
+ - Fix the config suggestion in the warning for `$ bundle` [#9164](https://github.com/ruby/rubygems/pull/9164)
24
+ - Fix native extension loading in newgem template for RHEL-based systems [#9156](https://github.com/ruby/rubygems/pull/9156)
25
+
26
+ ### Bug fixes:
27
+
28
+ - Fix Bundler removing executables after creating them [#9169](https://github.com/ruby/rubygems/pull/9169)
29
+
3
30
  ## 4.0.0 (2025-12-03)
4
31
 
5
32
  ### Features:
@@ -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 = "2025-12-03".freeze
8
- @git_commit_sha = "64d0dfe695".freeze
7
+ @built_at = "2025-12-17".freeze
8
+ @git_commit_sha = "03359f8b08".freeze
9
9
  # end ivars
10
10
 
11
11
  # A hash representation of the build metadata.
@@ -90,7 +90,7 @@ module Bundler
90
90
  end
91
91
 
92
92
  def gems_installed_for(definition)
93
- count = definition.specs.count
93
+ count = definition.specs.count {|spec| spec.name != "bundler" }
94
94
  "#{count} #{count == 1 ? "gem" : "gems"} now installed"
95
95
  end
96
96
 
@@ -11,6 +11,7 @@ module Bundler
11
11
  definition = Bundler.definition
12
12
  definition.validate_runtime!
13
13
  installer = Bundler::Installer.new(Bundler.root, definition)
14
+ git_sources = []
14
15
 
15
16
  ProcessLock.lock do
16
17
  installed_specs = definition.specs.reject do |spec|
@@ -41,6 +42,9 @@ module Bundler
41
42
  end
42
43
  FileUtils.rm_rf spec.extension_dir
43
44
  FileUtils.rm_rf spec.full_gem_path
45
+
46
+ next if git_sources.include?(source)
47
+ git_sources << source
44
48
  else
45
49
  Bundler.ui.warn("Cannot pristine #{gem_name}. Gem is sourced from local path.")
46
50
  next
data/lib/bundler/cli.rb CHANGED
@@ -104,7 +104,7 @@ module Bundler
104
104
  primary_commands = ["install", "update", "cache", "exec", "config", "help"]
105
105
 
106
106
  list = self.class.printable_commands(true)
107
- by_name = list.group_by {|name, _message| name.match(/^bundle (\w+)/)[1] }
107
+ by_name = list.group_by {|name, _message| name.match(/^bundler? (\w+)/)[1] }
108
108
  utilities = by_name.keys.sort - primary_commands
109
109
  primary_commands.map! {|name| (by_name[name] || raise("no primary command #{name}")).first }
110
110
  utilities.map! {|name| by_name[name].first }
@@ -120,28 +120,31 @@ module Bundler
120
120
  self.class.send(:class_options_help, shell)
121
121
  end
122
122
 
123
- desc "install_or_cli_help", "Tries to run bundle install but prints a summary of bundler commands if there is no Gemfile", hide: true
123
+ desc "install_or_cli_help", "Deprecated alias of install", hide: true
124
124
  def install_or_cli_help
125
+ Bundler.ui.warn <<~MSG
126
+ `bundle install_or_cli_help` is a deprecated alias of `bundle install`.
127
+ It might be called due to the 'default_cli_command' being set to 'install_or_cli_help',
128
+ if so fix that by running `bundle config set default_cli_command install --global`.
129
+ MSG
125
130
  invoke_other_command("install")
126
- rescue GemfileNotFound => error
127
- Bundler.ui.error error.message, wrap: true
128
- invoke_other_command("cli_help")
129
131
  end
130
132
 
131
133
  def self.default_command(meth = nil)
132
134
  return super if meth
133
135
 
134
136
  unless Bundler.settings[:default_cli_command]
135
- Bundler.ui.info <<-MSG
137
+ Bundler.ui.info <<~MSG
136
138
  In a future version of Bundler, running `bundle` without argument will no longer run `bundle install`.
137
139
  Instead, the `cli_help` command will be displayed. Please use `bundle install` explicitly for scripts like CI/CD.
138
140
  You can use the future behavior now with `bundle config set default_cli_command cli_help --global`,
139
- or you can continue to use the current behavior with `bundle config set default_cli_command install_or_cli_help --global`.
141
+ or you can continue to use the current behavior with `bundle config set default_cli_command install --global`.
140
142
  This message will be removed after a default_cli_command value is set.
143
+
141
144
  MSG
142
145
  end
143
146
 
144
- Bundler.settings[:default_cli_command] || "install_or_cli_help"
147
+ Bundler.settings[:default_cli_command] || "install"
145
148
  end
146
149
 
147
150
  class_option "no-color", type: :boolean, desc: "Disable colorization in output"
@@ -287,6 +290,9 @@ module Bundler
287
290
  Bundler.settings.temporary(no_install: false) do
288
291
  Install.new(options).run
289
292
  end
293
+ rescue GemfileNotFound => error
294
+ invoke_other_command("cli_help")
295
+ raise error # re-raise to show the error and get a failing exit status
290
296
  end
291
297
 
292
298
  map aliases_for("install")
@@ -60,6 +60,28 @@ module Bundler
60
60
  end
61
61
  end
62
62
 
63
+ # needed for binstubs
64
+ def executables
65
+ if @remote_specification
66
+ @remote_specification.executables
67
+ elsif _local_specification
68
+ _local_specification.executables
69
+ else
70
+ super
71
+ end
72
+ end
73
+
74
+ # needed for bundle clean
75
+ def bindir
76
+ if @remote_specification
77
+ @remote_specification.bindir
78
+ elsif _local_specification
79
+ _local_specification.bindir
80
+ else
81
+ super
82
+ end
83
+ end
84
+
63
85
  # needed for post_install_messages during install
64
86
  def post_install_message
65
87
  if @remote_specification
@@ -5,6 +5,12 @@ require "rubygems/remote_fetcher"
5
5
  module Bundler
6
6
  class Fetcher
7
7
  class GemRemoteFetcher < Gem::RemoteFetcher
8
+ def initialize(*)
9
+ super
10
+
11
+ @pool_size = 5
12
+ end
13
+
8
14
  def request(*args)
9
15
  super do |req|
10
16
  req.delete("User-Agent") if headers["User-Agent"]
@@ -42,18 +42,21 @@ module Bundler
42
42
  # Loads the file relative to the dirname of the Gemfile itself.
43
43
  def normalize_ruby_file(filename)
44
44
  file_content = Bundler.read_file(gemfile.dirname.join(filename))
45
- # match "ruby-3.2.2", ruby = "3.2.2" or "ruby 3.2.2" capturing version string up to the first space or comment
46
- if /^ # Start of line
47
- ruby # Literal "ruby"
48
- [\s-]* # Optional whitespace or hyphens (for "ruby-3.2.2" format)
49
- (?:=\s*)? # Optional equals sign with whitespace (for ruby = "3.2.2" format)
50
- "? # Optional opening quote
51
- ( # Start capturing group
52
- [^\s#"]+ # One or more chars that aren't spaces, #, or quotes
53
- ) # End capturing group
54
- "? # Optional closing quote
55
- /x.match(file_content)
56
- $1
45
+ # match "ruby-3.2.2", ruby = "3.2.2", ruby = '3.2.2' or "ruby 3.2.2" capturing version string up to the first space or comment
46
+ version_match = /^ # Start of line
47
+ ruby # Literal "ruby"
48
+ [\s-]* # Optional whitespace or hyphens (for "ruby-3.2.2" format)
49
+ (?:=\s*)? # Optional equals sign with whitespace (for ruby = "3.2.2" format)
50
+ (?:
51
+ "([^"]+)" # Double quoted version
52
+ |
53
+ '([^']+)' # Single quoted version
54
+ |
55
+ ([^\s#"']+) # Unquoted version
56
+ )
57
+ /x.match(file_content)
58
+ if version_match
59
+ version_match[1] || version_match[2] || version_match[3]
57
60
  else
58
61
  file_content.strip
59
62
  end
@@ -103,6 +103,10 @@ module Bundler
103
103
  end
104
104
  end
105
105
 
106
+ def build_jobs
107
+ Bundler.settings[:jobs] || super
108
+ end
109
+
106
110
  def build_extensions
107
111
  extension_cache_path = options[:bundler_extension_cache_path]
108
112
  extension_dir = spec.extension_dir
@@ -2,7 +2,7 @@
2
2
 
3
3
  require_relative "<%= File.basename(config[:namespaced_path]) %>/version"
4
4
  <%- if config[:ext] -%>
5
- require_relative "<%= File.basename(config[:namespaced_path]) %>/<%= config[:underscored_name] %>"
5
+ require "<%= File.basename(config[:namespaced_path]) %>/<%= config[:underscored_name] %>"
6
6
  <%- end -%>
7
7
 
8
8
  <%- config[:constant_array].each_with_index do |c, i| -%>
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "4.0.0".freeze
4
+ VERSION = "4.0.2".freeze
5
5
 
6
6
  def self.bundler_major_version
7
7
  @bundler_major_version ||= gem_version.segments.first
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bundler
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - André Arko