Skip to content

Commit b4b7bea

Browse files
Merge pull request #7984 from rubygems/vendor-secure-random
Fix `bundler/inline` failing in Ruby 3.2 due to conflicting `securerandom` versions (cherry picked from commit cf33207)
1 parent 6be8cc4 commit b4b7bea

File tree

13 files changed

+579
-33
lines changed

13 files changed

+579
-33
lines changed

Manifest.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,10 @@ bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_constraint.rb
283283
bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_range.rb
284284
bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb
285285
bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_union.rb
286+
bundler/lib/bundler/vendor/securerandom/.document
287+
bundler/lib/bundler/vendor/securerandom/LICENSE.txt
288+
bundler/lib/bundler/vendor/securerandom/lib/random/formatter.rb
289+
bundler/lib/bundler/vendor/securerandom/lib/securerandom.rb
286290
bundler/lib/bundler/vendor/thor/.document
287291
bundler/lib/bundler/vendor/thor/LICENSE.md
288292
bundler/lib/bundler/vendor/thor/lib/thor.rb
@@ -344,6 +348,7 @@ bundler/lib/bundler/vendored_fileutils.rb
344348
bundler/lib/bundler/vendored_net_http.rb
345349
bundler/lib/bundler/vendored_persistent.rb
346350
bundler/lib/bundler/vendored_pub_grub.rb
351+
bundler/lib/bundler/vendored_securerandom.rb
347352
bundler/lib/bundler/vendored_thor.rb
348353
bundler/lib/bundler/vendored_timeout.rb
349354
bundler/lib/bundler/vendored_tsort.rb
@@ -615,6 +620,7 @@ lib/rubygems/vendor/uri/lib/uri/wss.rb
615620
lib/rubygems/vendored_molinillo.rb
616621
lib/rubygems/vendored_net_http.rb
617622
lib/rubygems/vendored_optparse.rb
623+
lib/rubygems/vendored_securerandom.rb
618624
lib/rubygems/vendored_timeout.rb
619625
lib/rubygems/vendored_tsort.rb
620626
lib/rubygems/version.rb

bundler/lib/bundler/fetcher.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require_relative "vendored_persistent"
44
require_relative "vendored_timeout"
55
require "cgi"
6-
require "securerandom"
6+
require_relative "vendored_securerandom"
77
require "zlib"
88

99
module Bundler
@@ -182,7 +182,7 @@ def user_agent
182182
agent << " ci/#{cis.join(",")}" if cis.any?
183183

184184
# add a random ID so we can consolidate runs server-side
185-
agent << " " << SecureRandom.hex(8)
185+
agent << " " << Gem::SecureRandom.hex(8)
186186

187187
# add any user agent strings set in the config
188188
extra_ua = Bundler.settings[:user_agent]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Vendored files do not need to be documented
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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.

0 commit comments

Comments
 (0)