bundler 2.5.10 → 2.5.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +48 -0
  3. data/lib/bundler/build_metadata.rb +2 -2
  4. data/lib/bundler/cli/install.rb +1 -1
  5. data/lib/bundler/cli.rb +5 -8
  6. data/lib/bundler/compact_index_client/cache.rb +47 -72
  7. data/lib/bundler/compact_index_client/parser.rb +84 -0
  8. data/lib/bundler/compact_index_client.rb +51 -80
  9. data/lib/bundler/constants.rb +8 -1
  10. data/lib/bundler/definition.rb +21 -27
  11. data/lib/bundler/errors.rb +14 -0
  12. data/lib/bundler/fetcher/compact_index.rb +15 -24
  13. data/lib/bundler/gem_helper.rb +1 -1
  14. data/lib/bundler/installer/gem_installer.rb +0 -1
  15. data/lib/bundler/installer.rb +8 -8
  16. data/lib/bundler/man/bundle-add.1 +1 -1
  17. data/lib/bundler/man/bundle-binstubs.1 +1 -1
  18. data/lib/bundler/man/bundle-cache.1 +1 -1
  19. data/lib/bundler/man/bundle-check.1 +1 -1
  20. data/lib/bundler/man/bundle-clean.1 +1 -1
  21. data/lib/bundler/man/bundle-config.1 +2 -2
  22. data/lib/bundler/man/bundle-config.1.ronn +1 -1
  23. data/lib/bundler/man/bundle-console.1 +1 -1
  24. data/lib/bundler/man/bundle-doctor.1 +1 -1
  25. data/lib/bundler/man/bundle-exec.1 +1 -1
  26. data/lib/bundler/man/bundle-gem.1 +1 -1
  27. data/lib/bundler/man/bundle-help.1 +1 -1
  28. data/lib/bundler/man/bundle-info.1 +1 -1
  29. data/lib/bundler/man/bundle-init.1 +1 -1
  30. data/lib/bundler/man/bundle-inject.1 +1 -1
  31. data/lib/bundler/man/bundle-install.1 +1 -1
  32. data/lib/bundler/man/bundle-list.1 +1 -1
  33. data/lib/bundler/man/bundle-lock.1 +1 -1
  34. data/lib/bundler/man/bundle-open.1 +1 -1
  35. data/lib/bundler/man/bundle-outdated.1 +1 -1
  36. data/lib/bundler/man/bundle-platform.1 +1 -1
  37. data/lib/bundler/man/bundle-plugin.1 +1 -1
  38. data/lib/bundler/man/bundle-pristine.1 +1 -1
  39. data/lib/bundler/man/bundle-remove.1 +1 -1
  40. data/lib/bundler/man/bundle-show.1 +1 -1
  41. data/lib/bundler/man/bundle-update.1 +1 -1
  42. data/lib/bundler/man/bundle-version.1 +1 -1
  43. data/lib/bundler/man/bundle-viz.1 +1 -1
  44. data/lib/bundler/man/bundle.1 +1 -1
  45. data/lib/bundler/man/gemfile.5 +1 -1
  46. data/lib/bundler/rubygems_ext.rb +20 -12
  47. data/lib/bundler/rubygems_integration.rb +14 -0
  48. data/lib/bundler/self_manager.rb +6 -1
  49. data/lib/bundler/settings.rb +12 -8
  50. data/lib/bundler/setup.rb +3 -0
  51. data/lib/bundler/shared_helpers.rb +6 -4
  52. data/lib/bundler/source/git/git_proxy.rb +8 -0
  53. data/lib/bundler/source/git.rb +14 -0
  54. data/lib/bundler/source/metadata.rb +2 -0
  55. data/lib/bundler/source/path.rb +0 -13
  56. data/lib/bundler/source/rubygems.rb +32 -15
  57. data/lib/bundler/source_list.rb +13 -2
  58. data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +77 -29
  59. data/lib/bundler/version.rb +1 -1
  60. data/lib/bundler/yaml_serializer.rb +1 -8
  61. data/lib/bundler.rb +6 -1
  62. metadata +4 -3
@@ -69,7 +69,6 @@ module Bundler
69
69
  @sources = sources
