rubygems-update 3.5.18 → 3.5.20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +46 -0
  3. data/Manifest.txt +10 -0
  4. data/bundler/CHANGELOG.md +41 -0
  5. data/bundler/lib/bundler/build_metadata.rb +2 -2
  6. data/bundler/lib/bundler/cli/add.rb +1 -1
  7. data/bundler/lib/bundler/cli/gem.rb +4 -1
  8. data/bundler/lib/bundler/cli/install.rb +5 -1
  9. data/bundler/lib/bundler/cli/lock.rb +5 -5
  10. data/bundler/lib/bundler/cli/outdated.rb +16 -18
  11. data/bundler/lib/bundler/definition.rb +4 -8
  12. data/bundler/lib/bundler/dsl.rb +27 -17
  13. data/bundler/lib/bundler/errors.rb +7 -5
  14. data/bundler/lib/bundler/fetcher.rb +2 -2
  15. data/bundler/lib/bundler/inline.rb +19 -4
  16. data/bundler/lib/bundler/installer/gem_installer.rb +4 -2
  17. data/bundler/lib/bundler/installer/parallel_installer.rb +3 -2
  18. data/bundler/lib/bundler/installer.rb +9 -11
  19. data/bundler/lib/bundler/man/bundle-add.1 +27 -16
  20. data/bundler/lib/bundler/man/bundle-add.1.ronn +37 -14
  21. data/bundler/lib/bundler/man/bundle-binstubs.1 +1 -1
  22. data/bundler/lib/bundler/man/bundle-cache.1 +1 -1
  23. data/bundler/lib/bundler/man/bundle-check.1 +1 -1
  24. data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
  25. data/bundler/lib/bundler/man/bundle-config.1 +1 -1
  26. data/bundler/lib/bundler/man/bundle-console.1 +1 -1
  27. data/bundler/lib/bundler/man/bundle-doctor.1 +1 -1
  28. data/bundler/lib/bundler/man/bundle-exec.1 +1 -1
  29. data/bundler/lib/bundler/man/bundle-gem.1 +1 -1
  30. data/bundler/lib/bundler/man/bundle-help.1 +1 -1
  31. data/bundler/lib/bundler/man/bundle-info.1 +1 -1
  32. data/bundler/lib/bundler/man/bundle-init.1 +1 -1
  33. data/bundler/lib/bundler/man/bundle-inject.1 +1 -1
  34. data/bundler/lib/bundler/man/bundle-install.1 +1 -1
  35. data/bundler/lib/bundler/man/bundle-list.1 +1 -1
  36. data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
  37. data/bundler/lib/bundler/man/bundle-open.1 +1 -1
  38. data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
  39. data/bundler/lib/bundler/man/bundle-platform.1 +1 -1
  40. data/bundler/lib/bundler/man/bundle-plugin.1 +1 -1
  41. data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
  42. data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
  43. data/bundler/lib/bundler/man/bundle-show.1 +1 -1
  44. data/bundler/lib/bundler/man/bundle-update.1 +1 -1
  45. data/bundler/lib/bundler/man/bundle-version.1 +1 -1
  46. data/bundler/lib/bundler/man/bundle-viz.1 +1 -1
  47. data/bundler/lib/bundler/man/bundle.1 +1 -1
  48. data/bundler/lib/bundler/man/gemfile.5 +3 -1
  49. data/bundler/lib/bundler/man/gemfile.5.ronn +6 -0
  50. data/bundler/lib/bundler/retry.rb +1 -1
  51. data/bundler/lib/bundler/ruby_version.rb +7 -1
  52. data/bundler/lib/bundler/rubygems_ext.rb +43 -16
  53. data/bundler/lib/bundler/rubygems_gem_installer.rb +4 -3
  54. data/bundler/lib/bundler/self_manager.rb +4 -4
  55. data/bundler/lib/bundler/source/git.rb +15 -6
  56. data/bundler/lib/bundler/source/rubygems.rb +5 -12
  57. data/bundler/lib/bundler/ui/shell.rb +24 -2
  58. data/bundler/lib/bundler/ui/silent.rb +12 -1
  59. data/bundler/lib/bundler/vendor/securerandom/.document +1 -0
  60. data/bundler/lib/bundler/vendor/securerandom/LICENSE.txt +22 -0
  61. data/bundler/lib/bundler/vendor/securerandom/lib/random/formatter.rb +373 -0
  62. data/bundler/lib/bundler/vendor/securerandom/lib/securerandom.rb +96 -0
  63. data/bundler/lib/bundler/vendored_securerandom.rb +14 -0
  64. data/bundler/lib/bundler/version.rb +1 -1
  65. data/bundler/lib/bundler.rb +1 -1
  66. data/lib/rubygems/commands/exec_command.rb +1 -6
  67. data/lib/rubygems/commands/fetch_command.rb +14 -0
  68. data/lib/rubygems/commands/install_command.rb +0 -4
  69. data/lib/rubygems/commands/setup_command.rb +2 -0
  70. data/lib/rubygems/exceptions.rb +2 -3
  71. data/lib/rubygems/installer.rb +1 -1
  72. data/lib/rubygems/remote_fetcher.rb +0 -1
  73. data/lib/rubygems/resolver/activation_request.rb +1 -1
  74. data/lib/rubygems/resolver/best_set.rb +2 -28
  75. data/lib/rubygems/source/git.rb +7 -5
  76. data/lib/rubygems/source/installed.rb +3 -1
  77. data/lib/rubygems/source/local.rb +8 -4
  78. data/lib/rubygems/source/specific_file.rb +5 -3
  79. data/lib/rubygems/source.rb +10 -8
  80. data/lib/rubygems/specification.rb +1 -1
  81. data/lib/rubygems/specification_policy.rb +1 -1
  82. data/lib/rubygems/vendor/molinillo/lib/molinillo/resolution.rb +1 -1
  83. data/lib/rubygems/vendor/net-http/lib/net/https.rb +1 -1
  84. data/lib/rubygems/vendor/optparse/lib/optparse.rb +1 -1
  85. data/lib/rubygems/vendor/resolv/lib/resolv.rb +71 -16
  86. data/lib/rubygems/vendor/securerandom/.document +1 -0
  87. data/lib/rubygems/vendor/securerandom/LICENSE.txt +22 -0
  88. data/lib/rubygems/vendor/securerandom/lib/random/formatter.rb +373 -0
  89. data/lib/rubygems/vendor/securerandom/lib/securerandom.rb +96 -0
  90. data/lib/rubygems/vendored_securerandom.rb +4 -0
  91. data/lib/rubygems.rb +18 -15
  92. data/rubygems-update.gemspec +1 -1
  93. metadata +13 -3
