bundler 2.7.0 → 2.7.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.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +43 -0
  3. data/lib/bundler/build_metadata.rb +2 -2
  4. data/lib/bundler/checksum.rb +6 -0
  5. data/lib/bundler/cli/cache.rb +0 -1
  6. data/lib/bundler/cli/common.rb +1 -1
  7. data/lib/bundler/cli/install.rb +1 -3
  8. data/lib/bundler/cli/lock.rb +5 -5
  9. data/lib/bundler/cli/show.rb +2 -6
  10. data/lib/bundler/cli/update.rb +1 -1
  11. data/lib/bundler/cli.rb +43 -43
  12. data/lib/bundler/definition.rb +77 -60
  13. data/lib/bundler/dsl.rb +1 -1
  14. data/lib/bundler/feature_flag.rb +1 -1
  15. data/lib/bundler/man/bundle-add.1 +1 -1
  16. data/lib/bundler/man/bundle-binstubs.1 +1 -1
  17. data/lib/bundler/man/bundle-cache.1 +1 -1
  18. data/lib/bundler/man/bundle-check.1 +1 -1
  19. data/lib/bundler/man/bundle-clean.1 +1 -1
  20. data/lib/bundler/man/bundle-config.1 +31 -14
  21. data/lib/bundler/man/bundle-config.1.ronn +49 -20
  22. data/lib/bundler/man/bundle-console.1 +1 -1
  23. data/lib/bundler/man/bundle-doctor.1 +4 -4
  24. data/lib/bundler/man/bundle-doctor.1.ronn +4 -4
  25. data/lib/bundler/man/bundle-env.1 +1 -1
  26. data/lib/bundler/man/bundle-exec.1 +1 -1
  27. data/lib/bundler/man/bundle-fund.1 +1 -1
  28. data/lib/bundler/man/bundle-gem.1 +1 -1
  29. data/lib/bundler/man/bundle-help.1 +1 -1
  30. data/lib/bundler/man/bundle-info.1 +1 -1
  31. data/lib/bundler/man/bundle-init.1 +1 -1
  32. data/lib/bundler/man/bundle-inject.1 +1 -1
  33. data/lib/bundler/man/bundle-install.1 +4 -4
  34. data/lib/bundler/man/bundle-install.1.ronn +3 -4
  35. data/lib/bundler/man/bundle-issue.1 +1 -1
  36. data/lib/bundler/man/bundle-licenses.1 +1 -1
  37. data/lib/bundler/man/bundle-list.1 +1 -1
  38. data/lib/bundler/man/bundle-lock.1 +1 -1
  39. data/lib/bundler/man/bundle-open.1 +1 -1
  40. data/lib/bundler/man/bundle-outdated.1 +1 -1
  41. data/lib/bundler/man/bundle-platform.1 +1 -1
  42. data/lib/bundler/man/bundle-plugin.1 +40 -15
  43. data/lib/bundler/man/bundle-plugin.1.ronn +44 -15
  44. data/lib/bundler/man/bundle-pristine.1 +1 -1
  45. data/lib/bundler/man/bundle-remove.1 +1 -1
  46. data/lib/bundler/man/bundle-show.1 +1 -1
  47. data/lib/bundler/man/bundle-update.1 +5 -5
  48. data/lib/bundler/man/bundle-update.1.ronn +4 -4
  49. data/lib/bundler/man/bundle-version.1 +1 -1
  50. data/lib/bundler/man/bundle-viz.1 +1 -1
  51. data/lib/bundler/man/bundle.1 +1 -1
  52. data/lib/bundler/man/gemfile.5 +1 -1
  53. data/lib/bundler/resolver/package.rb +1 -0
  54. data/lib/bundler/settings.rb +1 -1
  55. data/lib/bundler/source/gemspec.rb +4 -0
  56. data/lib/bundler/source/path.rb +2 -0
  57. data/lib/bundler/templates/newgem/newgem.gemspec.tt +3 -3
  58. data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +42 -6
  59. data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +1 -1
  60. data/lib/bundler/vendor/thor/lib/thor/runner.rb +1 -1
  61. data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +3 -7
  62. data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
  63. data/lib/bundler/version.rb +1 -1
  64. metadata +2 -2
@@ -1,6 +1,6 @@
1
1
  .\" generated with Ronn-NG/v0.10.1
2
2
  .\" http://github.com/apjanke/ronn-ng/tree/0.10.1
3
- .TH "BUNDLE\-REMOVE" "1" "July 2025" ""
3
+ .TH "BUNDLE\-REMOVE" "1" "August 2025" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-remove\fR \- Removes gems from the Gemfile
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with Ronn-NG/v0.10.1
2
2
  .\" http://github.com/apjanke/ronn-ng/tree/0.10.1
