bundler 2.3.9 → 2.3.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ca4612ca3c9f9acd51a52eec231ee4e24ef8ad71d1969ac3c13c838b2b0e6e02
4
- data.tar.gz: f46c141021cf42282aeb235f781435ade45c2e29aea19275678d81cfa85beace
3
+ metadata.gz: 489c8d7661dcb4d99b7990a44d02dc883d10e31adb0297fa09f52ff502424e63
4
+ data.tar.gz: d050d525313844234ca93b7c879f7582ff2d0e0a334f33b706bc67039e8511b5
5
5
  SHA512:
6
- metadata.gz: 759454ffe3fd64d2f408166aceb9a37935a35513ccfb6870bee2280769e382ebadb09709069b82ebdd971bbb4c99a59372673a6ba0960c13a157b70e2f7afe4a
7
- data.tar.gz: b5291cdc8f5c842f1e7a11a6b2ca86981b7222f7d52457e4ce0121c5526e786aecae09b435e76d088b02bebf13b948688a9509e03639e6f6b656657ea5d9bdcb
6
+ metadata.gz: 853c3263abfbf6296e2256a5ea8df6860fe71591b25d3c5087839c9c0a0e5b7787b5696e621becb4c825f1429bc6fb1c07ca9b6b87f508910415ff23d2c05015
7
+ data.tar.gz: e4fe33afda4a3c4ab8ea8b3e6ba458fc335cc76443d1062a674be0093fb87b25dd37c310e53d0c00dca3417c2e20c89c5f4e72b03000e897d4136758ccc2e210
data/CHANGELOG.md CHANGED
@@ -1,3 +1,30 @@
1
+ # 2.3.12 (April 20, 2022)
2
+
3
+ ## Enhancements:
4
+
5
+ - Improve Ruby version resolution conflicts [#5474](https://github.com/rubygems/rubygems/pull/5474)
6
+ - Stop considering `RUBY_PATCHLEVEL` for resolution [#5472](https://github.com/rubygems/rubygems/pull/5472)
7
+ - Add modern rubies as valid platform values in Gemfile DSL [#5469](https://github.com/rubygems/rubygems/pull/5469)
8
+
9
+ # 2.3.11 (April 7, 2022)
10
+
11
+ ## Enhancements:
12
+
13
+ - Bump actions/checkout to 3 in bundler gem template [#5445](https://github.com/rubygems/rubygems/pull/5445)
14
+ - Prefer `__dir__` to `__FILE__` [#5444](https://github.com/rubygems/rubygems/pull/5444)
15
+
16
+ ## Documentation:
17
+
18
+ - Update bundler documentation to reflect bundle config scope changes [#5441](https://github.com/rubygems/rubygems/pull/5441)
19
+
20
+ # 2.3.10 (March 23, 2022)
21
+
22
+ ## Enhancements:
23
+
24
+ - More helpful reporting of marshal loading issues [#5416](https://github.com/rubygems/rubygems/pull/5416)
25
+ - Report Github Actions CI provider within user agent string [#5400](https://github.com/rubygems/rubygems/pull/5400)
26
+ - Remove extra closing bracket in version warning [#5397](https://github.com/rubygems/rubygems/pull/5397)
27
+
1
28
  # 2.3.9 (March 9, 2022)
2
29
 
3
30
  ## Enhancements:
data/exe/bundle CHANGED
@@ -20,7 +20,7 @@ gem "bundler", Bundler::VERSION if Gem.rubygems_version < Gem::Version.new("2.6.
20
20
 
21
21
  if Gem.rubygems_version < Gem::Version.new("3.2.3") && Gem.ruby_version < Gem::Version.new("2.6.a") && !ENV["BUNDLER_NO_OLD_RUBYGEMS_WARNING"]
22
22
  Bundler.ui.warn \
23
- "Your RubyGems version (#{Gem::VERSION})) has a bug that prevents " \
23
+ "Your RubyGems version (#{Gem::VERSION}) has a bug that prevents " \
24
24
  "`required_ruby_version` from working for Bundler. Any scripts that use " \
25
25
  "`gem install bundler` will break as soon as Bundler drops support for " \
26
26
  "your Ruby version. Please upgrade RubyGems to avoid future breakage " \
data/exe/bundler CHANGED
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- load File.expand_path("../bundle", __FILE__)
4
+ load File.expand_path("bundle", __dir__)
@@ -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 = "2022-03-09".freeze
8
- @git_commit_sha = "7f90c0083a".freeze
7
+ @built_at = "2022-04-20".freeze
8
+ @git_commit_sha = "75031e03f4".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -29,7 +29,7 @@ module Bundler
29
29
 
30
30
  # If Bundler has been installed without its .git directory and without a
31
31
  # commit instance variable then we can't determine its commits SHA.
32
- git_dir = File.join(File.expand_path("../../../..", __FILE__), ".git")
32
+ git_dir = File.expand_path("../../../.git", __dir__)
33
33
  if File.directory?(git_dir)
34
34
  return @git_commit_sha = Dir.chdir(git_dir) { `git rev-parse --short HEAD`.strip.freeze }
35
35
  end
@@ -47,7 +47,7 @@ module Bundler
47
47
  def print_gem_path(spec)
48
48
  name = spec.name
49
49
  if name == "bundler"
50
- path = File.expand_path("../../../..", __FILE__)
50
+ path = File.expand_path("../../..", __dir__)
51
51
  else
52
52
  path = spec.full_gem_path
53
53
  if spec.deleted_gem?
@@ -32,7 +32,7 @@ module Bundler
32
32
  file << spec.to_gemfile
33
33
  end
34
34
  else
35
- FileUtils.cp(File.expand_path("../../templates/#{gemfile}", __FILE__), gemfile)
35
+ FileUtils.cp(File.expand_path("../templates/#{gemfile}", __dir__), gemfile)
36
36
  end
37
37
 
38
38
  puts "Writing new #{gemfile} to #{SharedHelpers.pwd}/#{gemfile}"
@@ -18,7 +18,7 @@ module Bundler
18
18
 
19
19
  if gem_name
20
20
  if gem_name == "bundler"
21
- path = File.expand_path("../../../..", __FILE__)
21
+ path = File.expand_path("../../..", __dir__)
22
22
  else
23
23
  spec = Bundler::CLI::Common.select_spec(gem_name, :regex_match)
24
24
  return unless spec
data/lib/bundler/cli.rb CHANGED
@@ -610,7 +610,7 @@ module Bundler
610
610
  private :gem
611
611
 
612
612
  def self.source_root
613
- File.expand_path(File.join(File.dirname(__FILE__), "templates"))
613
+ File.expand_path("templates", __dir__)
614
614
  end
615
615
 
616
616
  desc "clean [OPTIONS]", "Cleans up unused gems in your bundler directory", :hide => true
@@ -21,6 +21,7 @@ module Bundler
21
21
  2.6
22
22
  2.7
23
23
  3.0
24
+ 3.1
24
25
  ].freeze
25
26
 
26
27
  KNOWN_MAJOR_VERSIONS = KNOWN_MINOR_VERSIONS.map {|v| v.split(".", 2).first }.uniq.freeze
@@ -732,30 +732,13 @@ module Bundler
732
732
 
733
733
  def metadata_dependencies
734
734
  @metadata_dependencies ||= begin
735
- ruby_versions = ruby_version_requirements(@ruby_version)
736
735
  [
737
- Dependency.new("Ruby\0", ruby_versions),
736
+ Dependency.new("Ruby\0", RubyVersion.system.gem_version),
738
737
  Dependency.new("RubyGems\0", Gem::VERSION),
739
738
  ]
740
739
  end
741
740
  end
742
741
 
743
- def ruby_version_requirements(ruby_version)
744
- return [] unless ruby_version
745
- if ruby_version.patchlevel
746
- [ruby_version.to_gem_version_with_patchlevel]
747
- else
748
- ruby_version.versions.map do |version|
749
- requirement = Gem::Requirement.new(version)
750
- if requirement.exact?
751
- "~> #{version}.0"
752
- else
753
- requirement
754
- end
755
- end
756
- end
757
- end
758
-
759
742
  def expand_dependencies(dependencies, remote = false)
760
743
  deps = []
761
744
  dependencies.each do |dep|
@@ -20,6 +20,9 @@ module Bundler
20
20
  :ruby_24 => Gem::Platform::RUBY,
21
21
  :ruby_25 => Gem::Platform::RUBY,
22
22
  :ruby_26 => Gem::Platform::RUBY,
23
+ :ruby_27 => Gem::Platform::RUBY,
24
+ :ruby_30 => Gem::Platform::RUBY,
25
+ :ruby_31 => Gem::Platform::RUBY,
23
26
  :mri => Gem::Platform::RUBY,
24
27
  :mri_18 => Gem::Platform::RUBY,
25
28
  :mri_19 => Gem::Platform::RUBY,
@@ -30,6 +33,9 @@ module Bundler
30
33
  :mri_24 => Gem::Platform::RUBY,
31
34
  :mri_25 => Gem::Platform::RUBY,
32
35
  :mri_26 => Gem::Platform::RUBY,
36
+ :mri_27 => Gem::Platform::RUBY,
37
+ :mri_30 => Gem::Platform::RUBY,
38
+ :mri_31 => Gem::Platform::RUBY,
33
39
  :rbx => Gem::Platform::RUBY,
34
40
  :truffleruby => Gem::Platform::RUBY,
35
41
  :jruby => Gem::Platform::JAVA,
@@ -45,6 +51,9 @@ module Bundler
45
51
  :mswin_24 => Gem::Platform::MSWIN,
46
52
  :mswin_25 => Gem::Platform::MSWIN,
47
53
  :mswin_26 => Gem::Platform::MSWIN,
54
+ :mswin_27 => Gem::Platform::MSWIN,
55
+ :mswin_30 => Gem::Platform::MSWIN,
56
+ :mswin_31 => Gem::Platform::MSWIN,
48
57
  :mswin64 => Gem::Platform::MSWIN64,
49
58
  :mswin64_19 => Gem::Platform::MSWIN64,
50
59
  :mswin64_20 => Gem::Platform::MSWIN64,
@@ -54,6 +63,9 @@ module Bundler
54
63
  :mswin64_24 => Gem::Platform::MSWIN64,
55
64
  :mswin64_25 => Gem::Platform::MSWIN64,
56
65
  :mswin64_26 => Gem::Platform::MSWIN64,
66
+ :mswin64_27 => Gem::Platform::MSWIN64,
67
+ :mswin64_30 => Gem::Platform::MSWIN64,
68
+ :mswin64_31 => Gem::Platform::MSWIN64,
57
69
  :mingw => Gem::Platform::MINGW,
58
70
  :mingw_18 => Gem::Platform::MINGW,
59
71
  :mingw_19 => Gem::Platform::MINGW,
@@ -64,6 +76,9 @@ module Bundler
64
76
  :mingw_24 => Gem::Platform::MINGW,
65
77
  :mingw_25 => Gem::Platform::MINGW,
66
78
  :mingw_26 => Gem::Platform::MINGW,
79
+ :mingw_27 => Gem::Platform::MINGW,
80
+ :mingw_30 => Gem::Platform::MINGW,
81
+ :mingw_31 => Gem::Platform::MINGW,
67
82
  :x64_mingw => Gem::Platform::X64_MINGW,
68
83
  :x64_mingw_20 => Gem::Platform::X64_MINGW,
69
84
  :x64_mingw_21 => Gem::Platform::X64_MINGW,
@@ -72,6 +87,9 @@ module Bundler
72
87
  :x64_mingw_24 => Gem::Platform::X64_MINGW,
73
88
  :x64_mingw_25 => Gem::Platform::X64_MINGW,
74
89
  :x64_mingw_26 => Gem::Platform::X64_MINGW,
90
+ :x64_mingw_27 => Gem::Platform::X64_MINGW,
91
+ :x64_mingw_30 => Gem::Platform::X64_MINGW,
92
+ :x64_mingw_31 => Gem::Platform::X64_MINGW,
75
93
  }.freeze
76
94
 
77
95
  def initialize(name, version, options = {}, &blk)
@@ -226,6 +226,7 @@ module Bundler
226
226
  "GO_SERVER_URL" => "go",
227
227
  "SNAP_CI" => "snap",
228
228
  "GITLAB_CI" => "gitlab",
229
+ "GITHUB_ACTIONS" => "github",
229
230
  "CI_NAME" => ENV["CI_NAME"],
230
231
  "CI" => "ci",
231
232
  }
@@ -119,7 +119,7 @@ module Bundler
119
119
  relative_gemfile_path = relative_gemfile_path
120
120
  ruby_command = Thor::Util.ruby_command
121
121
  ruby_command = ruby_command
122
- template_path = File.expand_path("../templates/Executable", __FILE__)
122
+ template_path = File.expand_path("templates/Executable", __dir__)
123
123
  if spec.name == "bundler"
124
124
  template_path += ".bundler"
125
125
  spec.executables = %(bundle)
@@ -172,7 +172,7 @@ module Bundler
172
172
  end
173
173
  standalone_path = Bundler.root.join(path).relative_path_from(bin_path)
174
174
  standalone_path = standalone_path
175
- template = File.read(File.expand_path("../templates/Executable.standalone", __FILE__))
175
+ template = File.read(File.expand_path("templates/Executable.standalone", __dir__))
176
176
  ruby_command = Thor::Util.ruby_command
177
177
  ruby_command = ruby_command
178
178
 
@@ -36,13 +36,13 @@ Executing \fBbundle config list\fR with will print a list of all bundler configu
36
36
  Executing \fBbundle config get <name>\fR will print the value of that configuration setting, and where it was set\.
37
37
  .
38
38
  .P
39
- Executing \fBbundle config set <name> <value>\fR will set that configuration to the value specified for all bundles executed as the current user\. The configuration will be stored in \fB~/\.bundle/config\fR\. If \fIname\fR already is set, \fIname\fR will be overridden and user will be warned\.
39
+ Executing \fBbundle config set <name> <value>\fR defaults to setting \fBlocal\fR configuration if executing from within a local application, otherwise it will set \fBglobal\fR configuration\. See \fB\-\-local\fR and \fB\-\-global\fR options below\.
40
40
  .
41
41
  .P
42
- Executing \fBbundle config set \-\-global <name> <value>\fR works the same as above\.
42
+ Executing \fBbundle config set \-\-local <name> <value>\fR will set that configuration in the directory for the local application\. The configuration will be stored in \fB<project_root>/\.bundle/config\fR\. If \fBBUNDLE_APP_CONFIG\fR is set, the configuration will be stored in \fB$BUNDLE_APP_CONFIG/config\fR\.
43
43
  .
44
44
  .P
45
- Executing \fBbundle config set \-\-local <name> <value>\fR will set that configuration in the directory for the local application\. The configuration will be stored in \fB<project_root>/\.bundle/config\fR\. If \fBBUNDLE_APP_CONFIG\fR is set, the configuration will be stored in \fB$BUNDLE_APP_CONFIG/config\fR\.
45
+ Executing \fBbundle config set \-\-global <name> <value>\fR will set that configuration to the value specified for all bundles executed as the current user\. The configuration will be stored in \fB~/\.bundle/config\fR\. If \fIname\fR already is set, \fIname\fR will be overridden and user will be warned\.
46
46
  .
47
47
  .P
48
48
  Executing \fBbundle config unset <name>\fR will delete the configuration in both local and global sources\.
@@ -23,18 +23,20 @@ was set.
23
23
  Executing `bundle config get <name>` will print the value of that configuration
24
24
  setting, and where it was set.
25
25
 
26
- Executing `bundle config set <name> <value>` will set that configuration to the
27
- value specified for all bundles executed as the current user. The configuration
28
- will be stored in `~/.bundle/config`. If <name> already is set, <name> will be
29
- overridden and user will be warned.
30
-
31
- Executing `bundle config set --global <name> <value>` works the same as above.
26
+ Executing `bundle config set <name> <value>` defaults to setting `local`
27
+ configuration if executing from within a local application, otherwise it will
28
+ set `global` configuration. See `--local` and `--global` options below.
32
29
 
33
30
  Executing `bundle config set --local <name> <value>` will set that configuration
34
31
  in the directory for the local application. The configuration will be stored in
35
32
  `<project_root>/.bundle/config`. If `BUNDLE_APP_CONFIG` is set, the configuration
36
33
  will be stored in `$BUNDLE_APP_CONFIG/config`.
37
34
 
35
+ Executing `bundle config set --global <name> <value>` will set that
36
+ configuration to the value specified for all bundles executed as the current
37
+ user. The configuration will be stored in `~/.bundle/config`. If <name> already
38
+ is set, <name> will be overridden and user will be warned.
39
+
38
40
  Executing `bundle config unset <name>` will delete the configuration in both
39
41
  local and global sources.
40
42
 
@@ -97,10 +97,10 @@ module Bundler
97
97
  spec = @specs[platform].first
98
98
  return [] if spec.is_a?(LazySpecification)
99
99
  dependencies = []
100
- if !spec.required_ruby_version.nil? && !spec.required_ruby_version.none?
100
+ unless spec.required_ruby_version.none?
101
101
  dependencies << DepProxy.get_proxy(Gem::Dependency.new("Ruby\0", spec.required_ruby_version), platform)
102
102
  end
103
- if !spec.required_rubygems_version.nil? && !spec.required_rubygems_version.none?
103
+ unless spec.required_rubygems_version.none?
104
104
  dependencies << DepProxy.get_proxy(Gem::Dependency.new("RubyGems\0", spec.required_rubygems_version), platform)
105
105
  end
106
106
  dependencies
@@ -312,29 +312,66 @@ module Bundler
312
312
 
313
313
  e = Molinillo::VersionConflict.new(conflicts, e.specification_provider) unless conflicts.empty?
314
314
 
315
- solver_name = "Bundler"
316
- possibility_type = "gem"
317
315
  e.message_with_trees(
318
- :solver_name => solver_name,
319
- :possibility_type => possibility_type,
320
- :reduce_trees => lambda do |trees|
316
+ :full_message_for_conflict => lambda do |name, conflict|
317
+ o = if name.end_with?("\0")
318
+ String.new("Bundler found conflicting requirements for the #{name} version:")
319
+ else
320
+ String.new("Bundler could not find compatible versions for gem \"#{name}\":")
321
+ end
322
+ o << %(\n)
323
+ if conflict.locked_requirement
324
+ o << %( In snapshot (#{name_for_locking_dependency_source}):\n)
325
+ o << %( #{SharedHelpers.pretty_dependency(conflict.locked_requirement)}\n)
326
+ o << %(\n)
327
+ end
328
+ o << %( In #{name_for_explicit_dependency_source}:\n)
329
+ trees = conflict.requirement_trees
330
+
321
331
  # called first, because we want to reduce the amount of work required to find maximal empty sets
322
332
  trees = trees.uniq {|t| t.flatten.map {|dep| [dep.name, dep.requirement] } }
323
333
 
324
334
  # bail out if tree size is too big for Array#combination to make any sense
325
- return trees if trees.size > 15
326
- maximal = 1.upto(trees.size).map do |size|
327
- trees.map(&:last).flatten(1).combination(size).to_a
328
- end.flatten(1).select do |deps|
329
- Bundler::VersionRanges.empty?(*Bundler::VersionRanges.for_many(deps.map(&:requirement)))
330
- end.min_by(&:size)
331
-
332
- trees.reject! {|t| !maximal.include?(t.last) } if maximal
333
-
334
- trees.sort_by {|t| t.reverse.map(&:name) }
335
- end,
336
- :printable_requirement => lambda {|req| SharedHelpers.pretty_dependency(req) },
337
- :additional_message_for_conflict => lambda do |o, name, conflict|
335
+ if trees.size <= 15
336
+ maximal = 1.upto(trees.size).map do |size|
337
+ trees.map(&:last).flatten(1).combination(size).to_a
338
+ end.flatten(1).select do |deps|
339
+ Bundler::VersionRanges.empty?(*Bundler::VersionRanges.for_many(deps.map(&:requirement)))
340
+ end.min_by(&:size)
341
+
342
+ trees.reject! {|t| !maximal.include?(t.last) } if maximal
343
+
344
+ trees.sort_by! {|t| t.reverse.map(&:name) }
345
+ end
346
+
347
+ metadata_requirements = {}
348
+
349
+ o << trees.map do |tree|
350
+ t = "".dup
351
+ depth = 2
352
+
353
+ base_tree = tree.first
354
+ base_tree_name = base_tree.name
355
+
356
+ if base_tree_name.end_with?("\0")
357
+ metadata_requirements[base_tree_name] = base_tree
358
+ t = nil
359
+ else
360
+ tree.each do |req|
361
+ t << " " * depth << SharedHelpers.pretty_dependency(req)
362
+ unless tree.last == req
363
+ if spec = conflict.activated_by_name[req.name]
364
+ t << %( was resolved to #{spec.version}, which)
365
+ end
366
+ t << %( depends on)
367
+ end
368
+ t << %(\n)
369
+ depth += 1
370
+ end
371
+ end
372
+ t
373
+ end.compact.join("\n")
374
+
338
375
  if name == "bundler"
339
376
  o << %(\n Current Bundler version:\n bundler (#{Bundler::VERSION}))
340
377
 
@@ -355,11 +392,13 @@ module Bundler
355
392
  o << "Your bundle requires a different version of Bundler than the one you're running, and that version could not be found.\n"
356
393
  end
357
394
  end
395
+ elsif name.end_with?("\0")
396
+ o << %(\n Current #{name} version:\n #{SharedHelpers.pretty_dependency(metadata_requirements[name])}\n\n)
358
397
  elsif conflict.locked_requirement
359
398
  o << "\n"
360
399
  o << %(Running `bundle update` will rebuild your snapshot from scratch, using only\n)
361
400
  o << %(the gems in your Gemfile, which may resolve the conflict.\n)
362
- elsif !conflict.existing && !name.end_with?("\0")
401
+ elsif !conflict.existing
363
402
  o << "\n"
364
403
 
365
404
  relevant_source = conflict.requirement.source || source_for(name)
@@ -372,14 +411,8 @@ module Bundler
372
411
 
373
412
  o << gem_not_found_message(name, conflict.requirement, relevant_source, extra_message)
374
413
  end
375
- end,
376
- :version_for_spec => lambda {|spec| spec.version },
377
- :incompatible_version_message_for_conflict => lambda do |name, _conflict|
378
- if name.end_with?("\0")
379
- %(#{solver_name} found conflicting requirements for the #{name} version:)
380
- else
381
- %(#{solver_name} could not find compatible versions for #{possibility_type} "#{name}":)
382
- end
414
+
415
+ o
383
416
  end
384
417
  )
385
418
  end
@@ -110,19 +110,6 @@ module Bundler
110
110
  @ruby_version ||= RubyVersion.new(ruby_version, patchlevel, ruby_engine, ruby_engine_version)
111
111
  end
112
112
 
113
- def to_gem_version_with_patchlevel
114
- @gem_version_with_patch ||= begin
115
- Gem::Version.create("#{@gem_version}.#{@patchlevel}")
116
- rescue ArgumentError
117
- @gem_version
118
- end
119
- end
120
-
121
- def exact?
122
- return @exact if defined?(@exact)
123
- @exact = versions.all? {|v| Gem::Requirement.create(v).exact? }
124
- end
125
-
126
113
  private
127
114
 
128
115
  def matches?(requirements, version)
@@ -67,6 +67,23 @@ module Gem
67
67
  full_gem_path
68
68
  end
69
69
 
70
+ unless const_defined?(:LATEST_RUBY_WITHOUT_PATCH_VERSIONS)
71
+ LATEST_RUBY_WITHOUT_PATCH_VERSIONS = Gem::Version.new("2.1")
72
+
73
+ alias_method :rg_required_ruby_version=, :required_ruby_version=
74
+ def required_ruby_version=(req)
75
+ self.rg_required_ruby_version = req
76
+
77
+ @required_ruby_version.requirements.map! do |op, v|
78
+ if v >= LATEST_RUBY_WITHOUT_PATCH_VERSIONS && v.release.segments.size == 4
79
+ [op == "~>" ? "=" : op, Gem::Version.new(v.segments.tap {|s| s.delete_at(3) }.join("."))]
80
+ else
81
+ [op, v]
82
+ end
83
+ end
84
+ end
85
+ end
86
+
70
87
  def groups
71
88
  @groups ||= []
72
89
  end
@@ -274,10 +274,10 @@ module Bundler
274
274
 
275
275
  def set_bundle_variables
276
276
  # bundler exe & lib folders have same root folder, typical gem installation
277
- exe_file = File.expand_path("../../../exe/bundle", __FILE__)
277
+ exe_file = File.expand_path("../../exe/bundle", __dir__)
278
278
 
279
279
  # for Ruby core repository testing
280
- exe_file = File.expand_path("../../../libexec/bundle", __FILE__) unless File.exist?(exe_file)
280
+ exe_file = File.expand_path("../../libexec/bundle", __dir__) unless File.exist?(exe_file)
281
281
 
282
282
  # bundler is a default gem, exe path is separate
283
283
  exe_file = Bundler.rubygems.bin_path("bundler", "bundle", VERSION) unless File.exist?(exe_file)
@@ -309,7 +309,7 @@ module Bundler
309
309
  end
310
310
 
311
311
  def bundler_ruby_lib
312
- resolve_path File.expand_path("../..", __FILE__)
312
+ File.expand_path("..", __dir__)
313
313
  end
314
314
 
315
315
  def clean_load_path
@@ -325,7 +325,7 @@ module Bundler
325
325
 
326
326
  def resolve_path(path)
327
327
  expanded = File.expand_path(path)
328
- return expanded unless File.respond_to?(:realpath) && File.exist?(expanded)
328
+ return expanded unless File.exist?(expanded)
329
329
 
330
330
  File.realpath(expanded)
331
331
  end
@@ -5,7 +5,7 @@ module Bundler
5
5
  class Metadata < Source
6
6
  def specs
7
7
  @specs ||= Index.build do |idx|
8
- idx << Gem::Specification.new("Ruby\0", RubyVersion.system.to_gem_version_with_patchlevel)
8
+ idx << Gem::Specification.new("Ruby\0", RubyVersion.system.gem_version)
9
9
  idx << Gem::Specification.new("RubyGems\0", Gem::VERSION) do |s|
10
10
  s.required_rubygems_version = Gem::Requirement.default
11
11
  end
@@ -22,7 +22,7 @@ module Bundler
22
22
  s.summary = "The best way to manage your application's dependencies"
23
23
  s.executables = %w[bundle]
24
24
  # can't point to the actual gemspec or else the require paths will be wrong
25
- s.loaded_from = File.expand_path("..", __FILE__)
25
+ s.loaded_from = __dir__
26
26
  end
27
27
 
28
28
  if local_spec = Bundler.rubygems.find_bundler(VERSION)
@@ -8,11 +8,9 @@
8
8
  # this file is here to facilitate running it.
9
9
  #
10
10
 
11
- require "pathname"
12
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../<%= relative_gemfile_path %>",
13
- Pathname.new(__FILE__).realpath)
11
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("<%= relative_gemfile_path %>", __dir__)
14
12
 
15
- bundle_binstub = File.expand_path("../bundle", __FILE__)
13
+ bundle_binstub = File.expand_path("bundle", __dir__)
16
14
 
17
15
  if File.file?(bundle_binstub)
18
16
  if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
@@ -41,7 +41,7 @@ m = Module.new do
41
41
  gemfile = ENV["BUNDLE_GEMFILE"]
42
42
  return gemfile if gemfile && !gemfile.empty?
43
43
 
44
- File.expand_path("../<%= relative_gemfile_path %>", __FILE__)
44
+ File.expand_path("<%= relative_gemfile_path %>", __dir__)
45
45
  end
46
46
 
47
47
  def lockfile
@@ -6,9 +6,7 @@
6
6
  # this file is here to facilitate running it.
7
7
  #
8
8
 
9
- require "pathname"
10
- path = Pathname.new(__FILE__)
11
- $:.unshift File.expand_path "../<%= standalone_path %>", path.realpath
9
+ $:.unshift File.expand_path "<%= standalone_path %>", __dir__
12
10
 
13
11
  require "bundler/setup"
14
- load File.expand_path "../<%= executable_path %>", path.realpath
12
+ load File.expand_path "<%= executable_path %>", __dir__
@@ -17,7 +17,7 @@ jobs:
17
17
  - '<%= RUBY_VERSION %>'
18
18
 
19
19
  steps:
20
- - uses: actions/checkout@v2
20
+ - uses: actions/checkout@v3
21
21
  - name: Set up Ruby
22
22
  uses: ruby/setup-ruby@v1
23
23
  with:
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
24
24
 
25
25
  # Specify which files should be added to the gem when it is released.
26
26
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
27
- spec.files = Dir.chdir(File.expand_path(__dir__)) do
27
+ spec.files = Dir.chdir(__dir__) do
28
28
  `git ls-files -z`.split("\x0").reject do |f|
29
29
  (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
30
30
  end
@@ -32,7 +32,7 @@ module Bundler::Molinillo
32
32
  # all belong to the same graph.
33
33
  # @return [Array<Vertex>] The sorted vertices.
34
34
  def self.tsort(vertices)
35
- TSort.tsort(
35
+ Bundler::TSort.tsort(
36
36
  lambda { |b| vertices.each(&b) },
37
37
  lambda { |v, &b| (v.successors & vertices).each(&b) }
38
38
  )