@@ -63,6 +63,17 @@ then repackaging it.
63
63
 
64
64
  def execute
65
65
  check_version
66
+
67
+ exit_code = fetch_gems
68
+
69
+ terminate_interaction exit_code
70
+ end
71
+
72
+ private
73
+
74
+ def fetch_gems
75
+ exit_code = 0
76
+
66
77
  version = options[:version]
67
78
 
68
79
  platform = Gem.platforms.last
@@ -86,10 +97,13 @@ then repackaging it.
86
97
 
87
98
  if spec.nil?
88
99
  show_lookup_failure gem_name, gem_version, errors, suppress_suggestions, options[:domain]
100
+ exit_code |= 2
89
101
  next
90
102
  end
91
103
  source.download spec
92
104
  say "Downloaded #{spec.full_name}"
93
105
  end
106
+
107
+ exit_code
94
108
  end
95
109
  end
@@ -224,10 +224,6 @@ You can use `i` command instead of `install`.
224
224
  rescue Gem::InstallError => e
225
225
  alert_error "Error installing #{gem_name}:\n\t#{e.message}"
226
226
  exit_code |= 1
227
- rescue Gem::GemNotFoundException => e
228
- show_lookup_failure e.name, e.version, e.errors, suppress_suggestions
229
-
230
- exit_code |= 2
231
227
  rescue Gem::UnsatisfiableDependencyError => e
