bundler 2.2.25 → 2.2.26

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of bundler might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 42284d8028f6f07937bba73b6c9e55c511c9d14c599b5b2e3b951599a6cff7e7
4
- data.tar.gz: dcda6b29a424bc079333e3a9f5f02f679e7cae039b3dd07e25cb6da6ebf29b4c
3
+ metadata.gz: 0f6b49cdd4d65c0b945ba09e5a1f49de540a778e19e0157ed2a376a6daf9511c
4
+ data.tar.gz: 52ade727aa83b8390bb5eeaceda718c1d194d00251ea535013c9da8e58b79094
5
5
  SHA512:
6
- metadata.gz: 9cb7f2e44d450503a5c0786dcc9e3972cfa830180a518de00c5733965c9fe790ab1090611e1da3d2a8cffbd911e2a3c7531b0707a3712efd8c162b95723e827b
7
- data.tar.gz: 0dc46959901b2edf345dbb4b0b448a9762caa91179011899d36939f927379af22b8406ddf4bb17e67c410a7d65c76c43f3c4fcb9c3ec6a4b92dcce82364cdf91
6
+ metadata.gz: 2e9f6084d7c8059af49ed11ccc1b0748babe41d40d6a363b7dad9091762c979091ad5388cc913545eb2853867ebe9ee7088c3ffb331e667eb57d04345799ab87
7
+ data.tar.gz: dab0d503f64a592ec7dcc8e91ff509f149cc65e20b83db73857ea3e750f10bec57301042db96639f3d77707db78fea0a1f29338a4a3c5721dad3b8db906fd71b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ # 2.2.26 (August 17, 2021)
2
+
3
+ ## Enhancements:
4
+
5
+ - Remove `RUBYGEMS_GEMDEPS` warning [#4827](https://github.com/rubygems/rubygems/pull/4827)
6
+ - Better defaults for GitHub Actions template generated by `bundle gem` [#4619](https://github.com/rubygems/rubygems/pull/4619)
7
+ - Make `bundle exec` keep file descriptors by default [#4812](https://github.com/rubygems/rubygems/pull/4812)
8
+ - Exclude gemspec file itself from file list of gems generated by `bundle gem` [#4650](https://github.com/rubygems/rubygems/pull/4650)
9
+ - Fix a couple small typos in deprecation / error messages [#4806](https://github.com/rubygems/rubygems/pull/4806)
10
+ - Make script generated by `bundle install --standalone` resilient to moving the application to a differently nested folder when `path` sources are used [#4792](https://github.com/rubygems/rubygems/pull/4792)
11
+ - Exclude CI files and issue templates from file list of gems generated by `bundle gem` [#4033](https://github.com/rubygems/rubygems/pull/4033)
12
+
13
+ ## Bug fixes:
14
+
15
+ - Respect `BUNDLE_USER_HOME` env when choosing config location [#4828](https://github.com/rubygems/rubygems/pull/4828)
16
+ - Fix `bundle gem` on path with spaces [#4816](https://github.com/rubygems/rubygems/pull/4816)
17
+ - Fix bundler hitting the network in some cases where not allowed [#4805](https://github.com/rubygems/rubygems/pull/4805)
18
+
1
19
  # 2.2.25 (July 30, 2021)
2
20
 
3
21
  ## Deprecations:
@@ -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 = "2021-07-30".freeze
8
- @git_commit_sha = "7f0f257c7a".freeze
7
+ @built_at = "2021-08-17".freeze
8
+ @git_commit_sha = "21fd333002".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
data/lib/bundler/cli.rb CHANGED
@@ -73,14 +73,6 @@ module Bundler
73
73
  Bundler.ui = UI::Shell.new(options)
74
74
  Bundler.ui.level = "debug" if options["verbose"]
75
75
  unprinted_warnings.each {|w| Bundler.ui.warn(w) }
76
-
77
- if ENV["RUBYGEMS_GEMDEPS"] && !ENV["RUBYGEMS_GEMDEPS"].empty?
78
- Bundler.ui.warn(
79
- "The RUBYGEMS_GEMDEPS environment variable is set. This enables RubyGems' " \
80
- "experimental Gemfile mode, which may conflict with Bundler and cause unexpected errors. " \
81
- "To remove this warning, unset RUBYGEMS_GEMDEPS.", :wrap => true
82
- )
83
- end
84
76
  end
85
77
 
86
78
  check_unknown_options!(:except => [:config, :exec])
@@ -469,7 +461,7 @@ module Bundler
469
461
  map aliases_for("cache")
470
462
 
471
463
  desc "exec [OPTIONS]", "Run the command in context of the bundle"
472
- method_option :keep_file_descriptors, :type => :boolean, :default => false
464
+ method_option :keep_file_descriptors, :type => :boolean, :default => true
473
465
  method_option :gemfile, :type => :string, :required => false
474
466
  long_desc <<-D
475
467
  Exec runs a command, providing it access to the gems in the bundle. While using
@@ -477,6 +469,10 @@ module Bundler
477
469
  into the system wide RubyGems repository.
478
470
  D
479
471
  def exec(*args)
472
+ if ARGV.include?("--no-keep-file-descriptors")
473
+ SharedHelpers.major_deprecation(2, "The `--no-keep-file-descriptors` has been deprecated. `bundle exec` no longer mess with your file descriptors. Close them in the exec'd script if you need to")
474
+ end
475
+
480
476
  require_relative "cli/exec"
481
477
  Exec.new(options, args).run
482
478
  end
@@ -15,7 +15,7 @@ module Bundler
15
15
  definition.validate_runtime!
16
16
 
17
17
  begin
18
- definition.resolve_only_locally!
18
+ definition.resolve_with_cache!
19
19
  not_installed = definition.missing_specs
20
20
  rescue GemNotFound, VersionConflict
21
21
  Bundler.ui.error "Bundler can't satisfy your Gemfile's dependencies."
@@ -12,12 +12,7 @@ module Bundler
12
12
  @options = options
13
13
  @cmd = args.shift
14
14
  @args = args
15
-
16
- if !Bundler.current_ruby.jruby?
17
- @args << { :close_others => !options.keep_file_descriptors? }
18
- elsif options.keep_file_descriptors?
19
- Bundler.ui.warn "Ruby version #{RUBY_VERSION} defaults to keeping non-standard file descriptors on Kernel#exec."
20
- end
15
+ @args << { :close_others => !options.keep_file_descriptors? } unless Bundler.current_ruby.jruby?
21
16
  end
22
17
 
23
18
  def run
@@ -184,14 +184,15 @@ module Bundler
184
184
  )
185
185
  end
186
186
 
187
- if File.exist?(target) && !File.directory?(target)
187
+ if target.exist? && !target.directory?
188
188
  Bundler.ui.error "Couldn't create a new gem named `#{gem_name}` because there's an existing file named `#{gem_name}`."
189
189
  exit Bundler::BundlerError.all_errors[Bundler::GenericSystemCallError]
190
190
  end
191
191
 
192
192
  if use_git
193
193
  Bundler.ui.info "Initializing git repo in #{target}"
194
- `git init #{target}`
194
+ require "shellwords"
195
+ `git init #{target.to_s.shellescape}`
195
196
 
196
197
  config[:git_default_branch] = File.read("#{target}/.git/HEAD").split("/").last.chomp
197
198
  end
@@ -161,12 +161,6 @@ module Bundler
161
161
  @multisource_allowed
162
162
  end
163
163
 
164
- def resolve_only_locally!
165
- @remote = false
166
- sources.local_only!
167
- resolve
168
- end
169
-
170
164
  def resolve_with_cache!
171
165
  sources.cached!
172
166
  resolve
@@ -505,7 +499,7 @@ module Bundler
505
499
  end
506
500
 
507
501
  def precompute_source_requirements_for_indirect_dependencies?
508
- sources.non_global_rubygems_sources.all?(&:dependency_api_available?) && !sources.aggregate_global_source?
502
+ @remote && sources.non_global_rubygems_sources.all?(&:dependency_api_available?) && !sources.aggregate_global_source?
509
503
  end
510
504
 
511
505
  def current_ruby_platform_locked?
data/lib/bundler/dsl.rb CHANGED
@@ -457,7 +457,7 @@ repo_name ||= user_name
457
457
  def implicit_global_source_warning
458
458
  Bundler::SharedHelpers.major_deprecation 2, "This Gemfile does not include an explicit global source. " \
459
459
  "Not using an explicit global source may result in a different lockfile being generated depending on " \
460
- "the gems you have installed locally before bundler is run." \
460
+ "the gems you have installed locally before bundler is run. " \
461
461
  "Instead, define a global source in your Gemfile like this: source \"https://rubygems.org\"."
462
462
  end
463
463
 
@@ -122,7 +122,7 @@ module Bundler
122
122
 
123
123
  class VirtualProtocolError < BundlerError
124
124
  def message
125
- "There was an error relating to virtualization and file access." \
125
+ "There was an error relating to virtualization and file access. " \
126
126
  "It is likely that you need to grant access to or mount some file system correctly."
127
127
  end
128
128
 
@@ -12,12 +12,13 @@ module Bundler
12
12
  end
13
13
  File.open File.join(bundler_path, "setup.rb"), "w" do |file|
14
14
  file.puts "require 'rbconfig'"
15
- file.puts "ruby_engine = RUBY_ENGINE"
16
- file.puts "ruby_version = RbConfig::CONFIG[\"ruby_version\"]"
17
- file.puts "path = File.expand_path('..', __FILE__)"
18
15
  file.puts reverse_rubygems_kernel_mixin
19
16
  paths.each do |path|
20
- file.puts %($:.unshift File.expand_path("\#{path}/#{path}"))
17
+ if Pathname.new(path).absolute?
18
+ file.puts %($:.unshift "#{path}")
19
+ else
20
+ file.puts %($:.unshift File.expand_path("\#{__dir__}/#{path}"))
21
+ end
21
22
  end
22
23
  end
23
24
  end
@@ -28,14 +29,14 @@ module Bundler
28
29
  @specs.map do |spec|
29
30
  next if spec.name == "bundler"
30
31
  Array(spec.require_paths).map do |path|
31
- gem_path(path, spec).sub(version_dir, '#{ruby_engine}/#{ruby_version}')
32
+ gem_path(path, spec).sub(version_dir, '#{RUBY_ENGINE}/#{RbConfig::CONFIG["ruby_version"]}')
32
33
  # This is a static string intentionally. It's interpolated at a later time.
33
34
  end
34
- end.flatten
35
+ end.flatten.compact
35
36
  end
36
37
 
37
38
  def version_dir
38
- "#{Bundler::RubyVersion.system.engine}/#{RbConfig::CONFIG["ruby_version"]}"
39
+ "#{RUBY_ENGINE}/#{RbConfig::CONFIG["ruby_version"]}"
39
40
  end
40
41
 
41
42
  def bundler_path
@@ -44,7 +45,11 @@ module Bundler
44
45
 
45
46
  def gem_path(path, spec)
46
47
  full_path = Pathname.new(path).absolute? ? path : File.join(spec.full_gem_path, path)
47
- Pathname.new(full_path).relative_path_from(Bundler.root.join(bundler_path)).to_s
48
+ if spec.source.instance_of?(Source::Path)
49
+ full_path
50
+ else
51
+ Pathname.new(full_path).relative_path_from(Bundler.root.join(bundler_path)).to_s
52
+ end
48
53
  rescue TypeError
49
54
  error_message = "#{spec.name} #{spec.version} has an invalid gemspec"
50
55
  raise Gem::InvalidSpecificationException.new(error_message)
@@ -255,12 +255,6 @@ module Bundler
255
255
  next if name == "bundler"
256
256
  next unless search_for(requirement).empty?
257
257
 
258
- cache_message = begin
259
- " or in gems cached in #{Bundler.settings.app_cache_path}" if Bundler.app_cache.exist?
260
- rescue GemfileNotFound
261
- nil
262
- end
263
-
264
258
  if (base = @base[name]) && !base.empty?
265
259
  version = base.first.version
266
260
  message = "You have requested:\n" \
@@ -269,18 +263,17 @@ module Bundler
269
263
  "Try running `bundle update #{name}`\n\n" \
270
264
  "If you are updating multiple gems in your Gemfile at once,\n" \
271
265
  "try passing them all to `bundle update`"
272
- elsif source = @source_requirements[name]
266
+ else
267
+ source = source_for(name)
273
268
  specs = source.specs.search(name)
274
269
  versions_with_platforms = specs.map {|s| [s.version, s.platform] }
275
- message = String.new("Could not find gem '#{SharedHelpers.pretty_dependency(requirement)}' in #{source}#{cache_message}.\n")
276
- message << if versions_with_platforms.any?
277
- "The source contains the following versions of '#{name}': #{formatted_versions_with_platforms(versions_with_platforms)}"
278
- else
279
- "The source does not contain any versions of '#{name}'"
280
- end
281
- else
282
- message = "Could not find gem '#{SharedHelpers.pretty_dependency(requirement)}' in any of the gem sources " \
283
- "listed in your Gemfile#{cache_message}."
270
+ cache_message = begin
271
+ " or in gems cached in #{Bundler.settings.app_cache_path}" if Bundler.app_cache.exist?
272
+ rescue GemfileNotFound
273
+ nil
274
+ end
275
+ message = String.new("Could not find gem '#{SharedHelpers.pretty_dependency(requirement)}' in #{source.to_err}#{cache_message}.\n")
276
+ message << "The source contains the following versions of '#{name}': #{formatted_versions_with_platforms(versions_with_platforms)}" if versions_with_platforms.any?
284
277
  end
285
278
  raise GemNotFound, message
286
279
  end
@@ -378,7 +371,7 @@ module Bundler
378
371
  o << if metadata_requirement
379
372
  "is not available in #{relevant_source}"
380
373
  else
381
- "in #{relevant_source}.\n"
374
+ "in #{relevant_source.to_err}.\n"
382
375
  end
383
376
  end
384
377
  end,
@@ -430,6 +430,8 @@ module Bundler
430
430
  Pathname.new(ENV["BUNDLE_CONFIG"])
431
431
  elsif ENV["BUNDLE_USER_CONFIG"] && !ENV["BUNDLE_USER_CONFIG"].empty?
432
432
  Pathname.new(ENV["BUNDLE_USER_CONFIG"])
433
+ elsif ENV["BUNDLE_USER_HOME"] && !ENV["BUNDLE_USER_HOME"].empty?
434
+ Pathname.new(ENV["BUNDLE_USER_HOME"]).join("config")
433
435
  elsif Bundler.rubygems.user_home && !Bundler.rubygems.user_home.empty?
434
436
  Pathname.new(Bundler.rubygems.user_home).join(".bundle/config")
435
437
  end
@@ -36,8 +36,6 @@ module Bundler
36
36
 
37
37
  def local!; end
38
38
 
39
- def local_only!; end
40
-
41
39
  def cached!; end
42
40
 
43
41
  def remote!; end
@@ -67,6 +65,10 @@ module Bundler
67
65
  "#<#{self.class}:0x#{object_id} #{self}>"
68
66
  end
69
67
 
68
+ def to_err
69
+ to_s
70
+ end
71
+
70
72
  def path?
71
73
  instance_of?(Bundler::Source::Path)
72
74
  end
@@ -26,12 +26,6 @@ module Bundler
26
26
  Array(options["remotes"]).reverse_each {|r| add_remote(r) }
27
27
  end
28
28
 
29
- def local_only!
30
- @specs = nil
31
- @allow_local = true
32
- @allow_remote = false
33
- end
34
-
35
29
  def local!
36
30
  return if @allow_local
37
31
 
@@ -50,6 +44,7 @@ module Bundler
50
44
  return if @allow_cached
51
45
 
52
46
  @specs = nil
47
+ @allow_local = true
53
48
  @allow_cached = true
54
49
  end
55
50
 
@@ -96,11 +91,22 @@ module Bundler
96
91
  out << " specs:\n"
97
92
  end
98
93
 
94
+ def to_err
95
+ if remotes.empty?
96
+ "locally installed gems"
97
+ elsif @allow_remote
98
+ "rubygems repository #{remote_names} or installed locally"
99
+ elsif @allow_cached
100
+ "cached gems from rubygems repository #{remote_names} or installed locally"
101
+ else
102
+ "locally installed gems"
103
+ end
104
+ end
105
+
99
106
  def to_s
100
107
  if remotes.empty?
101
108
  "locally installed gems"
102
109
  else
103
- remote_names = remotes.map(&:to_s).join(", ")
104
110
  "rubygems repository #{remote_names} or installed locally"
105
111
  end
106
112
  end
@@ -319,6 +325,10 @@ module Bundler
319
325
 
320
326
  protected
321
327
 
328
+ def remote_names
329
+ remotes.map(&:to_s).join(", ")
330
+ end
331
+
322
332
  def credless_remotes
323
333
  remotes.map(&method(:suppress_configured_credentials))
324
334
  end
@@ -16,6 +16,10 @@ module Bundler
16
16
  @index
17
17
  end
18
18
 
19
+ def to_err
20
+ to_s
21
+ end
22
+
19
23
  def to_s
20
24
  "any of the sources"
21
25
  end
@@ -136,10 +136,6 @@ module Bundler
136
136
  different_sources?(lock_sources, replacement_sources)
137
137
  end
138
138
 
139
- def local_only!
140
- all_sources.each(&:local_only!)
141
- end
142
-
143
139
  def cached!
144
140
  all_sources.each(&:cached!)
145
141
  end
@@ -1,16 +1,26 @@
1
1
  name: Ruby
2
2
 
3
- on: [push,pull_request]
3
+ on:
4
+ push:
5
+ - <%= config[:git_default_branch] %>
6
+
7
+ pull_request:
4
8
 
5
9
  jobs:
6
10
  build:
7
11
  runs-on: ubuntu-latest
12
+
13
+ strategy:
14
+ matrix:
15
+ ruby:
16
+ - <%= RUBY_VERSION %>
17
+
8
18
  steps:
9
19
  - uses: actions/checkout@v2
10
20
  - name: Set up Ruby
11
21
  uses: ruby/setup-ruby@v1
12
22
  with:
13
- ruby-version: <%= RUBY_VERSION %>
23
+ ruby-version: ${{ matrix.ruby }}
14
24
  bundler-cache: true
15
25
  - name: Run the default task
16
26
  run: bundle exec rake
@@ -25,7 +25,9 @@ Gem::Specification.new do |spec|
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
27
  spec.files = Dir.chdir(File.expand_path(__dir__)) do
28
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
28
+ `git ls-files -z`.split("\x0").reject do |f|
29
+ (f == __FILE__) || f.match(%r{\A(?:(?:test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
30
+ end
29
31
  end
30
32
  spec.bindir = "exe"
31
33
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.2.25".freeze
4
+ VERSION = "2.2.26".freeze
5
5
 
6
6
  def self.bundler_major_version
7
7
  @bundler_major_version ||= VERSION.split(".").first.to_i
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.2.25
4
+ version: 2.2.26
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: 2021-07-30 00:00:00.000000000 Z
25
+ date: 2021-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
@@ -354,7 +354,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
354
354
  - !ruby/object:Gem::Version
355
355
  version: 2.5.2
356
356
  requirements: []
357
- rubygems_version: 3.2.25
357
+ rubygems_version: 3.2.26
358
358
  signing_key:
359
359
  specification_version: 4
360
360
  summary: The best way to manage your application's dependencies