rubygems-update 3.4.10 → 3.4.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +34 -0
  3. data/Manifest.txt +5 -0
  4. data/bundler/CHANGELOG.md +48 -0
  5. data/bundler/exe/bundle +5 -13
  6. data/bundler/lib/bundler/build_metadata.rb +2 -2
  7. data/bundler/lib/bundler/definition.rb +14 -6
  8. data/bundler/lib/bundler/gem_version_promoter.rb +1 -1
  9. data/bundler/lib/bundler/installer.rb +1 -1
  10. data/bundler/lib/bundler/lazy_specification.rb +1 -1
  11. data/bundler/lib/bundler/lockfile_parser.rb +1 -0
  12. data/bundler/lib/bundler/man/bundle-cache.1 +2 -2
  13. data/bundler/lib/bundler/man/bundle-cache.1.ronn +2 -2
  14. data/bundler/lib/bundler/resolver/base.rb +1 -3
  15. data/bundler/lib/bundler/ruby_version.rb +1 -1
  16. data/bundler/lib/bundler/rubygems_ext.rb +5 -3
  17. data/bundler/lib/bundler/safe_marshal.rb +31 -0
  18. data/bundler/lib/bundler/settings.rb +3 -2
  19. data/bundler/lib/bundler/source/rubygems.rb +12 -12
  20. data/bundler/lib/bundler/spec_set.rb +2 -2
  21. data/bundler/lib/bundler/templates/newgem/bin/console.tt +0 -4
  22. data/bundler/lib/bundler/templates/newgem/ext/newgem/extconf-c.rb.tt +5 -0
  23. data/bundler/lib/bundler/templates/newgem/ext/newgem/newgem.c.tt +1 -1
  24. data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +2 -1
  25. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb +9 -4
  26. data/bundler/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +2 -2
  27. data/bundler/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
  28. data/bundler/lib/bundler/version.rb +1 -1
  29. data/bundler/lib/bundler.rb +8 -16
  30. data/lib/rubygems/command_manager.rb +2 -2
  31. data/lib/rubygems/commands/owner_command.rb +4 -2
  32. data/lib/rubygems/exceptions.rb +10 -0
  33. data/lib/rubygems/gemcutter_utilities.rb +48 -6
  34. data/lib/rubygems/installer.rb +16 -1
  35. data/lib/rubygems/request_set.rb +2 -2
  36. data/lib/rubygems/specification.rb +3 -1
  37. data/lib/rubygems/stub_specification.rb +2 -1
  38. data/lib/rubygems/webauthn_listener/response.rb +161 -0
  39. data/lib/rubygems/webauthn_listener.rb +92 -0
  40. data/lib/rubygems.rb +1 -1
  41. data/rubygems-update.gemspec +4 -3
  42. data/test/rubygems/helper.rb +14 -0
  43. data/test/rubygems/test_bundled_ca.rb +1 -1
  44. data/test/rubygems/test_config.rb +1 -1
  45. data/test/rubygems/test_deprecate.rb +1 -1
  46. data/test/rubygems/test_exit.rb +1 -1
  47. data/test/rubygems/test_gem.rb +7 -0
  48. data/test/rubygems/test_gem_commands_owner_command.rb +67 -0
  49. data/test/rubygems/test_gem_commands_pristine_command.rb +1 -1
  50. data/test/rubygems/test_gem_commands_push_command.rb +73 -0
  51. data/test/rubygems/test_gem_commands_setup_command.rb +1 -1
  52. data/test/rubygems/test_gem_commands_yank_command.rb +84 -0
  53. data/test/rubygems/test_gem_ext_cargo_builder.rb +1 -0
  54. data/test/rubygems/test_gem_gem_runner.rb +5 -5
  55. data/test/rubygems/test_gem_gemcutter_utilities.rb +72 -4
  56. data/test/rubygems/test_gem_installer.rb +50 -2
  57. data/test/rubygems/test_gem_uninstaller.rb +4 -4
  58. data/test/rubygems/test_kernel.rb +1 -1
  59. data/test/rubygems/test_project_sanity.rb +32 -3
  60. data/test/rubygems/test_remote_fetch_error.rb +1 -1
  61. data/test/rubygems/test_webauthn_listener.rb +120 -0
  62. data/test/rubygems/test_webauthn_listener_response.rb +93 -0
  63. data/test/rubygems/utilities.rb +43 -3
  64. metadata +13 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 46744d5e03cb80dd7f581f3b934f104c88910b8442d3659b6d41d55777ab7f3a
4
- data.tar.gz: d7a2016d3d9af5bc86f92ec7bdb8ec8199d7de024a5fbe4b4a2cd0584bcbcf37
3
+ metadata.gz: 5d8a97e5b6198a831e3a4f9394870dbf6a2d53b720cfd769bf11876061199bb1
4
+ data.tar.gz: 0623b2dbd7c85370eabf89e2f908d4fbeb59ffcd725eac2bf883e0b760a9402d
5
5
  SHA512:
6
- metadata.gz: 8416a6fc4327c003c86b8f05dcebcb0c073cb098ccf3d08661a121aedfca3d493b7b6440a605b5c1711f57b77ff230124d58492f99a58a4f926dd94992b4355c
7
- data.tar.gz: 67d782b6794632c09340a51b0f46cde1b82f70cc91aed59cb01961ed6ab57ee2c9a9043c08250c0c6889e2bab71faa6b6e6fa71de0e6cf5e85472ffade6ce73c
6
+ metadata.gz: 8a95e7a9fd03a2552b5d1c3be6529ddf8c13b352f1ba7b9079a914dd060275386a6f2fa1a47b0b68b9a2ee68b67d37a1bdf31a90d0716bd9b805d73421d579d0
7
+ data.tar.gz: 172343a13367b7973cc14f9c721b92a876cc518e00ab257d6af34424b25011053e3bfed66f16dd005f59ca5da32d5c825f6d36845d99ed14f74caf44710a2e8f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,37 @@
1
+ # 3.4.14 / 2023-06-12
2
+
3
+ ## Enhancements:
4
+
5
+ * Load plugin immediately. Pull request
6
+ [#6673](https://github.com/rubygems/rubygems/pull/6673) by kou
7
+ * Installs bundler 2.4.14 as a default gem.
8
+
9
+ ## Documentation:
10
+
11
+ * Clarify what the `rubygems-update` gem is for, and link to source code
12
+ and guides. Pull request
13
+ [#6710](https://github.com/rubygems/rubygems/pull/6710) by davetron5000
14
+
15
+ # 3.4.13 / 2023-05-09
16
+
17
+ ## Enhancements:
18
+
19
+ * Installs bundler 2.4.13 as a default gem.
20
+
21
+ # 3.4.12 / 2023-04-11
22
+
23
+ ## Enhancements:
24
+
25
+ * [Experimental] Add WebAuthn Support to the CLI. Pull request
26
+ [#6560](https://github.com/rubygems/rubygems/pull/6560) by jenshenny
27
+ * Installs bundler 2.4.12 as a default gem.
28
+
29
+ # 3.4.11 / 2023-04-10
30
+
31
+ ## Enhancements:
32
+
33
+ * Installs bundler 2.4.11 as a default gem.
34
+
1
35
  # 3.4.10 / 2023-03-27
2
36
 
3
37
  ## Enhancements:
data/Manifest.txt CHANGED
@@ -180,6 +180,7 @@ bundler/lib/bundler/rubygems_ext.rb
180
180
  bundler/lib/bundler/rubygems_gem_installer.rb
181
181
  bundler/lib/bundler/rubygems_integration.rb
182
182
  bundler/lib/bundler/runtime.rb
183
+ bundler/lib/bundler/safe_marshal.rb
183
184
  bundler/lib/bundler/self_manager.rb
184
185
  bundler/lib/bundler/settings.rb
185
186
  bundler/lib/bundler/settings/validator.rb
@@ -540,6 +541,8 @@ lib/rubygems/util/list.rb
540
541
  lib/rubygems/validator.rb
541
542
  lib/rubygems/version.rb
542
543
  lib/rubygems/version_option.rb
544
+ lib/rubygems/webauthn_listener.rb
545
+ lib/rubygems/webauthn_listener/response.rb
543
546
  rubygems-update.gemspec
544
547
  setup.rb
545
548
  test/rubygems/alternate_cert.pem
@@ -753,6 +756,8 @@ test/rubygems/test_project_sanity.rb
753
756
  test/rubygems/test_remote_fetch_error.rb
754
757
  test/rubygems/test_require.rb
755
758
  test/rubygems/test_rubygems.rb
759
+ test/rubygems/test_webauthn_listener.rb
760
+ test/rubygems/test_webauthn_listener_response.rb
756
761
  test/rubygems/utilities.rb
757
762
  test/rubygems/wrong_key_cert.pem
758
763
  test/rubygems/wrong_key_cert_32.pem
data/bundler/CHANGELOG.md CHANGED
@@ -1,3 +1,51 @@
1
+ # 2.4.14 (June 12, 2023)
2
+
3
+ ## Enhancements:
4
+
5
+ - Stop publishing Gemfile in default gem template [#6723](https://github.com/rubygems/rubygems/pull/6723)
6
+ - Avoid infinite loops when hitting resolution bugs [#6722](https://github.com/rubygems/rubygems/pull/6722)
7
+ - Make `LockfileParser` usable with just a lockfile [#6694](https://github.com/rubygems/rubygems/pull/6694)
8
+ - Always rely on `$LOAD_PATH` when jumping from `exe/` to `lib/` [#6702](https://github.com/rubygems/rubygems/pull/6702)
9
+ - Make `frozen` setting take precedence over `deployment` setting [#6685](https://github.com/rubygems/rubygems/pull/6685)
10
+ - Show an error when trying to update bundler in frozen mode [#6684](https://github.com/rubygems/rubygems/pull/6684)
11
+
12
+ ## Bug fixes:
13
+
14
+ - Fix `deployment` vs `path` precedence [#6703](https://github.com/rubygems/rubygems/pull/6703)
15
+ - Fix inline mode with multiple sources [#6699](https://github.com/rubygems/rubygems/pull/6699)
16
+
17
+ # 2.4.13 (May 9, 2023)
18
+
19
+ ## Bug fixes:
20
+
21
+ - Fix unexpected fallbacks to full index by adding FalseClass and Time to the SafeMarshal list [#6655](https://github.com/rubygems/rubygems/pull/6655)
22
+
23
+ ## Documentation:
24
+
25
+ - Fix broken hyperlinks in bundle cache documentation [#6606](https://github.com/rubygems/rubygems/pull/6606)
26
+
27
+ # 2.4.12 (April 11, 2023)
28
+
29
+ ## Enhancements:
30
+
31
+ - Remove reference to `pry` gem from generated `bin/console` file [#6515](https://github.com/rubygems/rubygems/pull/6515)
32
+
33
+ # 2.4.11 (April 10, 2023)
34
+
35
+ ## Security:
36
+
37
+ - Use URI-0.12.1 (safe against CVE-2023-28755 ReDoS vulnerability) [#6558](https://github.com/rubygems/rubygems/pull/6558)
38
+
39
+ ## Enhancements:
40
+
41
+ - Remove one fallback to full indexes on big gemfiles [#6578](https://github.com/rubygems/rubygems/pull/6578)
42
+ - Generate native gems with `-fvisibility=hidden` [#6541](https://github.com/rubygems/rubygems/pull/6541)
43
+
44
+ ## Bug fixes:
45
+
46
+ - Fix resolver hangs when dealing with an incomplete lockfile [#6552](https://github.com/rubygems/rubygems/pull/6552)
47
+ - Fix prereleases not being considered by gem version promoter when there's no lockfile [#6537](https://github.com/rubygems/rubygems/pull/6537)
48
+
1
49
  # 2.4.10 (March 27, 2023)
2
50
 
3
51
  ## Bug fixes:
data/bundler/exe/bundle CHANGED
@@ -10,11 +10,11 @@ end
10
10
  base_path = File.expand_path("../lib", __dir__)
11
11
 
12
12
  if File.exist?(base_path)
13
- require_relative "../lib/bundler"
14
- else
15
- require "bundler"
13
+ $LOAD_PATH.unshift(base_path)
16
14
  end
17
15
 
16
+ require "bundler"
17
+
18
18
  if Gem.rubygems_version < Gem::Version.new("3.2.3") && Gem.ruby_version < Gem::Version.new("2.7.a") && !ENV["BUNDLER_NO_OLD_RUBYGEMS_WARNING"]
19
19
  Bundler.ui.warn \
20
20
  "Your RubyGems version (#{Gem::VERSION}) has a bug that prevents " \
@@ -24,18 +24,10 @@ if Gem.rubygems_version < Gem::Version.new("3.2.3") && Gem.ruby_version < Gem::V
24
24
  "and silence this warning by running `gem update --system 3.2.3`"
25
25
  end
26
26
 
27
- if File.exist?(base_path)
28
- require_relative "../lib/bundler/friendly_errors"
29
- else
30
- require "bundler/friendly_errors"
31
- end
27
+ require "bundler/friendly_errors"
32
28
 
33
29
  Bundler.with_friendly_errors do
34
- if File.exist?(base_path)
35
- require_relative "../lib/bundler/cli"
36
- else
37
- require "bundler/cli"
38
- end
30
+ require "bundler/cli"
39
31
 
40
32
  # Allow any command to use --help flag to show help for that command
41
33
  help_flags = %w[--help -h]
@@ -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-03-27".freeze
8
- @git_commit_sha = "7ffdec80d0".freeze
7
+ @built_at = "2023-06-12".freeze
8
+ @git_commit_sha = "69f47cf53a".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -217,6 +217,7 @@ module Bundler
217
217
  rescue BundlerError => e
218
218
  @resolve = nil
219
219
  @resolver = nil
220
+ @resolution_packages = nil
220
221
  @specs = nil
221
222
  @gem_version_promoter = nil
222
223
 
@@ -361,10 +362,8 @@ module Bundler
361
362
  "updated #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)} to version control."
362
363
 
363
364
  unless explicit_flag
364
- suggested_command = if Bundler.settings.locations("frozen").keys.&([:global, :local]).any?
365
- "bundle config unset frozen"
366
- elsif Bundler.settings.locations("deployment").keys.&([:global, :local]).any?
367
- "bundle config unset deployment"
365
+ suggested_command = unless Bundler.settings.locations("frozen").keys.include?(:env)
366
+ "bundle config set frozen false"
368
367
  end
369
368
  msg << "\n\nIf this is a development machine, remove the #{Bundler.default_gemfile} " \
370
369
  "freeze \nby running `#{suggested_command}`." if suggested_command
@@ -668,9 +667,17 @@ module Bundler
668
667
  def check_missing_lockfile_specs
669
668
  all_locked_specs = @locked_specs.map(&:name) << "bundler"
670
669
 
671
- @locked_specs.any? do |s|
670
+ missing = @locked_specs.select do |s|
672
671
  s.dependencies.any? {|dep| !all_locked_specs.include?(dep.name) }
673
672
  end
673
+
674
+ if missing.any?
675
+ @locked_specs.delete(missing)
676
+
677
+ true
678
+ else
679
+ false
680
+ end
674
681
  end
675
682
 
676
683
  def converge_paths
@@ -878,7 +885,8 @@ module Bundler
878
885
  if preserve_unknown_sections
879
886
  sections_to_ignore = LockfileParser.sections_to_ignore(@locked_bundler_version)
880
887
  sections_to_ignore += LockfileParser.unknown_sections_in_lockfile(current)
881
- sections_to_ignore += LockfileParser::ENVIRONMENT_VERSION_SECTIONS
888
+ sections_to_ignore << LockfileParser::RUBY
889
+ sections_to_ignore << LockfileParser::BUNDLED unless @unlocking_bundler
882
890
  pattern = /#{Regexp.union(sections_to_ignore)}\n(\s{2,}.*\n)+/
883
891
  whitespace_cleanup = /\n{2,}/
884
892
  current = current.gsub(pattern, "\n").gsub(whitespace_cleanup, "\n\n").strip
@@ -93,7 +93,7 @@ module Bundler
93
93
  locked_version = package.locked_version
94
94
 
95
95
  result = specs.sort do |a, b|
96
- unless locked_version && (package.prerelease_specified? || pre?)
96
+ unless package.prerelease_specified? || pre?
97
97
  a_pre = a.prerelease?
98
98
  b_pre = b.prerelease?
99
99
 
@@ -90,7 +90,7 @@ module Bundler
90
90
 
91
91
  Gem::Specification.reset # invalidate gem specification cache so that installed gems are immediately available
92
92
 
93
- lock unless Bundler.frozen_bundle?
93
+ lock
94
94
  Standalone.new(options[:standalone], @definition).generate if options[:standalone]
95
95
  end
96
96
  end
@@ -122,7 +122,7 @@ module Bundler
122
122
  end
123
123
 
124
124
  def to_s
125
- @__to_s ||= if platform == Gem::Platform::RUBY
125
+ @to_s ||= if platform == Gem::Platform::RUBY
126
126
  "#{name} (#{version})"
127
127
  else
128
128
  "#{name} (#{version}-#{platform})"
@@ -26,6 +26,7 @@ module Bundler
26
26
  KNOWN_SECTIONS = SECTIONS_BY_VERSION_INTRODUCED.values.flatten.freeze
27
27
 
28
28
  ENVIRONMENT_VERSION_SECTIONS = [BUNDLED, RUBY].freeze
29
+ deprecate_constant(:ENVIRONMENT_VERSION_SECTIONS)
29
30
 
30
31
  def self.sections_in_lockfile(lockfile_contents)
31
32
  lockfile_contents.scan(/^\w[\w ]*$/).uniq
@@ -13,7 +13,7 @@
13
13
  alias: \fBpackage\fR, \fBpack\fR
14
14
  .
15
15
  .SH "DESCRIPTION"
16
- Copy all of the \fB\.gem\fR files needed to run the application into the \fBvendor/cache\fR directory\. In the future, when running [bundle install(1)][bundle\-install], use the gems in the cache in preference to the ones on \fBrubygems\.org\fR\.
16
+ Copy all of the \fB\.gem\fR files needed to run the application into the \fBvendor/cache\fR directory\. In the future, when running \fBbundle install(1)\fR \fIbundle\-install\.1\.html\fR, use the gems in the cache in preference to the ones on \fBrubygems\.org\fR\.
17
17
  .
18
18
  .SH "GIT AND PATH GEMS"
19
19
  The \fBbundle cache\fR command can also package \fB:git\fR and \fB:path\fR dependencies besides \.gem files\. This needs to be explicitly enabled via the \fB\-\-all\fR option\. Once used, the \fB\-\-all\fR option will be remembered\.
@@ -22,7 +22,7 @@ The \fBbundle cache\fR command can also package \fB:git\fR and \fB:path\fR depen
22
22
  When using gems that have different packages for different platforms, Bundler supports caching of gems for other platforms where the Gemfile has been resolved (i\.e\. present in the lockfile) in \fBvendor/cache\fR\. This needs to be enabled via the \fB\-\-all\-platforms\fR option\. This setting will be remembered in your local bundler configuration\.
23
23
  .
24
24
  .SH "REMOTE FETCHING"
25
- By default, if you run \fBbundle install(1)\fR](bundle\-install\.1\.html) after running bundle cache(1) \fIbundle\-cache\.1\.html\fR, bundler will still connect to \fBrubygems\.org\fR to check whether a platform\-specific gem exists for any of the gems in \fBvendor/cache\fR\.
25
+ By default, if you run \fBbundle install(1)\fR \fIbundle\-install\.1\.html\fR after running bundle cache(1) \fIbundle\-cache\.1\.html\fR, bundler will still connect to \fBrubygems\.org\fR to check whether a platform\-specific gem exists for any of the gems in \fBvendor/cache\fR\.
26
26
  .
27
27
  .P
28
28
  For instance, consider this Gemfile(5):
@@ -10,7 +10,7 @@ alias: `package`, `pack`
10
10
  ## DESCRIPTION
11
11
 
12
12
  Copy all of the `.gem` files needed to run the application into the
13
- `vendor/cache` directory. In the future, when running [bundle install(1)][bundle-install],
13
+ `vendor/cache` directory. In the future, when running [`bundle install(1)`](bundle-install.1.html),
14
14
  use the gems in the cache in preference to the ones on `rubygems.org`.
15
15
 
16
16
  ## GIT AND PATH GEMS
@@ -29,7 +29,7 @@ bundler configuration.
29
29
 
30
30
  ## REMOTE FETCHING
31
31
 
32
- By default, if you run `bundle install(1)`](bundle-install.1.html) after running
32
+ By default, if you run [`bundle install(1)`](bundle-install.1.html) after running
33
33
  [bundle cache(1)](bundle-cache.1.html), bundler will still connect to `rubygems.org`
34
34
  to check whether a platform-specific gem exists for any of the gems
35
35
  in `vendor/cache`.
@@ -35,9 +35,7 @@ module Bundler
35
35
  end
36
36
 
37
37
  def delete(specs)
38
- specs.each do |spec|
39
- @base.delete(spec)
40
- end
38
+ @base.delete(specs)
41
39
  end
42
40
 
43
41
  def get_package(name)
@@ -107,7 +107,7 @@ module Bundler
107
107
  ruby_engine_version = RUBY_ENGINE == "ruby" ? ruby_version : RUBY_ENGINE_VERSION.dup
108
108
  patchlevel = RUBY_PATCHLEVEL.to_s
109
109
 
110
- @ruby_version ||= RubyVersion.new(ruby_version, patchlevel, ruby_engine, ruby_engine_version)
110
+ @system ||= RubyVersion.new(ruby_version, patchlevel, ruby_engine, ruby_engine_version)
111
111
  end
112
112
 
113
113
  private
@@ -66,7 +66,9 @@ module Gem
66
66
 
67
67
  alias_method :rg_extension_dir, :extension_dir
68
68
  def extension_dir
69
- @bundler_extension_dir ||= if source.respond_to?(:extension_dir_name)
69
+ # following instance variable is already used in original method
70
+ # and that is the reason to prefix it with bundler_ and add rubocop exception
71
+ @bundler_extension_dir ||= if source.respond_to?(:extension_dir_name) # rubocop:disable Naming/MemoizedInstanceVariableName
70
72
  unique_extension_dir = [source.extension_dir_name, File.basename(full_gem_path)].uniq.join("-")
71
73
  File.expand_path(File.join(extensions_dir, unique_extension_dir))
72
74
  else
@@ -203,9 +205,9 @@ module Gem
203
205
  protected
204
206
 
205
207
  def _requirements_sorted?
206
- return @_are_requirements_sorted if defined?(@_are_requirements_sorted)
208
+ return @_requirements_sorted if defined?(@_requirements_sorted)
207
209
  strings = as_list
208
- @_are_requirements_sorted = strings == strings.sort
210
+ @_requirements_sorted = strings == strings.sort
209
211
  end
210
212
 
211
213
  def _with_sorted_requirements
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bundler
4
+ module SafeMarshal
5
+ ALLOWED_CLASSES = [
6
+ Array,
7
+ FalseClass,
8
+ Gem::Specification,
9
+ Gem::Version,
10
+ Hash,
11
+ String,
12
+ Symbol,
13
+ Time,
14
+ TrueClass,
15
+ ].freeze
16
+
17
+ ERROR = "Unexpected class %s present in marshaled data. Only %s are allowed."
18
+
19
+ PROC = proc do |object|
20
+ object.tap do
21
+ unless ALLOWED_CLASSES.include?(object.class)
22
+ raise TypeError, format(ERROR, object.class, ALLOWED_CLASSES.join(", "))
23
+ end
24
+ end
25
+ end
26
+
27
+ def self.proc
28
+ PROC
29
+ end
30
+ end
31
+ end
@@ -219,7 +219,6 @@ module Bundler
219
219
  def path
220
220
  configs.each do |_level, settings|
221
221
  path = value_for("path", settings)
222
- path = "vendor/bundle" if value_for("deployment", settings) && path.nil?
223
222
  path_system = value_for("path.system", settings)
224
223
  disabled_shared_gems = value_for("disable_shared_gems", settings)
225
224
  next if path.nil? && path_system.nil? && disabled_shared_gems.nil?
@@ -227,7 +226,9 @@ module Bundler
227
226
  return Path.new(path, system_path)
228
227
  end
229
228
 
230
- Path.new(nil, false)
229
+ path = "vendor/bundle" if self[:deployment]
230
+
231
+ Path.new(path, false)
231
232
  end
232
233
 
233
234
  Path = Struct.new(:explicit_path, :system_path) do
@@ -7,12 +7,10 @@ module Bundler
7
7
  class Rubygems < Source
8
8
  autoload :Remote, File.expand_path("rubygems/remote", __dir__)
9
9
 
10
- # Use the API when installing less than X gems
11
- API_REQUEST_LIMIT = 500
12
10
  # Ask for X gems per API request
13
11
  API_REQUEST_SIZE = 50
14
12
 
15
- attr_reader :remotes, :caches
13
+ attr_reader :remotes
16
14
 
17
15
  def initialize(options = {})
18
16
  @options = options
@@ -21,11 +19,14 @@ module Bundler
21
19
  @allow_remote = false
22
20
  @allow_cached = false
23
21
  @allow_local = options["allow_local"] || false
24
- @caches = [cache_path, *Bundler.rubygems.gem_cache]
25
22
 
26
23
  Array(options["remotes"]).reverse_each {|r| add_remote(r) }
27
24
  end
28
25
 
26
+ def caches
27
+ @caches ||= [cache_path, *Bundler.rubygems.gem_cache]
28
+ end
29
+
29
30
  def local_only!
30
31
  @specs = nil
31
32
  @allow_local = true
@@ -326,9 +327,9 @@ module Bundler
326
327
 
327
328
  def cached_path(spec)
328
329
  global_cache_path = download_cache_path(spec)
329
- @caches << global_cache_path if global_cache_path
330
+ caches << global_cache_path if global_cache_path
330
331
 
331
- possibilities = @caches.map {|p| package_path(p, spec) }
332
+ possibilities = caches.map {|p| package_path(p, spec) }
332
333
  possibilities.find {|p| File.exist?(p) }
333
334
  end
334
335
 
@@ -401,12 +402,11 @@ module Bundler
401
402
  # gather lists from non-api sites
402
403
  fetch_names(index_fetchers, nil, idx, false)
403
404
 
404
- # because ensuring we have all the gems we need involves downloading
405
- # the gemspecs of those gems, if the non-api sites contain more than
406
- # about 500 gems, we treat all sites as non-api for speed.
407
- allow_api = idx.size < API_REQUEST_LIMIT && dependency_names.size < API_REQUEST_LIMIT
408
- Bundler.ui.debug "Need to query more than #{API_REQUEST_LIMIT} gems." \
409
- " Downloading full index instead..." unless allow_api
405
+ # legacy multi-remote sources need special logic to figure out
406
+ # dependency names and that logic can be very costly if one remote
407
+ # uses the dependency API but others don't. So use full indexes
408
+ # consistently in that particular case.
409
+ allow_api = !multiple_remotes?
410
410
 
411
411
  fetch_names(api_fetchers, allow_api && dependency_names, idx, false)
412
412
  end
@@ -63,8 +63,8 @@ module Bundler
63
63
  @sorted = nil
64
64
  end
65
65
 
66
- def delete(spec)
67
- @specs.delete(spec)
66
+ def delete(specs)
67
+ specs.each {|spec| @specs.delete(spec) }
68
68
  @lookup = nil
69
69
  @sorted = nil
70
70
  end
@@ -7,9 +7,5 @@ require "<%= config[:namespaced_path] %>"
7
7
  # You can add fixtures and/or initialization code here to make experimenting
8
8
  # with your gem easier. You can also use a different console, if you like.
9
9
 
10
- # (If you use this, don't forget to add pry to your Gemfile!)
11
- # require "pry"
12
- # Pry.start
13
-
14
10
  require "irb"
15
11
  IRB.start(__FILE__)
@@ -2,4 +2,9 @@
2
2
 
3
3
  require "mkmf"
4
4
 
5
+ # Makes all symbols private by default to avoid unintended conflict
6
+ # with other gems. To explicitly export symbols you can use RUBY_FUNC_EXPORTED
7
+ # selectively, or entirely remove this flag.
8
+ append_cflags("-fvisibility=hidden")
9
+
5
10
  create_makefile(<%= config[:makefile_path].inspect %>)
@@ -2,7 +2,7 @@
2
2
 
3
3
  VALUE rb_m<%= config[:constant_array].join %>;
4
4
 
5
- void
5
+ RUBY_FUNC_EXPORTED void
6
6
  Init_<%= config[:underscored_name] %>(void)
7
7
  {
8
8
  rb_m<%= config[:constant_array].join %> = rb_define_module(<%= config[:constant_name].inspect %>);
@@ -29,7 +29,8 @@ Gem::Specification.new do |spec|
29
29
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
30
30
  spec.files = Dir.chdir(__dir__) do
31
31
  `git ls-files -z`.split("\x0").reject do |f|
32
- (File.expand_path(f) == __FILE__) || f.start_with?(*%w[bin/ test/ spec/ features/ .git .circleci appveyor])
32
+ (File.expand_path(f) == __FILE__) ||
33
+ f.start_with?(*%w[bin/ test/ spec/ features/ .git .circleci appveyor Gemfile])
33
34
  end
34
35
  end
35
36
  spec.bindir = "exe"
@@ -162,7 +162,7 @@ module Bundler::PubGrub
162
162
  def resolve_conflict(incompatibility)
163
163
  logger.info { "conflict: #{incompatibility}" }
164
164
 
165
- new_incompatibility = false
165
+ new_incompatibility = nil
166
166
 
167
167
  while !incompatibility.failure?
168
168
  most_recent_term = nil
@@ -204,7 +204,7 @@ module Bundler::PubGrub
204
204
  solution.backtrack(previous_level)
205
205
 
206
206
  if new_incompatibility
207
- add_incompatibility(incompatibility)
207
+ add_incompatibility(new_incompatibility)
208
208
  end
209
209
 
210
210
  return incompatibility
@@ -219,9 +219,14 @@ module Bundler::PubGrub
219
219
  new_terms << difference.invert
220
220
  end
221
221
 
222
- incompatibility = Incompatibility.new(new_terms, cause: Incompatibility::ConflictCause.new(incompatibility, most_recent_satisfier.cause))
222
+ new_incompatibility = Incompatibility.new(new_terms, cause: Incompatibility::ConflictCause.new(incompatibility, most_recent_satisfier.cause))
223
223
 
224
- new_incompatibility = true
224
+ if incompatibility.to_s == new_incompatibility.to_s
225
+ logger.info { "!! failed to resolve conflicts, this shouldn't have happened" }
226
+ break
227
+ end
228
+
229
+ incompatibility = new_incompatibility
225
230
 
226
231
  partially = difference ? " partially" : ""
227
232
  logger.info { "! #{most_recent_term} is#{partially} satisfied by #{most_recent_satisfier.term}" }
@@ -2,8 +2,8 @@
2
2
  module Bundler::URI
3
3
  class RFC3986_Parser # :nodoc:
4
4
  # Bundler::URI defined in RFC3986
5
- RFC3986_URI = /\A(?<Bundler::URI>(?<scheme>[A-Za-z][+\-.0-9A-Za-z]*):(?<hier-part>\/\/(?<authority>(?:(?<userinfo>(?:%\h\h|[!$&-.0-;=A-Z_a-z~])*)@)?(?<host>(?<IP-literal>\[(?:(?<IPv6address>(?:\h{1,4}:){6}(?<ls32>\h{1,4}:\h{1,4}|(?<IPv4address>(?<dec-octet>[1-9]\d|1\d{2}|2[0-4]\d|25[0-5]|\d)\.\g<dec-octet>\.\g<dec-octet>\.\g<dec-octet>))|::(?:\h{1,4}:){5}\g<ls32>|\h{1,4}?::(?:\h{1,4}:){4}\g<ls32>|(?:(?:\h{1,4}:)?\h{1,4})?::(?:\h{1,4}:){3}\g<ls32>|(?:(?:\h{1,4}:){,2}\h{1,4})?::(?:\h{1,4}:){2}\g<ls32>|(?:(?:\h{1,4}:){,3}\h{1,4})?::\h{1,4}:\g<ls32>|(?:(?:\h{1,4}:){,4}\h{1,4})?::\g<ls32>|(?:(?:\h{1,4}:){,5}\h{1,4})?::\h{1,4}|(?:(?:\h{1,4}:){,6}\h{1,4})?::)|(?<IPvFuture>v\h+\.[!$&-.0-;=A-Z_a-z~]+))\])|\g<IPv4address>|(?<reg-name>(?:%\h\h|[!$&-.0-9;=A-Z_a-z~])*))(?::(?<port>\d*))?)(?<path-abempty>(?:\/(?<segment>(?:%\h\h|[!$&-.0-;=@-Z_a-z~])*))*)|(?<path-absolute>\/(?:(?<segment-nz>(?:%\h\h|[!$&-.0-;=@-Z_a-z~])+)(?:\/\g<segment>)*)?)|(?<path-rootless>\g<segment-nz>(?:\/\g<segment>)*)|(?<path-empty>))(?:\?(?<query>[^#]*))?(?:\#(?<fragment>(?:%\h\h|[!$&-.0-;=@-Z_a-z~\/?])*))?)\z/
6
- RFC3986_relative_ref = /\A(?<relative-ref>(?<relative-part>\/\/(?<authority>(?:(?<userinfo>(?:%\h\h|[!$&-.0-;=A-Z_a-z~])*)@)?(?<host>(?<IP-literal>\[(?:(?<IPv6address>(?:\h{1,4}:){6}(?<ls32>\h{1,4}:\h{1,4}|(?<IPv4address>(?<dec-octet>[1-9]\d|1\d{2}|2[0-4]\d|25[0-5]|\d)\.\g<dec-octet>\.\g<dec-octet>\.\g<dec-octet>))|::(?:\h{1,4}:){5}\g<ls32>|\h{1,4}?::(?:\h{1,4}:){4}\g<ls32>|(?:(?:\h{1,4}:){,1}\h{1,4})?::(?:\h{1,4}:){3}\g<ls32>|(?:(?:\h{1,4}:){,2}\h{1,4})?::(?:\h{1,4}:){2}\g<ls32>|(?:(?:\h{1,4}:){,3}\h{1,4})?::\h{1,4}:\g<ls32>|(?:(?:\h{1,4}:){,4}\h{1,4})?::\g<ls32>|(?:(?:\h{1,4}:){,5}\h{1,4})?::\h{1,4}|(?:(?:\h{1,4}:){,6}\h{1,4})?::)|(?<IPvFuture>v\h+\.[!$&-.0-;=A-Z_a-z~]+))\])|\g<IPv4address>|(?<reg-name>(?:%\h\h|[!$&-.0-9;=A-Z_a-z~])+))?(?::(?<port>\d*))?)(?<path-abempty>(?:\/(?<segment>(?:%\h\h|[!$&-.0-;=@-Z_a-z~])*))*)|(?<path-absolute>\/(?:(?<segment-nz>(?:%\h\h|[!$&-.0-;=@-Z_a-z~])+)(?:\/\g<segment>)*)?)|(?<path-noscheme>(?<segment-nz-nc>(?:%\h\h|[!$&-.0-9;=@-Z_a-z~])+)(?:\/\g<segment>)*)|(?<path-empty>))(?:\?(?<query>[^#]*))?(?:\#(?<fragment>(?:%\h\h|[!$&-.0-;=@-Z_a-z~\/?])*))?)\z/
5
+ RFC3986_URI = /\A(?<Bundler::URI>(?<scheme>[A-Za-z][+\-.0-9A-Za-z]*+):(?<hier-part>\/\/(?<authority>(?:(?<userinfo>(?:%\h\h|[!$&-.0-;=A-Z_a-z~])*+)@)?(?<host>(?<IP-literal>\[(?:(?<IPv6address>(?:\h{1,4}:){6}(?<ls32>\h{1,4}:\h{1,4}|(?<IPv4address>(?<dec-octet>[1-9]\d|1\d{2}|2[0-4]\d|25[0-5]|\d)\.\g<dec-octet>\.\g<dec-octet>\.\g<dec-octet>))|::(?:\h{1,4}:){5}\g<ls32>|\h{1,4}?::(?:\h{1,4}:){4}\g<ls32>|(?:(?:\h{1,4}:)?\h{1,4})?::(?:\h{1,4}:){3}\g<ls32>|(?:(?:\h{1,4}:){,2}\h{1,4})?::(?:\h{1,4}:){2}\g<ls32>|(?:(?:\h{1,4}:){,3}\h{1,4})?::\h{1,4}:\g<ls32>|(?:(?:\h{1,4}:){,4}\h{1,4})?::\g<ls32>|(?:(?:\h{1,4}:){,5}\h{1,4})?::\h{1,4}|(?:(?:\h{1,4}:){,6}\h{1,4})?::)|(?<IPvFuture>v\h++\.[!$&-.0-;=A-Z_a-z~]++))\])|\g<IPv4address>|(?<reg-name>(?:%\h\h|[!$&-.0-9;=A-Z_a-z~])*+))(?::(?<port>\d*+))?)(?<path-abempty>(?:\/(?<segment>(?:%\h\h|[!$&-.0-;=@-Z_a-z~])*+))*+)|(?<path-absolute>\/(?:(?<segment-nz>(?:%\h\h|[!$&-.0-;=@-Z_a-z~])++)(?:\/\g<segment>)*+)?)|(?<path-rootless>\g<segment-nz>(?:\/\g<segment>)*+)|(?<path-empty>))(?:\?(?<query>[^#]*+))?(?:\#(?<fragment>(?:%\h\h|[!$&-.0-;=@-Z_a-z~\/?])*+))?)\z/
6
+ RFC3986_relative_ref = /\A(?<relative-ref>(?<relative-part>\/\/(?<authority>(?:(?<userinfo>(?:%\h\h|[!$&-.0-;=A-Z_a-z~])*+)@)?(?<host>(?<IP-literal>\[(?:(?<IPv6address>(?:\h{1,4}:){6}(?<ls32>\h{1,4}:\h{1,4}|(?<IPv4address>(?<dec-octet>[1-9]\d|1\d{2}|2[0-4]\d|25[0-5]|\d)\.\g<dec-octet>\.\g<dec-octet>\.\g<dec-octet>))|::(?:\h{1,4}:){5}\g<ls32>|\h{1,4}?::(?:\h{1,4}:){4}\g<ls32>|(?:(?:\h{1,4}:){,1}\h{1,4})?::(?:\h{1,4}:){3}\g<ls32>|(?:(?:\h{1,4}:){,2}\h{1,4})?::(?:\h{1,4}:){2}\g<ls32>|(?:(?:\h{1,4}:){,3}\h{1,4})?::\h{1,4}:\g<ls32>|(?:(?:\h{1,4}:){,4}\h{1,4})?::\g<ls32>|(?:(?:\h{1,4}:){,5}\h{1,4})?::\h{1,4}|(?:(?:\h{1,4}:){,6}\h{1,4})?::)|(?<IPvFuture>v\h++\.[!$&-.0-;=A-Z_a-z~]++))\])|\g<IPv4address>|(?<reg-name>(?:%\h\h|[!$&-.0-9;=A-Z_a-z~])++))?(?::(?<port>\d*+))?)(?<path-abempty>(?:\/(?<segment>(?:%\h\h|[!$&-.0-;=@-Z_a-z~])*+))*+)|(?<path-absolute>\/(?:(?<segment-nz>(?:%\h\h|[!$&-.0-;=@-Z_a-z~])++)(?:\/\g<segment>)*+)?)|(?<path-noscheme>(?<segment-nz-nc>(?:%\h\h|[!$&-.0-9;=@-Z_a-z~])++)(?:\/\g<segment>)*+)|(?<path-empty>))(?:\?(?<query>[^#]*+))?(?:\#(?<fragment>(?:%\h\h|[!$&-.0-;=@-Z_a-z~\/?])*+))?)\z/
7
7
  attr_reader :regexp
8
8
 
9
9
  def initialize
@@ -1,6 +1,6 @@
1
1
  module Bundler::URI
2
2
  # :stopdoc:
3
- VERSION_CODE = '001200'.freeze
3
+ VERSION_CODE = '001201'.freeze
4
4
  VERSION = VERSION_CODE.scan(/../).collect{|n| n.to_i}.join('.').freeze
5
5
  # :startdoc:
6
6
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.4.10".freeze
4
+ VERSION = "2.4.14".freeze
5
5
 
6
6
  def self.bundler_major_version
7
7
  @bundler_major_version ||= VERSION.split(".").first.to_i