232
228
  show_lookup_failure e.name, e.version, e.errors, suppress_suggestions,
233
229
  "'#{gem_name}' (#{gem_version})"
@@ -340,6 +340,8 @@ By default, this RubyGems will install gem as:
340
340
 
341
341
  require_relative "../rdoc"
342
342
 
343
+ return false unless defined?(Gem::RDoc)
344
+
343
345
  fake_spec = Gem::Specification.new "rubygems", Gem::VERSION
344
346
  def fake_spec.full_gem_path
345
347
  File.expand_path "../../..", __dir__
@@ -104,9 +104,6 @@ end
104
104
 
105
105
  class Gem::GemNotFoundException < Gem::Exception; end
106
106
 
107
- ##
108
- # Raised by the DependencyInstaller when a specific gem cannot be found
109
-
110
107
  class Gem::SpecificGemNotFoundException < Gem::GemNotFoundException
111
108
  ##
112
109
  # Creates a new SpecificGemNotFoundException for a gem with the given +name+
@@ -137,6 +134,8 @@ class Gem::SpecificGemNotFoundException < Gem::GemNotFoundException
137
134
  attr_reader :errors
138
135
  end
139
136
 
137
+ Gem.deprecate_constant :SpecificGemNotFoundException
138
+
140
139
  ##
141
140
  # Raised by Gem::Resolver when dependencies conflict and create the
142
141
  # inability to find a valid possible spec for a request.
@@ -538,7 +538,7 @@ class Gem::Installer
538
538
  def generate_bin_script(filename, bindir)
539
539
  bin_script_path = File.join bindir, formatted_program_filename(filename)
540
540
 
541
- Gem.open_file_with_flock("#{bin_script_path}.lock") do
541
+ Gem.open_file_with_lock(bin_script_path) do
542
542
  require "fileutils"
543
543
  FileUtils.rm_f bin_script_path # prior install may have been --no-wrappers
544
544
 
@@ -75,7 +75,6 @@ class Gem::RemoteFetcher
75
75
  def initialize(proxy=nil, dns=nil, headers={})
76
76
  require_relative "core_ext/tcpsocket_init" if Gem.configuration.ipv4_fallback_enabled
77
77
  require_relative "vendored_net_http"
78
- require "stringio"
79
78
  require_relative "vendor/uri/lib/uri"
80
79
 
81
80
  Socket.do_not_reverse_lookup = true
@@ -106,7 +106,7 @@ class Gem::Resolver::ActivationRequest
106
106
  this_spec = full_spec
107
107
 
108
108
  Gem::Specification.any? do |s|
109
- s == this_spec
109
+ s == this_spec && s.base_dir == this_spec.base_dir
110
110
  end
111
111
  end
112
112
  end
@@ -29,10 +29,8 @@ class Gem::Resolver::BestSet < Gem::Resolver::ComposedSet
29
29
  pick_sets if @remote && @sets.empty?
30
30
 
31
31
  super
32
- rescue Gem::RemoteFetcher::FetchError => e
33
- replace_failed_api_set e
34
-
35
- retry
32
+ rescue Gem::RemoteFetcher::FetchError
33
+ []
36
34
  end
37
35
 
38
36
  def prefetch(reqs) # :nodoc:
@@ -50,28 +48,4 @@ class Gem::Resolver::BestSet < Gem::Resolver::ComposedSet
50
48
  q.pp @sets
51
49
  end
52
50
  end
53
-
54
- ##
55
- # Replaces a failed APISet for the URI in +error+ with an IndexSet.
56
- #
57
- # If no matching APISet can be found the original +error+ is raised.
58
- #
59
- # The calling method must retry the exception to repeat the lookup.
60
-
61
- def replace_failed_api_set(error) # :nodoc:
62
- uri = error.original_uri
63
- uri = Gem::URI uri unless Gem::URI === uri
64
- uri += "."
65
-
66
- raise error unless api_set = @sets.find do |set|
67
- Gem::Resolver::APISet === set && set.dep_uri == uri
68
- end
69
-
70
- index_set = Gem::Resolver::IndexSet.new api_set.source
71
-
72
- @sets.map! do |set|
73
- next set unless set == api_set
74
- index_set
75
- end
76
- end
77
51
  end
