rubygems-update 3.6.7 → 3.6.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fabd6b3a8c9a1227a3e8ff908a04bf28135b91899339425536dbec5559ce3dc1
4
- data.tar.gz: ec941700bc4d70da0affb1585808eaacc4031a325fa2d2fc06d4d5575cef051b
3
+ metadata.gz: a27b88f13655c46ac4a7e221526bba0507a4abb98fa767dae209ce8d5ee43a80
4
+ data.tar.gz: 4abec332a0660f5f8bda5f727e1e2b0f28fbb14f3d8739213a8ddb3eb7fee9cf
5
5
  SHA512:
6
- metadata.gz: 219a1de618e568af684eadc59945d7f773e0fcb5e1e9c55510c8c2401911bf41a22f546414b0f01a24f4adabc8ba4cf28fc05078b817c49bf737601b1ca4925d
7
- data.tar.gz: 5cb299dedf5e3eda38a970205e5354a326964efe7d70fc53b9444a4982c96dc0852d693cc3e1833e41a633bc13eec86f430e7e1d13da7b67676eceecc14d32dd
6
+ metadata.gz: 9e2c1e36afe7b9c34738b7e675d9a8eacaa7de0b748abe9abe8dcb02ac12201b66d6e7d65991608f1b3e9258307241c8b04d4f378dfabd3c1dcc234d4b041ba6
7
+ data.tar.gz: 171f85c2ef9b011cf049d8f415481ff7543723409a60ba30ab77caca83ee545db50d3fa1b3f18d4863d39cfcf44d8175f38b2319c24aaca5357479b56e09d4a6
data/CHANGELOG.md CHANGED
@@ -1,3 +1,33 @@
1
+ # 3.6.9 / 2025-05-13
2
+
3
+ ## Enhancements:
4
+
5
+ * Add mtime to Gem::Package::TarWriter#add_file argument. Pull request
6
+ [#8673](https://github.com/rubygems/rubygems/pull/8673) by unasuke
7
+ * Print webauthn authentication link as a separate line to make it easier
8
+ to visit. Pull request
9
+ [#8663](https://github.com/rubygems/rubygems/pull/8663) by mperham
10
+ * Remove shellwords autoload. Pull request
11
+ [#8644](https://github.com/rubygems/rubygems/pull/8644) by
12
+ deivid-rodriguez
13
+ * Installs bundler 2.6.9 as a default gem.
14
+
15
+ ## Performance:
16
+
17
+ * Avoid unnecessary splat allocation. Pull request
18
+ [#8640](https://github.com/rubygems/rubygems/pull/8640) by jeremyevans
19
+
20
+ ## Documentation:
21
+
22
+ * Fix typo in Changelog for 3.6.0 / 2024-12-16. Pull request
23
+ [#8638](https://github.com/rubygems/rubygems/pull/8638) by thatrobotdev
24
+
25
+ # 3.6.8 / 2025-04-13
26
+
27
+ ## Enhancements:
28
+
29
+ * Installs bundler 2.6.8 as a default gem.
30
+
1
31
  # 3.6.7 / 2025-04-03
2
32
 
3
33
  ## Enhancements:
@@ -166,7 +196,7 @@
166
196
 
167
197
  * Fix missing single quote in git source example. Pull request
168
198
  [#8303](https://github.com/rubygems/rubygems/pull/8303) by nobu
169
- * Update the `gem install` demo in REAME to use a gem that just works on
199
+ * Update the `gem install` demo in README to use a gem that just works on
170
200
  Windows. Pull request
171
201
  [#8262](https://github.com/rubygems/rubygems/pull/8262) by soda92
172
202
  * Unify rubygems and bundler docs directory. Pull request
data/Manifest.txt CHANGED
@@ -26,6 +26,8 @@ bundler/lib/bundler/cli/common.rb
26
26
  bundler/lib/bundler/cli/config.rb
27
27
  bundler/lib/bundler/cli/console.rb
28
28
  bundler/lib/bundler/cli/doctor.rb
29
+ bundler/lib/bundler/cli/doctor/diagnose.rb
30
+ bundler/lib/bundler/cli/doctor/ssl.rb
29
31
  bundler/lib/bundler/cli/exec.rb
30
32
  bundler/lib/bundler/cli/fund.rb
31
33
  bundler/lib/bundler/cli/gem.rb
@@ -518,7 +520,6 @@ lib/rubygems/security/policy.rb
518
520
  lib/rubygems/security/signer.rb
519
521
  lib/rubygems/security/trust_dir.rb
520
522
  lib/rubygems/security_option.rb
521
- lib/rubygems/shellwords.rb
522
523
  lib/rubygems/source.rb
523
524
  lib/rubygems/source/git.rb
524
525
  lib/rubygems/source/installed.rb
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # RubyGems [![Maintainability](https://api.codeclimate.com/v1/badges/30f913e9c2dd932132c1/maintainability)](https://codeclimate.com/github/rubygems/rubygems/maintainability)
1
+ # RubyGems
2
2
 
3
3
  RubyGems is a package management framework for Ruby.
4
4
 
data/bundler/CHANGELOG.md CHANGED
@@ -1,3 +1,28 @@
1
+ # 2.6.9 (May 13, 2025)
2
+
3
+ ## Enhancements:
4
+
5
+ - Fix doctor command parsing of otool output [#8665](https://github.com/rubygems/rubygems/pull/8665)
6
+ - Add SSL troubleshooting to `bundle doctor` [#8624](https://github.com/rubygems/rubygems/pull/8624)
7
+ - Let `bundle lock --normalize-platforms` remove invalid platforms [#8631](https://github.com/rubygems/rubygems/pull/8631)
8
+
9
+ ## Bug fixes:
10
+
11
+ - Fix `bundle lock` sometimes allowing invalid platforms into the lockfile [#8630](https://github.com/rubygems/rubygems/pull/8630)
12
+ - Fix false positive warning about insecure materialization in frozen mode [#8629](https://github.com/rubygems/rubygems/pull/8629)
13
+
14
+ # 2.6.8 (April 13, 2025)
15
+
16
+ ## Enhancements:
17
+
18
+ - Refine `bundle update --verbose` logs [#8627](https://github.com/rubygems/rubygems/pull/8627)
19
+ - Improve bug report instructions [#8607](https://github.com/rubygems/rubygems/pull/8607)
20
+
21
+ ## Bug fixes:
22
+
23
+ - Fix `bundle update` crash in an edge case [#8626](https://github.com/rubygems/rubygems/pull/8626)
24
+ - Fix `bundle lock --normalize-platforms` regression [#8620](https://github.com/rubygems/rubygems/pull/8620)
25
+
1
26
  # 2.6.7 (April 3, 2025)
2
27
 
3
28
  ## Enhancements:
@@ -5,7 +5,7 @@ module Bundler
5
5
  module BuildMetadata
6
6
  # begin ivars
7
7
  @built_at = "1980-01-02".freeze
8
- @git_commit_sha = "32896b3570e".freeze
8
+ @git_commit_sha = "8a2a14d63da".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -0,0 +1,167 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rbconfig"
4
+ require "shellwords"
5
+
6
+ module Bundler
7
+ class CLI::Doctor::Diagnose
8
+ DARWIN_REGEX = /\s+(.+) \(compatibility /
9
+ LDD_REGEX = /\t\S+ => (\S+) \(\S+\)/
10
+
11
+ attr_reader :options
12
+
13
+ def initialize(options)
14
+ @options = options
15
+ end
16
+
17
+ def otool_available?
18
+ Bundler.which("otool")
19
+ end
20
+
21
+ def ldd_available?
22
+ Bundler.which("ldd")
23
+ end
24
+
25
+ def dylibs_darwin(path)
26
+ output = `/usr/bin/otool -L #{path.shellescape}`.chomp
27
+ dylibs = output.split("\n")[1..-1].filter_map {|l| l.match(DARWIN_REGEX)&.match(1) }.uniq
28
+ # ignore @rpath and friends
29
+ dylibs.reject {|dylib| dylib.start_with? "@" }
30
+ end
31
+
32
+ def dylibs_ldd(path)
33
+ output = `/usr/bin/ldd #{path.shellescape}`.chomp
34
+ output.split("\n").filter_map do |l|
35
+ match = l.match(LDD_REGEX)
36
+ next if match.nil?
37
+ match.captures[0]
38
+ end
39
+ end
40
+
41
+ def dylibs(path)
42
+ case RbConfig::CONFIG["host_os"]
43
+ when /darwin/
44
+ return [] unless otool_available?
45
+ dylibs_darwin(path)
46
+ when /(linux|solaris|bsd)/
47
+ return [] unless ldd_available?
48
+ dylibs_ldd(path)
49
+ else # Windows, etc.
50
+ Bundler.ui.warn("Dynamic library check not supported on this platform.")
51
+ []
52
+ end
53
+ end
54
+
55
+ def bundles_for_gem(spec)
56
+ Dir.glob("#{spec.full_gem_path}/**/*.bundle")
57
+ end
58
+
59
+ def lookup_with_fiddle(path)
60
+ require "fiddle"
61
+ Fiddle.dlopen(path)
62
+ false
63
+ rescue Fiddle::DLError
64
+ true
65
+ end
66
+
67
+ def check!
68
+ require_relative "../check"
69
+ Bundler::CLI::Check.new({}).run
70
+ end
71
+
72
+ def diagnose_ssl
73
+ require_relative "ssl"
74
+ Bundler::CLI::Doctor::SSL.new({}).run
75
+ end
76
+
77
+ def run
78
+ Bundler.ui.level = "warn" if options[:quiet]
79
+ Bundler.settings.validate!
80
+ check!
81
+ diagnose_ssl if options[:ssl]
82
+
83
+ definition = Bundler.definition
84
+ broken_links = {}
85
+
86
+ definition.specs.each do |spec|
87
+ bundles_for_gem(spec).each do |bundle|
88
+ bad_paths = dylibs(bundle).select do |f|
89
+ lookup_with_fiddle(f)
90
+ end
91
+ if bad_paths.any?
92
+ broken_links[spec] ||= []
93
+ broken_links[spec].concat(bad_paths)
94
+ end
95
+ end
96
+ end
97
+
98
+ permissions_valid = check_home_permissions
99
+
100
+ if broken_links.any?
101
+ message = "The following gems are missing OS dependencies:"
102
+ broken_links.flat_map do |spec, paths|
103
+ paths.uniq.map do |path|
104
+ "\n * #{spec.name}: #{path}"
105
+ end
106
+ end.sort.each {|m| message += m }
107
+ raise ProductionError, message
108
+ elsif permissions_valid
109
+ Bundler.ui.info "No issues found with the installed bundle"
110
+ end
111
+ end
112
+
113
+ private
114
+
115
+ def check_home_permissions
116
+ require "find"
117
+ files_not_readable = []
118
+ files_not_readable_and_owned_by_different_user = []
119
+ files_not_owned_by_current_user_but_still_readable = []
120
+ broken_symlinks = []
121
+ Find.find(Bundler.bundle_path.to_s).each do |f|
122
+ if !File.exist?(f)
123
+ broken_symlinks << f
124
+ elsif !File.readable?(f)
125
+ if File.stat(f).uid != Process.uid
126
+ files_not_readable_and_owned_by_different_user << f
127
+ else
128
+ files_not_readable << f
129
+ end
130
+ elsif File.stat(f).uid != Process.uid
131
+ files_not_owned_by_current_user_but_still_readable << f
132
+ end
133
+ end
134
+
135
+ ok = true
136
+
137
+ if broken_symlinks.any?
138
+ Bundler.ui.warn "Broken links exist in the Bundler home. Please report them to the offending gem's upstream repo. These files are:\n - #{broken_symlinks.join("\n - ")}"
139
+
140
+ ok = false
141
+ end
142
+
143
+ if files_not_owned_by_current_user_but_still_readable.any?
144
+ Bundler.ui.warn "Files exist in the Bundler home that are owned by another " \
145
+ "user, but are still readable. These files are:\n - #{files_not_owned_by_current_user_but_still_readable.join("\n - ")}"
146
+
147
+ ok = false
148
+ end
149
+
150
+ if files_not_readable_and_owned_by_different_user.any?
151
+ Bundler.ui.warn "Files exist in the Bundler home that are owned by another " \
152
+ "user, and are not readable. These files are:\n - #{files_not_readable_and_owned_by_different_user.join("\n - ")}"
153
+
154
+ ok = false
155
+ end
156
+
157
+ if files_not_readable.any?
158
+ Bundler.ui.warn "Files exist in the Bundler home that are not " \
159
+ "readable by the current user. These files are:\n - #{files_not_readable.join("\n - ")}"
160
+
161
+ ok = false
162
+ end
163
+
164
+ ok
165
+ end
166
+ end
167
+ end
@@ -0,0 +1,249 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rubygems/remote_fetcher"
4
+ require "uri"
5
+
6
+ module Bundler
7
+ class CLI::Doctor::SSL
8
+ attr_reader :options
9
+
10
+ def initialize(options)
11
+ @options = options
12
+ end
13
+
14
+ def run
15
+ return unless openssl_installed?
16
+
17
+ output_ssl_environment
18
+ bundler_success = bundler_connection_successful?
19
+ rubygem_success = rubygem_connection_successful?
20
+
21
+ return unless net_http_connection_successful?
22
+
23
+ Explanation.summarize(bundler_success, rubygem_success, host)
24
+ end
25
+
26
+ private
27
+
28
+ def host
29
+ @options[:host] || "rubygems.org"
30
+ end
31
+
32
+ def tls_version
33
+ @options[:"tls-version"].then do |version|
34
+ "TLS#{version.sub(".", "_")}".to_sym if version
35
+ end
36
+ end
37
+
38
+ def verify_mode
39
+ mode = @options[:"verify-mode"] || :peer
40
+
41
+ @verify_mode ||= mode.then {|mod| OpenSSL::SSL.const_get("verify_#{mod}".upcase) }
42
+ end
43
+
44
+ def uri
45
+ @uri ||= URI("https://#{host}")
46
+ end
47
+
48
+ def openssl_installed?
49
+ require "openssl"
50
+
51
+ true
52
+ rescue LoadError
53
+ Bundler.ui.warn(<<~MSG)
54
+ Oh no! Your Ruby doesn't have OpenSSL, so it can't connect to #{host}.
55
+ You'll need to recompile or reinstall Ruby with OpenSSL support and try again.
56
+ MSG
57
+
58
+ false
59
+ end
60
+
61
+ def output_ssl_environment
62
+ Bundler.ui.info(<<~MESSAGE)
63
+ Here's your OpenSSL environment:
64
+
65
+ OpenSSL: #{OpenSSL::VERSION}
66
+ Compiled with: #{OpenSSL::OPENSSL_VERSION}
67
+ Loaded with: #{OpenSSL::OPENSSL_LIBRARY_VERSION}
68
+ MESSAGE
69
+ end
70
+
71
+ def bundler_connection_successful?
72
+ Bundler.ui.info("\nTrying connections to #{uri}:\n")
73
+
74
+ bundler_uri = Gem::URI(uri.to_s)
75
+ Bundler::Fetcher.new(
76
+ Bundler::Source::Rubygems::Remote.new(bundler_uri)
77
+ ).send(:connection).request(bundler_uri)
78
+
79
+ Bundler.ui.info("Bundler: success")
80
+
81
+ true
82
+ rescue StandardError => error
83
+ Bundler.ui.warn("Bundler: failed (#{Explanation.explain_bundler_or_rubygems_error(error)})")
84
+
85
+ false
86
+ end
87
+
88
+ def rubygem_connection_successful?
89
+ Gem::RemoteFetcher.fetcher.fetch_path(uri)
90
+ Bundler.ui.info("RubyGems: success")
91
+
92
+ true
93
+ rescue StandardError => error
94
+ Bundler.ui.warn("RubyGems: failed (#{Explanation.explain_bundler_or_rubygems_error(error)})")
95
+
96
+ false
97
+ end
98
+
99
+ def net_http_connection_successful?
100
+ ::Gem::Net::HTTP.new(uri.host, uri.port).tap do |http|
101
+ http.use_ssl = true
102
+ http.min_version = tls_version
103
+ http.max_version = tls_version
104
+ http.verify_mode = verify_mode
105
+ end.start
106
+
107
+ Bundler.ui.info("Ruby net/http: success")
108
+ warn_on_unsupported_tls12
109
+
110
+ true
111
+ rescue StandardError => error
112
+ Bundler.ui.warn(<<~MSG)
113
+ Ruby net/http: failed
114
+
115
+ Unfortunately, this Ruby can't connect to #{host}.
116
+
117
+ #{Explanation.explain_net_http_error(error, host, tls_version)}
118
+ MSG
119
+
120
+ false
121
+ end
122
+
123
+ def warn_on_unsupported_tls12
124
+ ctx = OpenSSL::SSL::SSLContext.new
125
+ supported = true
126
+
127
+ if ctx.respond_to?(:min_version=)
128
+ begin
129
+ ctx.min_version = ctx.max_version = OpenSSL::SSL::TLS1_2_VERSION
130
+ rescue OpenSSL::SSL::SSLError, NameError
131
+ supported = false
132
+ end
133
+ else
134
+ supported = OpenSSL::SSL::SSLContext::METHODS.include?(:TLSv1_2) # rubocop:disable Naming/VariableNumber
135
+ end
136
+
137
+ Bundler.ui.warn(<<~EOM) unless supported
138
+
139
+ WARNING: Although your Ruby can connect to #{host} today, your OpenSSL is very old!
140
+ WARNING: You will need to upgrade OpenSSL to use #{host}.
141
+
142
+ EOM
143
+ end
144
+
145
+ module Explanation
146
+ extend self
147
+
148
+ def explain_bundler_or_rubygems_error(error)
149
+ case error.message
150
+ when /certificate verify failed/
151
+ "certificate verification"
152
+ when /read server hello A/
153
+ "SSL/TLS protocol version mismatch"
154
+ when /tlsv1 alert protocol version/
155
+ "requested TLS version is too old"
156
+ else
157
+ error.message
158
+ end
159
+ end
160
+
161
+ def explain_net_http_error(error, host, tls_version)
162
+ case error.message
163
+ # Check for certificate errors
164
+ when /certificate verify failed/
165
+ <<~MSG
166
+ #{show_ssl_certs}
167
+ Your Ruby can't connect to #{host} because you are missing the certificate files OpenSSL needs to verify you are connecting to the genuine #{host} servers.
168
+ MSG
169
+ # Check for TLS version errors
170
+ when /read server hello A/, /tlsv1 alert protocol version/
171
+ if tls_version.to_s == "TLS1_3"
172
+ "Your Ruby can't connect to #{host} because #{tls_version} isn't supported yet.\n"
173
+ else
174
+ <<~MSG
175
+ Your Ruby can't connect to #{host} because your version of OpenSSL is too old.
176
+ You'll need to upgrade your OpenSSL install and/or recompile Ruby to use a newer OpenSSL.
177
+ MSG
178
+ end
179
+ # OpenSSL doesn't support TLS version specified by argument
180
+ when /unknown SSL method/
181
+ "Your Ruby can't connect because #{tls_version} isn't supported by your version of OpenSSL."
182
+ else
183
+ <<~MSG
184
+ Even worse, we're not sure why.
185
+
186
+ Here's the full error information:
187
+ #{error.class}: #{error.message}
188
+ #{error.backtrace.join("\n ")}
189
+
190
+ You might have more luck using Mislav's SSL doctor.rb script. You can get it here:
191
+ https://github.com/mislav/ssl-tools/blob/8b3dec4/doctor.rb
192
+
193
+ Read more about the script and how to use it in this blog post:
194
+ https://mislav.net/2013/07/ruby-openssl/
195
+ MSG
196
+ end
197
+ end
198
+
199
+ def summarize(bundler_success, rubygems_success, host)
200
+ guide_url = "http://ruby.to/ssl-check-failed"
201
+
202
+ message = if bundler_success && rubygems_success
203
+ <<~MSG
204
+ Hooray! This Ruby can connect to #{host}.
205
+ You are all set to use Bundler and RubyGems.
206
+
207
+ MSG
208
+ elsif !bundler_success && !rubygems_success
209
+ <<~MSG
210
+ For some reason, your Ruby installation can connect to #{host}, but neither RubyGems nor Bundler can.
211
+ The most likely fix is to manually upgrade RubyGems by following the instructions at #{guide_url}.
212
+ After you've done that, run `gem install bundler` to upgrade Bundler, and then run this script again to make sure everything worked. ❣
213
+
214
+ MSG
215
+ elsif !bundler_success
216
+ <<~MSG
217
+ Although your Ruby installation and RubyGems can both connect to #{host}, Bundler is having trouble.
218
+ The most likely way to fix this is to upgrade Bundler by running `gem install bundler`.
219
+ Run this script again after doing that to make sure everything is all set.
220
+ If you're still having trouble, check out the troubleshooting guide at #{guide_url}.
221
+
222
+ MSG
223
+ else
224
+ <<~MSG
225
+ It looks like Ruby and Bundler can connect to #{host}, but RubyGems itself cannot.
226
+ You can likely solve this by manually downloading and installing a RubyGems update.
227
+ Visit #{guide_url} for instructions on how to manually upgrade RubyGems.
228
+
229
+ MSG
230
+ end
231
+
232
+ Bundler.ui.info("\n#{message}")
233
+ end
234
+
235
+ private
236
+
237
+ def show_ssl_certs
238
+ ssl_cert_file = ENV["SSL_CERT_FILE"] || OpenSSL::X509::DEFAULT_CERT_FILE
239
+ ssl_cert_dir = ENV["SSL_CERT_DIR"] || OpenSSL::X509::DEFAULT_CERT_DIR
240
+
241
+ <<~MSG
242
+ Below affect only Ruby net/http connections:
243
+ SSL_CERT_FILE: #{File.exist?(ssl_cert_file) ? "exists #{ssl_cert_file}" : "is missing #{ssl_cert_file}"}
244
+ SSL_CERT_DIR: #{Dir.exist?(ssl_cert_dir) ? "exists #{ssl_cert_dir}" : "is missing #{ssl_cert_dir}"}
245
+ MSG
246
+ end
247
+ end
248
+ end
249
+ end