70
70
  @unlock = unlock
71
71
  @optional_groups = optional_groups
72
- @remote = false
73
72
  @prefer_local = false
74
73
  @specs = nil
75
74
  @ruby_version = ruby_version
@@ -164,37 +163,24 @@ module Bundler
164
163
  end
165
164
 
166
165
  def resolve_only_locally!
167
- @remote = false
168
166
  sources.local_only!
169
167
  resolve
170
168
  end
171
169
 
172
170
  def resolve_with_cache!
171
+ sources.local!
173
172
  sources.cached!
174
173
  resolve
175
174
  end
176
175
 
177
176
  def resolve_remotely!
178
- @remote = true
177
+ sources.cached!
179
178
  sources.remote!
180
179
  resolve
181
180
  end
182
181
 
183
- def resolution_mode=(options)
184
- if options["local"]
185
- @remote = false
186
- else
187
- @remote = true
188
- @prefer_local = options["prefer-local"]
189
- end
190
- end
191
-
192
- def setup_sources_for_resolve
193
- if @remote == false
194
- sources.cached!
195
- else
196
- sources.remote!
197
- end
182
+ def prefer_local!
183
+ @prefer_local = true
198
184
  end
199
185
 
200
186
  # For given dependency list returns a SpecSet with Gemspec of all the required
@@ -310,7 +296,12 @@ module Bundler
310
296
  end
311
297
  end
312
298
  else
313
- Bundler.ui.debug "Found changes from the lockfile, re-resolving dependencies because #{change_reason}"
299
+ if lockfile_exists?
300
+ Bundler.ui.debug "Found changes from the lockfile, re-resolving dependencies because #{change_reason}"
301
+ else
302
+ Bundler.ui.debug "Resolving dependencies because there's no lockfile"
303
+ end
304
+
314
305
  start_resolution
315
306
  end
316
307
  end
@@ -483,6 +474,8 @@ module Bundler
483
474
  private :sources
484
475
 
485
476
  def nothing_changed?
477
+ return false unless lockfile_exists?
478
+
486
479
  !@source_changes &&
487
480
  !@dependency_changes &&
488
481
  !@new_platform &&
@@ -587,7 +580,7 @@ module Bundler
587
580
  if missing_specs.any?
588
581
  missing_specs.each do |s|
589
582
  locked_gem = @locked_specs[s.name].last
590
- next if locked_gem.nil? || locked_gem.version != s.version || !@remote
583
+ next if locked_gem.nil? || locked_gem.version != s.version || sources.local_mode?
591
584
  raise GemNotFound, "Your bundle is locked to #{locked_gem} from #{locked_gem.source}, but that version can " \
592
585
  "no longer be found in that source. That means the author of #{locked_gem} has removed it. " \
593
586
  "You'll need to update your bundle to a version other than #{locked_gem} that hasn't been " \
@@ -606,7 +599,7 @@ module Bundler
606
599
  break if incomplete_specs.empty?
607
600
 
608
601
  Bundler.ui.debug("The lockfile does not have all gems needed for the current platform though, Bundler will still re-resolve dependencies")
609
- setup_sources_for_resolve
602
+ sources.remote!
610
603
  resolution_packages.delete(incomplete_specs)
611
604
  @resolve = start_resolution
612
605
  specs = resolve.materialize(dependencies)
@@ -631,6 +624,11 @@ module Bundler
631
624
  result = SpecSet.new(resolver.start)
632
625
 
633
626
  @resolved_bundler_version = result.find {|spec| spec.name == "bundler" }&.version
627
+
628
+ if @current_ruby_locked_platform && @current_ruby_locked_platform != local_platform
629
+ @platforms.delete(result.incomplete_for_platform?(dependencies, @current_ruby_locked_platform) ? @current_ruby_locked_platform : local_platform)
630
+ end
631
+
634
632
  @platforms = result.add_extra_platforms!(platforms) if should_add_extra_platforms?
635
633
 
636
634
  result.complete_platforms!(platforms)
@@ -657,7 +655,6 @@ module Bundler
657
655
 
658
656
  def current_ruby_platform_locked?
659
657
  return false unless generic_local_platform_is_ruby?