3
- .TH "BUNDLE\-SHOW" "1" "July 2025" ""
3
+ .TH "BUNDLE\-SHOW" "1" "August 2025" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-show\fR \- Shows all the gems in your bundle, or the path to a gem
6
6
  .SH "SYNOPSIS"
@@ -1,10 +1,10 @@
1
1
  .\" generated with Ronn-NG/v0.10.1
2
2
  .\" http://github.com/apjanke/ronn-ng/tree/0.10.1
3
- .TH "BUNDLE\-UPDATE" "1" "July 2025" ""
3
+ .TH "BUNDLE\-UPDATE" "1" "August 2025" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-update\fR \- Update your gems to the latest available versions
6
6
  .SH "SYNOPSIS"
7
- \fBbundle update\fR \fI*gems\fR [\-\-all] [\-\-group=NAME] [\-\-source=NAME] [\-\-local] [\-\-ruby] [\-\-bundler[=VERSION]] [\-\-full\-index] [\-\-gemfile=GEMFILE] [\-\-jobs=NUMBER] [\-\-quiet] [\-\-patch|\-\-minor|\-\-major] [\-\-pre] [\-\-redownload] [\-\-strict] [\-\-conservative]
7
+ \fBbundle update\fR \fI*gems\fR [\-\-all] [\-\-group=NAME] [\-\-source=NAME] [\-\-local] [\-\-ruby] [\-\-bundler[=VERSION]] [\-\-force] [\-\-full\-index] [\-\-gemfile=GEMFILE] [\-\-jobs=NUMBER] [\-\-quiet] [\-\-patch|\-\-minor|\-\-major] [\-\-pre] [\-\-strict] [\-\-conservative]
8
8
  .SH "DESCRIPTION"
9
9
  Update the gems specified (all gems, if \fB\-\-all\fR flag is used), ignoring the previously installed gems specified in the \fBGemfile\.lock\fR\. In general, you should use bundle install(1) \fIbundle\-install\.1\.html\fR to install the same exact gems and versions across machines\.
10
10
  .P
@@ -29,6 +29,9 @@ Update the locked version of Ruby to the current version of Ruby\.
29
29
  \fB\-\-bundler[=BUNDLER]\fR
30
30
  Update the locked version of bundler to the invoked bundler version\.
31
31
  .TP
32
+ \fB\-\-force\fR, \fB\-\-redownload\fR
33
+ Force reinstalling every gem, even if already installed\.
34
+ .TP
32
35
  \fB\-\-full\-index\fR
33
36
  Fall back to using the single\-file index of all gems\.
34
37
  .TP
@@ -44,9 +47,6 @@ Retry failed network or git requests for \fInumber\fR times\.
44
47
  \fB\-\-quiet\fR
45
48
  Only output warnings and errors\.
46
49
  .TP
47
- \fB\-\-redownload\fR, \fB\-\-force\fR
48
- Force downloading every gem\.
49
- .TP
50
50
  \fB\-\-patch\fR
51
51
  Prefer updating only to next patch version\.
52
52
  .TP
@@ -9,13 +9,13 @@ bundle-update(1) -- Update your gems to the latest available versions
9
9
  [--local]
10
10
  [--ruby]
11
11
  [--bundler[=VERSION]]
12
+ [--force]
12
13
  [--full-index]
13
14
  [--gemfile=GEMFILE]
14
15
  [--jobs=NUMBER]
15
16
  [--quiet]
16
17
  [--patch|--minor|--major]
17
18
  [--pre]
18
- [--redownload]
19
19
  [--strict]
20
20
  [--conservative]
21
21
 
@@ -54,6 +54,9 @@ gem.
54
54
  * `--bundler[=BUNDLER]`:
55
55
  Update the locked version of bundler to the invoked bundler version.
56
56
 
57
+ * `--force`, `--redownload`:
58
+ Force reinstalling every gem, even if already installed.
59
+
57
60
  * `--full-index`:
58
61
  Fall back to using the single-file index of all gems.
59
62
 
@@ -70,9 +73,6 @@ gem.
70
73
  * `--quiet`:
71
74
  Only output warnings and errors.
72
75
 
73
- * `--redownload`, `--force`:
74
- Force downloading every gem.
75
-
76
76
  * `--patch`:
77
77
  Prefer updating only to next patch version.
78
78
 
@@ -1,6 +1,6 @@
1
1
  .\" generated with Ronn-NG/v0.10.1
2
2
  .\" http://github.com/apjanke/ronn-ng/tree/0.10.1
