bundler 2.4.18 → 2.4.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/lib/bundler/build_metadata.rb +2 -2
  4. data/lib/bundler/cli/binstubs.rb +1 -1
  5. data/lib/bundler/cli/info.rb +1 -1
  6. data/lib/bundler/cli/install.rb +1 -1
  7. data/lib/bundler/cli/outdated.rb +1 -1
  8. data/lib/bundler/cli/platform.rb +7 -5
  9. data/lib/bundler/definition.rb +25 -20
  10. data/lib/bundler/dsl.rb +1 -1
  11. data/lib/bundler/env.rb +1 -1
  12. data/lib/bundler/fetcher/compact_index.rb +3 -3
  13. data/lib/bundler/fetcher/downloader.rb +2 -0
  14. data/lib/bundler/fetcher/index.rb +1 -2
  15. data/lib/bundler/fetcher.rb +11 -1
  16. data/lib/bundler/friendly_errors.rb +1 -1
  17. data/lib/bundler/gem_helper.rb +3 -4
  18. data/lib/bundler/installer/parallel_installer.rb +1 -1
  19. data/lib/bundler/man/bundle-add.1 +1 -1
  20. data/lib/bundler/man/bundle-binstubs.1 +1 -1
  21. data/lib/bundler/man/bundle-cache.1 +1 -1
  22. data/lib/bundler/man/bundle-check.1 +1 -1
  23. data/lib/bundler/man/bundle-clean.1 +1 -1
  24. data/lib/bundler/man/bundle-config.1 +1 -1
  25. data/lib/bundler/man/bundle-console.1 +1 -1
  26. data/lib/bundler/man/bundle-doctor.1 +1 -1
  27. data/lib/bundler/man/bundle-exec.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 +3 -3
  31. data/lib/bundler/man/bundle-info.1.ronn +3 -3
  32. data/lib/bundler/man/bundle-init.1 +1 -1
  33. data/lib/bundler/man/bundle-inject.1 +1 -1
  34. data/lib/bundler/man/bundle-install.1 +1 -1
  35. data/lib/bundler/man/bundle-list.1 +1 -1
  36. data/lib/bundler/man/bundle-lock.1 +1 -1
  37. data/lib/bundler/man/bundle-open.1 +1 -1
  38. data/lib/bundler/man/bundle-outdated.1 +1 -1
  39. data/lib/bundler/man/bundle-platform.1 +1 -1
  40. data/lib/bundler/man/bundle-plugin.1 +1 -1
  41. data/lib/bundler/man/bundle-pristine.1 +1 -1
  42. data/lib/bundler/man/bundle-remove.1 +1 -1
  43. data/lib/bundler/man/bundle-show.1 +1 -1
  44. data/lib/bundler/man/bundle-update.1 +1 -1
  45. data/lib/bundler/man/bundle-version.1 +1 -1
  46. data/lib/bundler/man/bundle-viz.1 +1 -1
  47. data/lib/bundler/man/bundle.1 +1 -1
  48. data/lib/bundler/man/gemfile.5 +14 -1
  49. data/lib/bundler/man/gemfile.5.ronn +5 -0
  50. data/lib/bundler/plugin/index.rb +1 -1
  51. data/lib/bundler/ruby_dsl.rb +6 -0
  52. data/lib/bundler/ruby_version.rb +2 -2
  53. data/lib/bundler/rubygems_integration.rb +1 -1
  54. data/lib/bundler/source/git.rb +7 -0
  55. data/lib/bundler/source_list.rb +0 -4
  56. data/lib/bundler/ui/rg_proxy.rb +1 -1
  57. data/lib/bundler/version.rb +1 -1
  58. data/lib/bundler.rb +1 -1
  59. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 534916a6124778247986f23f06f157b5f39564180b51361d3939265579a3ddd1
4
- data.tar.gz: f54fbf6640be1d86c63ca174873133a163a58cb3a48d4f382695bbf36ff1c959
3
+ metadata.gz: a9e1ac32a1ea746c717048bdfc433edc9d61cd2184f6d07b24e6addb565c1693
4
+ data.tar.gz: 95ab89a536022f9c642dd02683640819134441441dd0c4ae7b1cb0e9dd561a68
5
5
  SHA512:
6
- metadata.gz: 0fee4fe07803ddf54fae1e1a0ff9cc04478ddc0180b1ace6ff43cac7183965e7478b7c580e36c34abc42cf2dc7dc581560900e3b4430cc5fd31b5faf986b2ccc
7
- data.tar.gz: 1245868925e6075dd7f1f93c66774fbefd4b25b47c5102cf101b5db561cc802723308c7064bc186f7e89beb6ab7c1aa59a234e81de113dbda529e99f515a05d4
6
+ metadata.gz: 1cda1a2dfbdf88aaf7627304dc8fc740d3e4343b6d4f0e97a6473dc168b3b78c1128973251625beeee479a0418c25972f7dedb0cbcc9e107666fcdad32c991c8
7
+ data.tar.gz: e4589afe5650d8a937a2c56196221db8ce72d8cb91539ca0fceb9ad742d542ab4415b5253e6ffa3c8b03ccaac3dc6e8fe3b25d61cb17cd9155cc50d16dc44d4c
data/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ # 2.4.19 (August 17, 2023)
2
+
3
+ ## Enhancements:
4
+
5
+ - Add `file` option to `ruby` method in Gemfile [#6876](https://github.com/rubygems/rubygems/pull/6876)
6
+ - Show better error when PAT can't authenticate to a private server [#6871](https://github.com/rubygems/rubygems/pull/6871)
7
+ - Don't fallback to old dependency API when bad credentials are configured [#6869](https://github.com/rubygems/rubygems/pull/6869)
8
+
9
+ ## Bug fixes:
10
+
11
+ - Fix git source conservativeness [#6850](https://github.com/rubygems/rubygems/pull/6850)
12
+
13
+ ## Documentation:
14
+
15
+ - Clarify that `bundle info` takes a gem name [#6875](https://github.com/rubygems/rubygems/pull/6875)
16
+
1
17
  # 2.4.18 (August 2, 2023)
2
18
 
3
19
  ## Security:
@@ -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 = "2023-08-02".freeze
8
- @git_commit_sha = "d2e3d8e3f4".freeze
7
+ @built_at = "2023-08-17".freeze
8
+ @git_commit_sha = "86f98098e3".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -11,7 +11,7 @@ module Bundler
11
11
  def run
12
12
  Bundler.definition.validate_runtime!
13
13
  path_option = options["path"]
14
- path_option = nil if path_option && path_option.empty?
14
+ path_option = nil if path_option&.empty?
15
15
  Bundler.settings.set_command_option :bin, path_option if options["path"]
16
16
  Bundler.settings.set_command_option_if_given :shebang, options["shebang"]
17
17
  installer = Installer.new(Bundler.root, Bundler.definition)
@@ -33,7 +33,7 @@ module Bundler
33
33
  def default_gem_spec(gem_name)
34
34
  return unless Gem::Specification.respond_to?(:find_all_by_name)
35
35
  gem_spec = Gem::Specification.find_all_by_name(gem_name).last
36
- return gem_spec if gem_spec && gem_spec.respond_to?(:default_gem?) && gem_spec.default_gem?
36
+ return gem_spec if gem_spec&.default_gem?
37
37
  end
38
38
 
39
39
  def spec_not_found(gem_name)
@@ -154,7 +154,7 @@ module Bundler
154
154
  end
155
155
 
156
156
  bin_option = options["binstubs"]
157
- bin_option = nil if bin_option && bin_option.empty?
157
+ bin_option = nil if bin_option&.empty?
158
158
  Bundler.settings.set_command_option :bin, bin_option if options["binstubs"]
159
159
 
160
160
  Bundler.settings.set_command_option_if_given :shebang, options["shebang"]
@@ -194,7 +194,7 @@ module Bundler
194
194
  end
195
195
  current_version = "#{current_spec.version}#{current_spec.git_version}"
196
196
 
197
- if dependency && dependency.specific?
197
+ if dependency&.specific?
198
198
  dependency_version = %(, requested #{dependency.requirement})
199
199
  end
200
200
 
@@ -8,12 +8,12 @@ module Bundler
8
8
  end
9
9
 
10
10
  def run
11
- platforms, ruby_version = Bundler.ui.silence do
12
- locked_ruby_version = Bundler.locked_gems && Bundler.locked_gems.ruby_version&.gsub(/p\d+\Z/, "")
13
- gemfile_ruby_version = Bundler.definition.ruby_version && Bundler.definition.ruby_version.single_version_string
14
- [Bundler.definition.platforms.map {|p| "* #{p}" },
15
- locked_ruby_version || gemfile_ruby_version]
11
+ ruby_version = if Bundler.locked_gems
12
+ Bundler.locked_gems.ruby_version&.gsub(/p\d+\Z/, "")
13
+ else
14
+ Bundler.definition.ruby_version&.single_version_string
16
15
  end
16
+
17
17
  output = []
18
18
 
19
19
  if options[:ruby]
@@ -23,6 +23,8 @@ module Bundler
23
23
  output << "No ruby version specified"
24
24
  end
25
25
  else
26
+ platforms = Bundler.definition.platforms.map {|p| "* #{p}" }
27
+
26
28
  output << "Your platform is: #{Gem::Platform.local}"
27
29
  output << "Your app has gems that work on these platforms:\n#{platforms.join("\n")}"
28
30
 
@@ -390,8 +390,8 @@ module Bundler
390
390
  both_sources.each do |name, (dep, lock_dep)|
391
391
  next if dep.nil? || lock_dep.nil?
392
392
 
393
- gemfile_source = dep.source || sources.default_source
394
- lock_source = lock_dep.source || sources.default_source
393
+ gemfile_source = dep.source || default_source
394
+ lock_source = lock_dep.source || default_source
395
395
  next if lock_source.include?(gemfile_source)
396
396
 
397
397
  gemfile_source_name = dep.source ? gemfile_source.to_gemfile : "no specified source"
@@ -671,8 +671,8 @@ module Bundler
671
671
 
672
672
  Bundler.settings.local_overrides.map do |k, v|
673
673
  spec = @dependencies.find {|s| s.name == k }
674
- source = spec && spec.source
675
- if source && source.respond_to?(:local_override!)
674
+ source = spec&.source
675
+ if source&.respond_to?(:local_override!)
676
676
  source.unlock! if @unlock[:gems].include?(spec.name)
677
677
  locals << [source, source.local_override!(v)]
678
678
  end
@@ -805,26 +805,27 @@ module Bundler
805
805
 
806
806
  def converge_specs(specs)
807
807
  converged = []
808
-
809
- deps = @dependencies.select do |dep|
810
- specs[dep].any? {|s| s.satisfies?(dep) && (!dep.source || s.source.include?(dep.source)) }
811
- end
808
+ deps = []
812
809
 
813
810
  @specs_that_changed_sources = []
814
811
 
815
812
  specs.each do |s|
813
+ name = s.name
816
814
  dep = @dependencies.find {|d| s.satisfies?(d) }
815
+ lockfile_source = s.source
817
816
 
818
- # Replace the locked dependency's source with the equivalent source from the Gemfile
819
- s.source = if dep && dep.source
820
- gemfile_source = dep.source
821
- lockfile_source = s.source
817
+ if dep
818
+ gemfile_source = dep.source || default_source
822
819
 
823
820
  @specs_that_changed_sources << s if gemfile_source != lockfile_source
821
+ deps << dep if !dep.source || lockfile_source.include?(dep.source)
822
+ @unlock[:gems] << name if lockfile_source.include?(dep.source) && lockfile_source != gemfile_source
824
823
 
825
- gemfile_source
824
+ # Replace the locked dependency's source with the equivalent source from the Gemfile
825
+ s.source = gemfile_source
826
826
  else
827
- sources.get_with_fallback(s.source)
827
+ # Replace the locked dependency's source with the default source, if the locked source is no longer in the Gemfile
828
+ s.source = default_source unless sources.get(lockfile_source)
828
829
  end
829
830
 
830
831
  next if @unlock[:sources].include?(s.source.name)
@@ -833,9 +834,9 @@ module Bundler
833
834
  if s.source.instance_of?(Source::Path) || s.source.instance_of?(Source::Gemspec)
834
835
  new_specs = begin
835
836
  s.source.specs
836
- rescue PathError, GitError
837
+ rescue PathError
837
838
  # if we won't need the source (according to the lockfile),
838
- # don't error if the path/git source isn't available
839
+ # don't error if the path source isn't available
839
840
  next if specs.
840
841
  for(requested_dependencies, false).
841
842
  none? {|locked_spec| locked_spec.source == s.source }
@@ -849,11 +850,11 @@ module Bundler
849
850
  else
850
851
  # If the spec is no longer in the path source, unlock it. This
851
852
  # commonly happens if the version changed in the gemspec
852
- @unlock[:gems] << s.name
853
+ @unlock[:gems] << name
853
854
  end
854
855
  end
855
856
 
856
- if dep.nil? && requested_dependencies.find {|d| s.name == d.name }
857
+ if dep.nil? && requested_dependencies.find {|d| name == d.name }
857
858
  @unlock[:gems] << s.name
858
859
  else
859
860
  converged << s
@@ -877,7 +878,7 @@ module Bundler
877
878
  source_requirements = if precompute_source_requirements_for_indirect_dependencies?
878
879
  all_requirements = source_map.all_requirements
879
880
  all_requirements = pin_locally_available_names(all_requirements) if @prefer_local
880
- { :default => sources.default_source }.merge(all_requirements)
881
+ { :default => default_source }.merge(all_requirements)
881
882
  else
882
883
  { :default => Source::RubygemsAggregate.new(sources, source_map) }.merge(source_map.direct_requirements)
883
884
  end
@@ -886,7 +887,7 @@ module Bundler
886
887
  source_requirements[dep.name] = sources.metadata_source
887
888
  end
888
889
 
889
- default_bundler_source = source_requirements["bundler"] || sources.default_source
890
+ default_bundler_source = source_requirements["bundler"] || default_source
890
891
 
891
892
  if @unlocking_bundler
892
893
  default_bundler_source.add_dependency_names("bundler")
@@ -899,6 +900,10 @@ module Bundler
899
900
  source_requirements
900
901
  end
901
902
 
903
+ def default_source
904
+ sources.default_source
905
+ end
906
+
902
907
  def verify_changed_sources!
903
908
  @specs_that_changed_sources.each do |s|
904
909
  if s.source.specs.search(s.name).empty?
data/lib/bundler/dsl.rb CHANGED
@@ -41,7 +41,7 @@ module Bundler
41
41
  end
42
42
 
43
43
  def eval_gemfile(gemfile, contents = nil)
44
- expanded_gemfile_path = Pathname.new(gemfile).expand_path(@gemfile && @gemfile.parent)
44
+ expanded_gemfile_path = Pathname.new(gemfile).expand_path(@gemfile&.parent)
45
45
  original_gemfile = @gemfile
46
46
  @gemfile = expanded_gemfile_path
47
47
  @gemfiles << expanded_gemfile_path
data/lib/bundler/env.rb CHANGED
@@ -122,7 +122,7 @@ module Bundler
122
122
  specs = Bundler.rubygems.find_name(name)
123
123
  out << [" #{name}", "(#{specs.map(&:version).join(",")})"] unless specs.empty?
124
124
  end
125
- if (exe = caller.last.split(":").first) && exe =~ %r{(exe|bin)/bundler?\z}
125
+ if (exe = caller.last.split(":").first)&.match? %r{(exe|bin)/bundler?\z}
126
126
  shebang = File.read(exe).lines.first
127
127
  shebang.sub!(/^#!\s*/, "")
128
128
  unless shebang.start_with?(Gem.ruby, "/usr/bin/env ruby")
@@ -15,7 +15,7 @@ module Bundler
15
15
  method.bind(self).call(*args, &blk)
16
16
  rescue NetworkDownError, CompactIndexClient::Updater::MisMatchedChecksumError => e
17
17
  raise HTTPError, e.message
18
- rescue AuthenticationRequiredError
18
+ rescue AuthenticationRequiredError, BadAuthenticationError
19
19
  # Fail since we got a 401 from the server.
20
20
  raise
21
21
  rescue HTTPError => e
@@ -40,7 +40,7 @@ module Bundler
40
40
  deps = begin
41
41
  parallel_compact_index_client.dependencies(remaining_gems)
42
42
  rescue TooManyRequestsError
43
- @bundle_worker.stop if @bundle_worker
43
+ @bundle_worker&.stop
44
44
  @bundle_worker = nil # reset it. Not sure if necessary
45
45
  serial_compact_index_client.dependencies(remaining_gems)
46
46
  end
@@ -49,7 +49,7 @@ module Bundler
49
49
  complete_gems.concat(deps.map(&:first)).uniq!
50
50
  remaining_gems = next_gems - complete_gems
51
51
  end
52
- @bundle_worker.stop if @bundle_worker
52
+ @bundle_worker&.stop
53
53
  @bundle_worker = nil # reset it. Not sure if necessary
54
54
 
55
55
  gem_info
@@ -41,6 +41,8 @@ module Bundler
41
41
  when Net::HTTPUnauthorized
42
42
  raise BadAuthenticationError, uri.host if uri.userinfo
43
43
  raise AuthenticationRequiredError, uri.host
44
+ when Net::HTTPForbidden
45
+ raise AuthenticationForbiddenError, uri.host
44
46
  when Net::HTTPNotFound
45
47
  raise FallbackError, "Net::HTTPNotFound: #{filtered_uri}"
46
48
  else
@@ -15,8 +15,7 @@ module Bundler
15
15
  raise BadAuthenticationError, remote_uri if remote_uri.userinfo
16
16
  raise AuthenticationRequiredError, remote_uri
17
17
  when /403/
18
- raise BadAuthenticationError, remote_uri if remote_uri.userinfo
19
- raise AuthenticationRequiredError, remote_uri
18
+ raise AuthenticationForbiddenError, remote_uri
20
19
  else
21
20
  raise HTTPError, "Could not fetch specs from #{display_uri} due to underlying error <#{e.message}>"
22
21
  end
@@ -61,6 +61,16 @@ module Bundler
61
61
  end
62
62
  end
63
63
 
64
+ # This error is raised if HTTP authentication is correct, but lacks
65
+ # necessary permissions.
66
+ class AuthenticationForbiddenError < HTTPError
67
+ def initialize(remote_uri)
68
+ remote_uri = filter_uri(remote_uri)
69
+ super "Access token could not be authenticated for #{remote_uri}.\n" \
70
+ "Make sure it's valid and has the necessary scopes configured."
71
+ end
72
+ end
73
+
64
74
  # Exceptions classes that should bypass retry attempts. If your password didn't work the
65
75
  # first time, it's not going to the third time.
66
76
  NET_ERRORS = [:HTTPBadGateway, :HTTPBadRequest, :HTTPFailedDependency,
@@ -70,7 +80,7 @@ module Bundler
70
80
  :HTTPRequestURITooLong, :HTTPUnauthorized, :HTTPUnprocessableEntity,
71
81
  :HTTPUnsupportedMediaType, :HTTPVersionNotSupported].freeze
72
82
  FAIL_ERRORS = begin
73
- fail_errors = [AuthenticationRequiredError, BadAuthenticationError, FallbackError]
83
+ fail_errors = [AuthenticationRequiredError, BadAuthenticationError, AuthenticationForbiddenError, FallbackError]
74
84
  fail_errors << Gem::Requirement::BadRequirementError
75
85
  fail_errors.concat(NET_ERRORS.map {|e| Net.const_get(e) })
76
86
  end.freeze
@@ -95,7 +95,7 @@ module Bundler
95
95
  def serialized_exception_for(e)
96
96
  <<-EOS.gsub(/^ {8}/, "")
97
97
  #{e.class}: #{e.message}
98
- #{e.backtrace && e.backtrace.join("\n ").chomp}
98
+ #{e.backtrace&.join("\n ")&.chomp}
99
99
  EOS
100
100
  end
101
101
 
@@ -21,7 +21,7 @@ module Bundler
21
21
 
22
22
  def gemspec(&block)
23
23
  gemspec = instance.gemspec
24
- block.call(gemspec) if block
24
+ block&.call(gemspec)
25
25
  gemspec
26
26
  end
27
27
  end
@@ -152,8 +152,7 @@ module Bundler
152
152
 
153
153
  def gem_push_host
154
154
  env_rubygems_host = ENV["RUBYGEMS_HOST"]
155
- env_rubygems_host = nil if
156
- env_rubygems_host && env_rubygems_host.empty?
155
+ env_rubygems_host = nil if env_rubygems_host&.empty?
157
156
 
158
157
  allowed_push_host || env_rubygems_host || "rubygems.org"
159
158
  end
@@ -218,7 +217,7 @@ module Bundler
218
217
  SharedHelpers.chdir(base) do
219
218
  outbuf = IO.popen(cmd, :err => [:child, :out], &:read)
220
219
  status = $?
221
- block.call(outbuf) if status.success? && block
220
+ block&.call(outbuf) if status.success?
222
221
  [outbuf, status]
223
222
  end
224
223
  end
@@ -96,7 +96,7 @@ module Bundler
96
96
  handle_error if failed_specs.any?
97
97
  @specs
98
98
  ensure
99
- worker_pool && worker_pool.stop
99
+ worker_pool&.stop
100
100
  end
101
101
 
102
102
  def check_for_unmet_dependencies
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-ADD" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-ADD" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-add\fR \- Add gem to the Gemfile and run bundle install
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-BINSTUBS" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-BINSTUBS" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-binstubs\fR \- Install the binstubs of the listed gems
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-CACHE" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-CACHE" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-cache\fR \- Package your needed \fB\.gem\fR files into your application
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-CHECK" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-CHECK" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-check\fR \- Verifies if dependencies are satisfied by installed gems
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-CLEAN" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-CLEAN" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-clean\fR \- Cleans up unused gems in your bundler directory
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-CONFIG" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-CONFIG" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-config\fR \- Set bundler configuration options
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-CONSOLE" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-CONSOLE" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-console\fR \- Deprecated way to open an IRB session with the bundle pre\-loaded
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-DOCTOR" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-DOCTOR" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-doctor\fR \- Checks the bundle for common problems
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-EXEC" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-EXEC" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-exec\fR \- Execute a command in the context of the bundle
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-GEM" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-GEM" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-gem\fR \- Generate a project skeleton for creating a rubygem
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-HELP" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-HELP" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-help\fR \- Displays detailed help for each subcommand
@@ -1,16 +1,16 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-INFO" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-INFO" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-info\fR \- Show information for the given gem in your bundle
8
8
  .
9
9
  .SH "SYNOPSIS"
10
- \fBbundle info\fR [GEM] [\-\-path]
10
+ \fBbundle info\fR [GEM_NAME] [\-\-path]
11
11
  .
12
12
  .SH "DESCRIPTION"
13
- Print the basic information about the provided GEM such as homepage, version, path and summary\.
13
+ Given a gem name present in your bundle, print the basic information about it such as homepage, version, path and summary\.
14
14
  .
15
15
  .SH "OPTIONS"
16
16
  .
@@ -3,13 +3,13 @@ bundle-info(1) -- Show information for the given gem in your bundle
3
3
 
4
4
  ## SYNOPSIS
5
5
 
6
- `bundle info` [GEM]
6
+ `bundle info` [GEM_NAME]
7
7
  [--path]
8
8
 
9
9
  ## DESCRIPTION
10
10
 
11
- Print the basic information about the provided GEM such as homepage, version,
12
- path and summary.
11
+ Given a gem name present in your bundle, print the basic information about it
12
+ such as homepage, version, path and summary.
13
13
 
14
14
  ## OPTIONS
15
15
 
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-INIT" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-INIT" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-init\fR \- Generates a Gemfile into the current working directory
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-INJECT" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-INJECT" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-inject\fR \- Add named gem(s) with version requirements to Gemfile
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-INSTALL" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-INSTALL" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-install\fR \- Install the dependencies specified in your Gemfile
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-LIST" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-LIST" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-list\fR \- List all the gems in the bundle
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-LOCK" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-LOCK" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-lock\fR \- Creates / Updates a lockfile without installing
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-OPEN" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-OPEN" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-open\fR \- Opens the source directory for a gem in your bundle
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-OUTDATED" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-OUTDATED" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-outdated\fR \- List installed gems with newer versions available
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-PLATFORM" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-PLATFORM" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-platform\fR \- Displays platform compatibility information
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-PLUGIN" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-PLUGIN" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-plugin\fR \- Manage Bundler plugins
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-PRISTINE" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-PRISTINE" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-pristine\fR \- Restores installed gems to their pristine condition
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-REMOVE" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-REMOVE" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-remove\fR \- Removes gems from the Gemfile
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-SHOW" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-SHOW" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-show\fR \- Shows all the gems in your bundle, or the path to a gem
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-UPDATE" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-UPDATE" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-update\fR \- Update your gems to the latest available versions
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-VERSION" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-VERSION" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-version\fR \- Prints Bundler version information
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-VIZ" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-VIZ" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-viz\fR \- Generates a visual dependency graph for your Gemfile
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE" "1" "July 2023" "" ""
4
+ .TH "BUNDLE" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\fR \- Ruby Dependency Management
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "GEMFILE" "5" "July 2023" "" ""
4
+ .TH "GEMFILE" "5" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBGemfile\fR \- A format for describing gem dependencies for Ruby programs
@@ -85,6 +85,19 @@ ruby "3\.1\.2"
85
85
  .
86
86
  .IP "" 0
87
87
  .
88
+ .P
89
+ If you wish to derive your Ruby version from a version file (ie \.ruby\-version), you can use the \fBfile\fR option instead\.
90
+ .
91
+ .IP "" 4
92
+ .
93
+ .nf
94
+
95
+ ruby file: "\.ruby\-version"
96
+ .
97
+ .fi
98
+ .
99
+ .IP "" 0
100
+ .
88
101
  .SS "ENGINE"
89
102
  Each application \fImay\fR specify a Ruby engine\. If an engine is specified, an engine version \fImust\fR also be specified\.
90
103
  .
@@ -69,6 +69,11 @@ should be the Ruby version that the engine is compatible with.
69
69
 
70
70
  ruby "3.1.2"
71
71
 
72
+ If you wish to derive your Ruby version from a version file (ie .ruby-version),
73
+ you can use the `file` option instead.
74
+
75
+ ruby file: ".ruby-version"
76
+
72
77
  ### ENGINE
73
78
 
74
79
  Each application _may_ specify a Ruby engine. If an engine is specified, an
@@ -146,7 +146,7 @@ module Bundler
146
146
  # @param [Boolean] is the index file global index
147
147
  def load_index(index_file, global = false)
148
148
  SharedHelpers.filesystem_access(index_file, :read) do |index_f|
149
- valid_file = index_f && index_f.exist? && !index_f.size.zero?
149
+ valid_file = index_f&.exist? && !index_f.size.zero?
150
150
  break unless valid_file
151
151
 
152
152
  data = index_f.read
@@ -5,9 +5,15 @@ module Bundler
5
5
  def ruby(*ruby_version)
6
6
  options = ruby_version.last.is_a?(Hash) ? ruby_version.pop : {}
7
7
  ruby_version.flatten!
8
+
8
9
  raise GemfileError, "Please define :engine_version" if options[:engine] && options[:engine_version].nil?
9
10
  raise GemfileError, "Please define :engine" if options[:engine_version] && options[:engine].nil?
10
11
 
12
+ if options[:file]
13
+ raise GemfileError, "Cannot specify version when using the file option" if ruby_version.any?
14
+ ruby_version << Bundler.read_file(options[:file]).strip
15
+ end
16
+
11
17
  if options[:engine] == "ruby" && options[:engine_version] &&
12
18
  ruby_version != Array(options[:engine_version])
13
19
  raise GemfileEvalError, "ruby_version must match the :engine_version for MRI"
@@ -28,8 +28,8 @@ module Bundler
28
28
  end
29
29
 
30
30
  @gem_version = Gem::Requirement.create(@versions.first).requirements.first.last
31
- @input_engine = engine && engine.to_s
32
- @engine = engine && engine.to_s || "ruby"
31
+ @input_engine = engine&.to_s
32
+ @engine = engine&.to_s || "ruby"
33
33
  @engine_versions = (engine_version && Array(engine_version)) || @versions
34
34
  @engine_gem_version = Gem::Requirement.create(@engine_versions.first).requirements.first.last
35
35
  @patchlevel = patchlevel || (@gem_version.prerelease? ? "-1" : nil)
@@ -247,7 +247,7 @@ module Bundler
247
247
  kernel = (class << ::Kernel; self; end)
248
248
  [kernel, ::Kernel].each do |kernel_class|
249
249
  redefine_method(kernel_class, :gem) do |dep, *reqs|
250
- if executables && executables.include?(File.basename(caller.first.split(":").first))
250
+ if executables&.include?(File.basename(caller.first.split(":").first))
251
251
  break
252
252
  end
253
253
 
@@ -67,6 +67,13 @@ module Bundler
67
67
 
68
68
  alias_method :==, :eql?
69
69
 
70
+ def include?(other)
71
+ other.is_a?(Git) && uri == other.uri &&
72
+ name == other.name &&
73
+ glob == other.glob &&
74
+ submodules == other.submodules
75
+ end
76
+
70
77
  def to_s
71
78
  begin
72
79
  at = humanized_ref || current_branch
@@ -101,10 +101,6 @@ module Bundler
101
101
  source_list_for(source).find {|s| equivalent_source?(source, s) }
102
102
  end
103
103
 
104
- def get_with_fallback(source)
105
- get(source) || default_source
106
- end
107
-
108
104
  def lock_sources
109
105
  lock_other_sources + lock_rubygems_sources
110
106
  end
@@ -12,7 +12,7 @@ module Bundler
12
12
  end
13
13
 
14
14
  def say(message)
15
- @ui && @ui.debug(message)
15
+ @ui&.debug(message)
16
16
  end
17
17
  end
18
18
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.4.18".freeze
4
+ VERSION = "2.4.19".freeze
5
5
 
6
6
  def self.bundler_major_version
7
7
  @bundler_major_version ||= VERSION.split(".").first.to_i
data/lib/bundler.rb CHANGED
@@ -524,7 +524,7 @@ EOF
524
524
  @gemspec_cache[key] ||= load_gemspec_uncached(file, validate)
525
525
  # Protect against caching side-effected gemspecs by returning a
526
526
  # new instance each time.
527
- @gemspec_cache[key].dup if @gemspec_cache[key]
527
+ @gemspec_cache[key]&.dup
528
528
  end
529
529
 
530
530
  def load_gemspec_uncached(file, validate = false)
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.4.18
4
+ version: 2.4.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - André Arko
@@ -22,7 +22,7 @@ authors:
22
22
  autorequire:
23
23
  bindir: exe
24
24
  cert_chain: []
25
- date: 2023-08-02 00:00:00.000000000 Z
25
+ date: 2023-08-17 00:00:00.000000000 Z
26
26
  dependencies: []
27
27
  description: Bundler manages an application's dependencies through its entire life,
28
28
  across many machines, systematically and repeatably
@@ -381,7 +381,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
381
381
  - !ruby/object:Gem::Version
382
382
  version: 3.0.1
383
383
  requirements: []
384
- rubygems_version: 3.4.18
384
+ rubygems_version: 3.4.19
385
385
  signing_key:
386
386
  specification_version: 4
387
387
  summary: The best way to manage your application's dependencies