660
- return false if Bundler.settings[:force_ruby_platform] && !@platforms.include?(Gem::Platform::RUBY)
661
658
 
662
659
  current_platform_locked?
663
660
  end
@@ -669,7 +666,7 @@ module Bundler
669
666
  end
670
667
 
671
668
  def add_current_platform
672
- return if current_ruby_platform_locked?
669
+ @current_ruby_locked_platform = most_specific_locked_platform if current_ruby_platform_locked?
673
670
 
674
671
  add_platform(local_platform)
675
672
  end
@@ -967,7 +964,7 @@ module Bundler
967
964
  else
968
965
  { default: Source::RubygemsAggregate.new(sources, source_map) }.merge(source_map.direct_requirements)
969
966
  end
970
- source_requirements.merge!(source_map.locked_requirements) unless @remote
967
+ source_requirements.merge!(source_map.locked_requirements) if nothing_changed?
971
968
  metadata_dependencies.each do |dep|
972
969
  source_requirements[dep.name] = sources.metadata_source
973
970
  end
@@ -1038,8 +1035,6 @@ module Bundler
1038
1035
 
1039
1036
  def dup_for_full_unlock
1040
1037
  unlocked_definition = self.class.new(@lockfile, @dependencies, @sources, true, @ruby_version, @optional_groups, @gemfiles)
1041
- unlocked_definition.resolution_mode = { "local" => !@remote }
1042
- unlocked_definition.setup_sources_for_resolve
1043
1038
  unlocked_definition.gem_version_promoter.tap do |gvp|
1044
1039
  gvp.level = gem_version_promoter.level
1045
1040
  gvp.strict = gem_version_promoter.strict
@@ -1059,7 +1054,6 @@ module Bundler
1059
1054
  !@originally_locked_specs.incomplete_for_platform?(dependencies, platform)
1060
1055
 
1061
1056
  remove_platform(platform)
1062
- add_current_platform if platform == Gem::Platform::RUBY
1063
1057
  end
1064
1058
  end
1065
1059
 
@@ -230,4 +230,18 @@ module Bundler
230
230
 
231
231
  status_code(38)
232
232
  end
233
+
234
+ class CorruptBundlerInstallError < BundlerError
235
+ def initialize(loaded_spec)
236
+ @loaded_spec = loaded_spec
237
+ end
238
+
239
+ def message
240
+ "The running version of Bundler (#{Bundler::VERSION}) does not match the version of the specification installed for it (#{@loaded_spec.version}). " \
241
+ "This can be caused by reinstalling Ruby without removing previous installation, leaving around an upgraded default version of Bundler. " \
242
+ "Reinstalling Ruby from scratch should fix the problem."
243
+ end
244
+
245
+ status_code(39)
246
+ end
233
247
  end
@@ -4,8 +4,6 @@ require_relative "base"
4
4
  require_relative "../worker"
5
5
 
6
6
  module Bundler
7
- autoload :CompactIndexClient, File.expand_path("../compact_index_client", __dir__)
8
-
9
7
  class Fetcher
10
8
  class CompactIndex < Base
11
9
  def self.compact_index_request(method_name)
@@ -36,15 +34,8 @@ module Bundler
36
34
 
37
35
  until remaining_gems.empty?
38
36
  log_specs { "Looking up gems #{remaining_gems.inspect}" }
39
-
40
- deps = begin
41
- parallel_compact_index_client.dependencies(remaining_gems)
42
- rescue TooManyRequestsError
43
- @bundle_worker&.stop
44
- @bundle_worker = nil # reset it. Not sure if necessary
45
- serial_compact_index_client.dependencies(remaining_gems)
46
- end
47
- next_gems = deps.flat_map {|d| d[3].flat_map(&:first) }.uniq
37
+ deps = fetch_gem_infos(remaining_gems).flatten(1)
38
+ next_gems = deps.flat_map {|d| d[CompactIndexClient::INFO_DEPS].flat_map(&:first) }.uniq
48
39
  deps.each {|dep| gem_info << dep }
49
40
  complete_gems.concat(deps.map(&:first)).uniq!
50
41
  remaining_gems = next_gems - complete_gems