3
- .TH "BUNDLE\-VERSION" "1" "July 2025" ""
3
+ .TH "BUNDLE\-VERSION" "1" "August 2025" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-version\fR \- Prints Bundler version information
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with Ronn-NG/v0.10.1
2
2
  .\" http://github.com/apjanke/ronn-ng/tree/0.10.1
3
- .TH "BUNDLE\-VIZ" "1" "July 2025" ""
3
+ .TH "BUNDLE\-VIZ" "1" "August 2025" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-viz\fR \- Generates a visual dependency graph for your Gemfile
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with Ronn-NG/v0.10.1
2
2
  .\" http://github.com/apjanke/ronn-ng/tree/0.10.1
3
- .TH "BUNDLE" "1" "July 2025" ""
3
+ .TH "BUNDLE" "1" "August 2025" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\fR \- Ruby Dependency Management
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with Ronn-NG/v0.10.1
2
2
  .\" http://github.com/apjanke/ronn-ng/tree/0.10.1
3
- .TH "GEMFILE" "5" "July 2025" ""
3
+ .TH "GEMFILE" "5" "August 2025" ""
4
4
  .SH "NAME"
5
5
  \fBGemfile\fR \- A format for describing gem dependencies for Ruby programs
6
6
  .SH "SYNOPSIS"
@@ -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
@@ -272,7 +272,7 @@ module Bundler
272
272
  def use_system_gems?
273
273
  return true if system_path
274
274
  return false if explicit_path
275
- !Bundler.feature_flag.bundler_4_mode?
275
+ !Bundler.feature_flag.bundler_5_mode?
276
276
  end
277
277
 
278
278
  def base_path
@@ -10,6 +10,10 @@ module Bundler
10
10
  super
11
11
  @gemspec = options["gemspec"]
12
12
  end
13
+
14
+ def to_s
15
+ "gemspec at `#{@path}`"
16
+ end
13
17
  end
14
18
  end
15
19
  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
@@ -22,9 +22,9 @@ Gem::Specification.new do |spec|
22
22
  spec.metadata["allowed_push_host"] = "TODO: Set to your gem server 'https://example.com'"
23
23
  spec.metadata["homepage_uri"] = spec.homepage
24
24
  spec.metadata["source_code_uri"] = "<%= config[:source_code_uri] %>"
25
- <%- if config[:changelog] -%>
26
- spec.metadata["changelog_uri"] = "<%= config[:changelog_uri] %>"
27
- <%- end -%>
25
+ <%- if config[:changelog] -%>
26
+ spec.metadata["changelog_uri"] = "<%= config[:changelog_uri] %>"
27
+ <%- end -%>
28
28
 
29
29
  # Specify which files should be added to the gem when it is released.
30
30
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
@@ -242,6 +242,35 @@ class Bundler::Thor
242
242
  insert_into_file(path, *(args << config), &block)
243
243
  end
244
244
 
245
+ # Run a regular expression replacement on a file, raising an error if the
246
+ # contents of the file are not changed.
247
+ #
248
+ # ==== Parameters
249
+ # path<String>:: path of the file to be changed
250
+ # flag<Regexp|String>:: the regexp or string to be replaced
251
+ # replacement<String>:: the replacement, can be also given as a block
252
+ # config<Hash>:: give :verbose => false to not log the status, and
253
+ # :force => true, to force the replacement regardless of runner behavior.
254
+ #
255
+ # ==== Example
256
+ #
257
+ # gsub_file! 'app/controllers/application_controller.rb', /#\s*(filter_parameter_logging :password)/, '\1'
258
+ #
259
+ # gsub_file! 'README', /rake/, :green do |match|
260
+ # match << " no more. Use thor!"
261
+ # end
262
+ #
263
+ def gsub_file!(path, flag, *args, &block)
264
+ config = args.last.is_a?(Hash) ? args.pop : {}
265
+
266
+ return unless behavior == :invoke || config.fetch(:force, false)
267
+
268
+ path = File.expand_path(path, destination_root)
269
+ say_status :gsub, relative_to_original_destination_root(path), config.fetch(:verbose, true)
270
+
271
+ actually_gsub_file(path, flag, args, true, &block) unless options[:pretend]
272
+ end
273
+
245
274
  # Run a regular expression replacement on a file.
246
275
  #
247
276
  # ==== Parameters
@@ -267,11 +296,7 @@ class Bundler::Thor
267
296
  path = File.expand_path(path, destination_root)
268
297
  say_status :gsub, relative_to_original_destination_root(path), config.fetch(:verbose, true)
269
298
 