@@ -157,12 +157,14 @@ class Gem::Source::Git < Gem::Source
157
157
  end
158
158
 
159
159
  def pretty_print(q) # :nodoc:
160
- q.group 2, "[Git: ", "]" do
161
- q.breakable
162
- q.text @repository
160
+ q.object_group(self) do
161
+ q.group 2, "[Git: ", "]" do
162
+ q.breakable
163
+ q.text @repository
163
164
 
164
- q.breakable
165
- q.text @reference
165
+ q.breakable
166
+ q.text @reference
167
+ end
166
168
  end
167
169
  end
168
170
 
@@ -32,6 +32,8 @@ class Gem::Source::Installed < Gem::Source
32
32
  end
33
33
 
34
34
  def pretty_print(q) # :nodoc:
35
- q.text "[Installed]"
35
+ q.object_group(self) do
36
+ q.text "[Installed]"
37
+ end
36
38
  end
37
39
  end
@@ -117,10 +117,14 @@ class Gem::Source::Local < Gem::Source
117
117
  end
118
118
 
119
119
  def pretty_print(q) # :nodoc:
120
- q.group 2, "[Local gems:", "]" do
121
- q.breakable
122
- q.seplist @specs.keys do |v|
123
- q.text v.full_name
120
+ q.object_group(self) do
121
+ q.group 2, "[Local gems:", "]" do
122
+ q.breakable
123
+ if @specs
124
+ q.seplist @specs.keys do |v|
125
+ q.text v.full_name
126
+ end
127
+ end
124
128
  end
125
129
  end
126
130
  end
@@ -42,9 +42,11 @@ class Gem::Source::SpecificFile < Gem::Source
42
42
  end
43
43
 
44
44
  def pretty_print(q) # :nodoc:
45
- q.group 2, "[SpecificFile:", "]" do
46
- q.breakable
47
- q.text @path
45
+ q.object_group(self) do
46
+ q.group 2, "[SpecificFile:", "]" do
47
+ q.breakable
48
+ q.text @path
49
+ end
48
50
  end
49
51
  end
50
52
 
@@ -79,7 +79,7 @@ class Gem::Source
79
79
  uri
80
80
  end
81
81
 
82
- bundler_api_uri = enforce_trailing_slash(fetch_uri)
82
+ bundler_api_uri = enforce_trailing_slash(fetch_uri) + "versions"
83
83
 
84
84
  begin
85
85
  fetcher = Gem::RemoteFetcher.fetcher
@@ -213,14 +213,16 @@ class Gem::Source
213
213
  end
214
214
 
215
215
  def pretty_print(q) # :nodoc:
216
- q.group 2, "[Remote:", "]" do
217
- q.breakable
218
- q.text @uri.to_s
219
-
220
- if api = uri
216
+ q.object_group(self) do
217
+ q.group 2, "[Remote:", "]" do
221
218
  q.breakable
222
- q.text "API URI: "
223
- q.text api.to_s
219
+ q.text @uri.to_s
220
+
221
+ if api = uri
222
+ q.breakable
223
+ q.text "API URI: "
224
+ q.text api.to_s
225
+ end
224
226
  end
225
227
  end
226
228
  end
@@ -1318,7 +1318,7 @@ class Gem::Specification < Gem::BasicSpecification
1318
1318
  spec.instance_variable_set :@has_rdoc, array[15]
1319
1319
  spec.instance_variable_set :@new_platform, array[16]
1320
1320
  spec.instance_variable_set :@platform, array[16].to_s
1321
- spec.instance_variable_set :@license, array[17]
1321
+ spec.instance_variable_set :@licenses, [array[17]]
1322
1322
  spec.instance_variable_set :@metadata, array[18]