@@ -61,7 +52,7 @@ module Bundler
61
52
  return nil
62
53
  end
63
54
  # Read info file checksums out of /versions, so we can know if gems are up to date
64
- compact_index_client.update_and_parse_checksums!
55
+ compact_index_client.available?
65
56
  rescue CompactIndexClient::Updater::MismatchedChecksumError => e
66
57
  Bundler.ui.debug(e.message)
67
58
  nil
@@ -81,20 +72,20 @@ module Bundler
81
72
  end
82
73
  end
83
74
 
84
- def parallel_compact_index_client
85
- compact_index_client.execution_mode = lambda do |inputs, &blk|
86
- func = lambda {|object, _index| blk.call(object) }
87
- worker = bundle_worker(func)
88
- inputs.each {|input| worker.enq(input) }
89
- inputs.map { worker.deq }
90
- end
91
-
92
- compact_index_client
75
+ def fetch_gem_infos(names)
76
+ in_parallel(names) {|name| compact_index_client.info(name) }
77
+ rescue TooManyRequestsError # rubygems.org is rate limiting us, slow down.
78
+ @bundle_worker&.stop
79
+ @bundle_worker = nil # reset it. Not sure if necessary
80
+ compact_index_client.reset!
81
+ names.map {|name| compact_index_client.info(name) }
93
82
  end
94
83
 
95
- def serial_compact_index_client
96
- compact_index_client.sequential_execution_mode!
97
- compact_index_client
84
+ def in_parallel(inputs, &blk)
85
+ func = lambda {|object, _index| blk.call(object) }
86
+ worker = bundle_worker(func)
87
+ inputs.each {|input| worker.enq(input) }
88
+ inputs.map { worker.deq }
98
89
  end
99
90
 
100
91
  def bundle_worker(func = nil)
@@ -47,7 +47,7 @@ module Bundler
47
47
  built_gem_path = build_gem
48
48
  end
49
49
 
50
- desc "Generate SHA512 checksum if #{name}-#{version}.gem into the checksums directory."
50
+ desc "Generate SHA512 checksum of #{name}-#{version}.gem into the checksums directory."
51
51
  task "build:checksum" => "build" do
52
52
  build_checksum(built_gem_path)
53
53
  end
@@ -54,7 +54,6 @@ module Bundler
54
54
  spec.source.install(
55
55
  spec,
56
56
  force: force,
57
- ensure_builtin_gems_cached: standalone,
58
57
  build_args: Array(spec_settings),
59
58
  previous_spec: previous_spec,
60
59
  )
@@ -249,15 +249,15 @@ module Bundler
249
249
 
250
250
  # returns whether or not a re-resolve was needed
251
251
  def resolve_if_needed(options)
252
- @definition.resolution_mode = options
253
-
254
- if !@definition.unlocking? && !options["force"] && !Bundler.settings[:inline] && Bundler.default_lockfile.file?
255
- return false if @definition.nothing_changed? && !@definition.missing_specs?
252
+ @definition.prefer_local! if options["prefer-local"]
253
+
254
+ if options["local"] || (@definition.no_resolve_needed? && !@definition.missing_specs?)
255
+ @definition.resolve_with_cache!
256
+ false
257
+ else
258
+ @definition.resolve_remotely!
259
+ true
256
260
  end
257
-
258
- @definition.setup_sources_for_resolve
259
-
260
- true
261
261
  end
262
262
 
263
263
  def lock
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-ADD" "1" "April 2024" ""
3
+ .TH "BUNDLE\-ADD" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-add\fR \- Add gem to the Gemfile and run bundle install
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-BINSTUBS" "1" "April 2024" ""
3
+ .TH "BUNDLE\-BINSTUBS" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-binstubs\fR \- Install the binstubs of the listed gems
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-CACHE" "1" "April 2024" ""
3
+ .TH "BUNDLE\-CACHE" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-cache\fR \- Package your needed \fB\.gem\fR files into your application
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-CHECK" "1" "April 2024" ""
3
+ .TH "BUNDLE\-CHECK" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-check\fR \- Verifies if dependencies are satisfied by installed gems
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-CLEAN" "1" "April 2024" ""
3
+ .TH "BUNDLE\-CLEAN" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-clean\fR \- Cleans up unused gems in your bundler directory
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-CONFIG" "1" "April 2024" ""
3
+ .TH "BUNDLE\-CONFIG" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-config\fR \- Set bundler configuration options
6
6
  .SH "SYNOPSIS"