270
- unless options[:pretend]
271
- content = File.binread(path)
272
- content.gsub!(flag, *args, &block)
273
- File.open(path, "wb") { |file| file.write(content) }
274
- end
299
+ actually_gsub_file(path, flag, args, false, &block) unless options[:pretend]
275
300
  end
276
301
 
277
302
  # Uncomment all lines matching a given regex. Preserves indentation before
@@ -348,7 +373,7 @@ class Bundler::Thor
348
373
  end
349
374
 
350
375
  def with_output_buffer(buf = "".dup) #:nodoc:
351
- raise ArgumentError, "Buffer can not be a frozen object" if buf.frozen?
376
+ raise ArgumentError, "Buffer cannot be a frozen object" if buf.frozen?
352
377
  old_buffer = output_buffer
353
378
  self.output_buffer = buf
354
379
  yield
@@ -357,6 +382,17 @@ class Bundler::Thor
357
382
  self.output_buffer = old_buffer
358
383
  end
359
384
 
385
+ def actually_gsub_file(path, flag, args, error_on_no_change, &block)
386
+ content = File.binread(path)
387
+ success = content.gsub!(flag, *args, &block)
388
+
389
+ if success.nil? && error_on_no_change
390
+ raise Bundler::Thor::Error, "The content of #{path} did not change"
391
+ end
392
+
393
+ File.open(path, "wb") { |file| file.write(content) }
394
+ end
395
+
360
396
  # Bundler::Thor::Actions#capture depends on what kind of buffer is used in ERB.
361
397
  # Thus CapturableERB fixes ERB to use String buffer.
362
398
  class CapturableERB < ERB
@@ -144,7 +144,7 @@ class Bundler::Thor
144
144
  def check_exclusive!
145
145
  opts = @assigns.keys
146
146
  # When option A and B are exclusive, if A and B are given at the same time,
147
- # the diffrence of argument array size will decrease.
147
+ # the difference of argument array size will decrease.
148
148
  found = @exclusives.find{ |ex| (ex - opts).size < ex.size - 1 }
149
149
  if found
150
150
  names = names_to_switch_names(found & opts).map{|n| "'#{n}'"}
@@ -1,7 +1,6 @@
1
1
  require_relative "../thor"
2
2
  require_relative "group"
3
3
 
4
- require "yaml"
5
4
  require "digest/sha2"
6
5
  require "pathname"
7
6
 
@@ -195,6 +194,7 @@ private
195
194
  def thor_yaml
196
195
  @thor_yaml ||= begin
197
196
  yaml_file = File.join(thor_root, "thor.yml")
197
+ require "yaml"
198
198
  yaml = YAML.load_file(yaml_file) if File.exist?(yaml_file)
199
199
  yaml || {}
200
200
  end
@@ -314,7 +314,7 @@ class Bundler::Thor
314
314
  diff_cmd = ENV["THOR_DIFF"] || ENV["RAILS_DIFF"] || "diff -u"
315
315
 
316
316
  require "tempfile"
317
- Tempfile.open(File.basename(destination), File.dirname(destination)) do |temp|
317
+ Tempfile.open(File.basename(destination), File.dirname(destination), binmode: true) do |temp|
318
318
  temp.write content
319
319
  temp.rewind
320
320
  system %(#{diff_cmd} "#{destination}" "#{temp.path}")
@@ -372,16 +372,12 @@ class Bundler::Thor
372
372
  Tempfile.open([File.basename(destination), File.extname(destination)], File.dirname(destination)) do |temp|
373
373
  temp.write content
374
374
  temp.rewind
375
- system %(#{merge_tool} "#{temp.path}" "#{destination}")
375
+ system(merge_tool, temp.path, destination)
376
376
  end
377
377
  end
378
378
 
379
379
  def merge_tool #:nodoc:
380
- @merge_tool ||= ENV["THOR_MERGE"] || git_merge_tool
381
- end
382
-
383
- def git_merge_tool #:nodoc:
384
- `git config merge.tool`.rstrip rescue ""
380
+ @merge_tool ||= ENV["THOR_MERGE"] || "git difftool --no-index"
385
381
  end
386
382
  end
387
383
  end
@@ -1,3 +1,3 @@
1
1
  class Bundler::Thor
2
- VERSION = "1.3.2"
2
+ VERSION = "1.4.0"
3
3
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.7.0".freeze
4
+ VERSION = "2.7.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: 2.7.0
4
+ version: 2.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - André Arko
@@ -404,7 +404,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
404
404
  - !ruby/object:Gem::Version
405
405
  version: 3.4.1
406
406
  requirements: []
407
- rubygems_version: 3.7.0
407
+ rubygems_version: 3.7.2
408
408
  specification_version: 4
409
409
  summary: The best way to manage your application's dependencies
410
410
  test_files: []