1323
1323
  spec.instance_variable_set :@loaded, false
1324
1324
  spec.instance_variable_set :@activated, false
@@ -307,7 +307,7 @@ duplicate dependency on #{dep}, (#{prev.requirement}) use:
307
307
  elsif !VALID_NAME_PATTERN.match?(name)
308
308
  error "invalid value for attribute name: #{name.dump} can only include letters, numbers, dashes, and underscores"
309
309
  elsif SPECIAL_CHARACTERS.match?(name)
310
- error "invalid value for attribute name: #{name.dump} can not begin with a period, dash, or underscore"
310
+ error "invalid value for attribute name: #{name.dump} cannot begin with a period, dash, or underscore"
311
311
  end
312
312
  end
313
313
 
@@ -103,7 +103,7 @@ module Gem::Molinillo
103
103
 
104
104
  # @return [Boolean] where the requirement of the state we're unwinding
105
105
  # to directly caused the conflict. Note: in this case, it is
106
- # impossible for the state we're unwinding to to be a parent of
106
+ # impossible for the state we're unwinding to be a parent of
107
107
  # any of the other conflicting requirements (or we would have
108
108
  # circularity)
109
109
  def unwinding_to_primary_requirement?
@@ -4,7 +4,7 @@
4
4
  = net/https -- SSL/TLS enhancement for Gem::Net::HTTP.
5
5
 
6
6
  This file has been merged with net/http. There is no longer any need to
7
- require 'rubygems/vendor/net-http/lib/net/https' to use HTTPS.
7
+ require_relative 'https' to use HTTPS.
8
8
 
9
9
  See Gem::Net::HTTP for details on how to make HTTPS connections.
10
10
 
@@ -1084,7 +1084,7 @@ XXX
1084
1084
  Switch::OptionalArgument.new do |pkg|
1085
1085
  if pkg
1086
1086
  begin
1087
- require 'rubygems/vendor/optparse/lib/optparse/version'
1087
+ require_relative 'optparse/version'
1088
1088
  rescue LoadError
1089
1089
  else
1090
1090
  show_version(*pkg.split(/,/)) or
@@ -5,7 +5,7 @@ require_relative '../../timeout/lib/timeout'
5
5
  require 'io/wait'
6
6
 
7
7
  begin
8
- require 'securerandom'
8
+ require_relative '../../../vendored_securerandom'
9
9
  rescue LoadError
10
10
  end
11
11
 
@@ -37,7 +37,7 @@ end
37
37
 
38
38
  class Gem::Resolv
39
39
 
40
- VERSION = "0.3.0"
40
+ VERSION = "0.4.0"
41
41
 
42
42
  ##
43
43
  # Looks up the first IP address for +name+.
@@ -194,17 +194,10 @@ class Gem::Resolv
194
194
  File.open(@filename, 'rb') {|f|
195
195
  f.each {|line|
196
196
  line.sub!(/#.*/, '')
197
- addr, hostname, *aliases = line.split(/\s+/)
197
+ addr, *hostnames = line.split(/\s+/)
198
198
  next unless addr
199
- @addr2name[addr] = [] unless @addr2name.include? addr
200
- @addr2name[addr] << hostname
201
- @addr2name[addr].concat(aliases)
202
- @name2addr[hostname] = [] unless @name2addr.include? hostname
203
- @name2addr[hostname] << addr
204
- aliases.each {|n|
205
- @name2addr[n] = [] unless @name2addr.include? n
206
- @name2addr[n] << addr
207
- }
199
+ (@addr2name[addr] ||= []).concat(hostnames)
200
+ hostnames.each {|hostname| (@name2addr[hostname] ||= []) << addr}
208
201
  }
209
202
  }
210
203
  @name2addr.each {|name, arr| arr.reverse!}
@@ -609,10 +602,10 @@ class Gem::Resolv
609
602
  }
610
603
  end
611
604
 