@@ -307,7 +307,7 @@ Any \fB\.\fR characters in a host name are mapped to a double underscore (\fB__\
307
307
  .P
308
308
  This means that if you have a gem server named \fBmy\.gem\-host\.com\fR, you'll need to use the \fBBUNDLE_MY__GEM___HOST__COM\fR variable to configure credentials for it through ENV\.
309
309
  .SH "CONFIGURE BUNDLER DIRECTORIES"
310
- Bundler's home, config, cache and plugin directories are able to be configured through environment variables\. The default location for Bundler's home directory is \fB~/\.bundle\fR, which all directories inherit from by default\. The following outlines the available environment variables and their default values
310
+ Bundler's home, cache and plugin directories and config file can be configured through environment variables\. The default location for Bundler's home directory is \fB~/\.bundle\fR, which all directories inherit from by default\. The following outlines the available environment variables and their default values
311
311
  .IP "" 4
312
312
  .nf
313
313
  BUNDLE_USER_HOME : $HOME/\.bundle
@@ -397,7 +397,7 @@ through ENV.
397
397
 
398
398
  ## CONFIGURE BUNDLER DIRECTORIES
399
399
 
400
- Bundler's home, config, cache and plugin directories are able to be configured
400
+ Bundler's home, cache and plugin directories and config file can be configured
401
401
  through environment variables. The default location for Bundler's home directory is
402
402
  `~/.bundle`, which all directories inherit from by default. The following
403
403
  outlines the available environment variables and their default values
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-CONSOLE" "1" "April 2024" ""
3
+ .TH "BUNDLE\-CONSOLE" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-console\fR \- Deprecated way to open an IRB session with the bundle pre\-loaded
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-DOCTOR" "1" "April 2024" ""
3
+ .TH "BUNDLE\-DOCTOR" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-doctor\fR \- Checks the bundle for common problems
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-EXEC" "1" "April 2024" ""
3
+ .TH "BUNDLE\-EXEC" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-exec\fR \- Execute a command in the context of the bundle
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-GEM" "1" "April 2024" ""
3
+ .TH "BUNDLE\-GEM" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-gem\fR \- Generate a project skeleton for creating a rubygem
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-HELP" "1" "April 2024" ""
3
+ .TH "BUNDLE\-HELP" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-help\fR \- Displays detailed help for each subcommand
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-INFO" "1" "April 2024" ""
3
+ .TH "BUNDLE\-INFO" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-info\fR \- Show information for the given gem in your bundle
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-INIT" "1" "April 2024" ""
3
+ .TH "BUNDLE\-INIT" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-init\fR \- Generates a Gemfile into the current working directory
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-INJECT" "1" "April 2024" ""
3
+ .TH "BUNDLE\-INJECT" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-inject\fR \- Add named gem(s) with version requirements to Gemfile
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-INSTALL" "1" "April 2024" ""
3
+ .TH "BUNDLE\-INSTALL" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-install\fR \- Install the dependencies specified in your Gemfile
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-LIST" "1" "April 2024" ""
3
+ .TH "BUNDLE\-LIST" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-list\fR \- List all the gems in the bundle
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-LOCK" "1" "April 2024" ""
3
+ .TH "BUNDLE\-LOCK" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-lock\fR \- Creates / Updates a lockfile without installing
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-OPEN" "1" "April 2024" ""
3
+ .TH "BUNDLE\-OPEN" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-open\fR \- Opens the source directory for a gem in your bundle
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-OUTDATED" "1" "April 2024" ""
3
+ .TH "BUNDLE\-OUTDATED" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-outdated\fR \- List installed gems with newer versions available
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-PLATFORM" "1" "April 2024" ""
3
+ .TH "BUNDLE\-PLATFORM" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-platform\fR \- Displays platform compatibility information
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-PLUGIN" "1" "April 2024" ""
3
+ .TH "BUNDLE\-PLUGIN" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-plugin\fR \- Manage Bundler plugins
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-PRISTINE" "1" "April 2024" ""
3
+ .TH "BUNDLE\-PRISTINE" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-pristine\fR \- Restores installed gems to their pristine condition
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-REMOVE" "1" "April 2024" ""
3
+ .TH "BUNDLE\-REMOVE" "1" "May 2024" ""
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 nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-SHOW" "1" "April 2024" ""
3
+ .TH "BUNDLE\-SHOW" "1" "May 2024" ""
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,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-UPDATE" "1" "April 2024" ""
3
+ .TH "BUNDLE\-UPDATE" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-update\fR \- Update your gems to the latest available versions
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-VERSION" "1" "April 2024" ""
3
+ .TH "BUNDLE\-VERSION" "1" "May 2024" ""
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 nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-VIZ" "1" "April 2024" ""
3
+ .TH "BUNDLE\-VIZ" "1" "May 2024" ""
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 nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE" "1" "April 2024" ""
3
+ .TH "BUNDLE" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\fR \- Ruby Dependency Management
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "GEMFILE" "5" "April 2024" ""
3
+ .TH "GEMFILE" "5" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBGemfile\fR \- A format for describing gem dependencies for Ruby programs
6
6
  .SH "SYNOPSIS"
@@ -1,11 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "pathname"
4
-
5
3
  require "rubygems" unless defined?(Gem)
6
4
 
7
- require "rubygems/specification"
8
-
9
5
  # We can't let `Gem::Source` be autoloaded in the `Gem::Specification#source`
10
6
  # redefinition below, so we need to load it upfront. The reason is that if
11
7
  # Bundler monkeypatches are loaded before RubyGems activates an executable (for
@@ -17,10 +13,6 @@ require "rubygems/specification"
17
13
  # `Gem::Source` from the redefined `Gem::Specification#source`.
18
14
  require "rubygems/source"
19
15
 
20
- require_relative "match_metadata"
21
- require_relative "force_platform"
22
- require_relative "match_platform"
23
-
24
16
  # Cherry-pick fixes to `Gem.ruby_version` to be useful for modern Bundler
25
17
  # versions and ignore patchlevels
26
18
  # (https://github.com/rubygems/rubygems/pull/5472,
@@ -31,7 +23,19 @@ unless Gem.ruby_version.to_s == RUBY_VERSION || RUBY_PATCHLEVEL == -1
31
23
  end
32
24
 
33
25
  module Gem
26
+ # Can be removed once RubyGems 3.5.11 support is dropped
27
+ unless Gem.respond_to?(:freebsd_platform?)
28
+ def self.freebsd_platform?
29
+ RbConfig::CONFIG["host_os"].to_s.include?("bsd")
30
+ end
31
+ end
32
+
33
+ require "rubygems/specification"
34
+
34
35
  class Specification
36
+ require_relative "match_metadata"
37
+ require_relative "match_platform"
38
+
35
39
  include ::Bundler::MatchMetadata
36
40
  include ::Bundler::MatchPlatform
37
41
 
@@ -48,7 +52,7 @@ module Gem
48
52
 
49
53
  def full_gem_path
50
54
  if source.respond_to?(:root)
51
- Pathname.new(loaded_from).dirname.expand_path(source.root).to_s
55
+ File.expand_path(File.dirname(loaded_from), source.root)
52
56
  else
53
57
  rg_full_gem_path
54
58
  end
@@ -148,17 +152,21 @@ module Gem
148
152
 
149
153
  module BetterPermissionError
150
154
  def data
151
- Bundler::SharedHelpers.filesystem_access(loaded_from, :read) do
152
- super
153
- end
155
+ super
156
+ rescue Errno::EACCES
157
+ raise Bundler::PermissionError.new(loaded_from, :read)
154
158
  end
155
159
  end
156
160
 
161
+ require "rubygems/stub_specification"
162
+
157
163
  class StubSpecification
158
164
  prepend BetterPermissionError
159
165
  end
160
166
 
161
167
  class Dependency
168
+ require_relative "force_platform"
169
+
162
170
  include ::Bundler::ForcePlatform
163
171
 
164
172
  attr_accessor :source, :groups