612
- if defined? SecureRandom
605
+ if defined? Gem::SecureRandom
613
606
  def self.random(arg) # :nodoc:
614
607
  begin
615
- SecureRandom.random_number(arg)
608
+ Gem::SecureRandom.random_number(arg)
616
609
  rescue NotImplementedError
617
610
  rand(arg)
618
611
  end
@@ -2544,8 +2537,70 @@ class Gem::Resolv
2544
2537
  TypeValue = 255 # :nodoc:
2545
2538
  end
2546
2539
 
2540
+ ##
2541
+ # CAA resource record defined in RFC 8659
2542
+ #
2543
+ # These records identify certificate authority allowed to issue
2544
+ # certificates for the given domain.
2545
+
2546
+ class CAA < Resource
2547
+ TypeValue = 257
2548
+
2549
+ ##
2550
+ # Creates a new CAA for +flags+, +tag+ and +value+.
2551
+
2552
+ def initialize(flags, tag, value)
2553
+ unless (0..255) === flags
2554
+ raise ArgumentError.new('flags must be an Integer between 0 and 255')
2555
+ end
2556
+ unless (1..15) === tag.bytesize
2557
+ raise ArgumentError.new('length of tag must be between 1 and 15')
2558
+ end
2559
+
2560
+ @flags = flags
2561
+ @tag = tag
2562
+ @value = value
2563
+ end
2564
+
2565
+ ##
2566
+ # Flags for this proprty:
2567
+ # - Bit 0 : 0 = not critical, 1 = critical
2568
+
2569
+ attr_reader :flags
2570
+
2571
+ ##
2572
+ # Property tag ("issue", "issuewild", "iodef"...).
2573
+
2574
+ attr_reader :tag
2575
+
2576
+ ##
2577
+ # Property value.
2578
+
2579
+ attr_reader :value
2580
+
2581
+ ##
2582
+ # Whether the critical flag is set on this property.
2583
+
2584
+ def critical?
2585
+ flags & 0x80 != 0
2586
+ end
2587
+
2588
+ def encode_rdata(msg) # :nodoc:
2589
+ msg.put_pack('C', @flags)
2590
+ msg.put_string(@tag)
2591
+ msg.put_bytes(@value)
2592
+ end
2593
+
2594
+ def self.decode_rdata(msg) # :nodoc:
2595
+ flags, = msg.get_unpack('C')
2596
+ tag = msg.get_string
2597
+ value = msg.get_bytes
2598
+ self.new flags, tag, value
2599
+ end
2600
+ end
2601
+
2547
2602
  ClassInsensitiveTypes = [ # :nodoc:
2548
- NS, CNAME, SOA, PTR, HINFO, MINFO, MX, TXT, LOC, ANY
2603
+ NS, CNAME, SOA, PTR, HINFO, MINFO, MX, TXT, LOC, ANY, CAA
2549
2604
  ]
2550
2605
 
2551
2606
  ##
@@ -2771,7 +2826,7 @@ class Gem::Resolv
2771
2826
  attr_reader :target
2772
2827
 
2773
2828
  ##
2774
- # The service paramters for the target host.
2829
+ # The service parameters for the target host.
2775
2830
 
2776
2831
  attr_reader :params
2777
2832
 
@@ -0,0 +1 @@
1
+ # Vendored files do not need to be documented
@@ -0,0 +1,22 @@
1
+ Copyright (C) 1993-2013 Yukihiro Matsumoto. All rights reserved.
2
+
3
+ Redistribution and use in source and binary forms, with or without
4
+ modification, are permitted provided that the following conditions
5
+ are met:
6
+ 1. Redistributions of source code must retain the above copyright
7
+ notice, this list of conditions and the following disclaimer.
8
+ 2. Redistributions in binary form must reproduce the above copyright
9
+ notice, this list of conditions and the following disclaimer in the
10
+ documentation and/or other materials provided with the distribution.
11
+
12
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
13
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15
+ ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
16
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
17
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
18
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
19
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
20
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
21
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
22
+ SUCH DAMAGE.