summaryrefslogtreecommitdiff
path: root/lib/bundler/vendored_securerandom.rb
blob: 6c15f4a2b2aef53bee5584516a58c4d5f12e3555 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# frozen_string_literal: true

# Use RubyGems vendored copy when available. Otherwise fallback to Bundler
# vendored copy. The vendored copy in Bundler can be removed once support for
# RubyGems 3.5.18 is dropped.

begin
  require "rubygems/vendored_securerandom"
rescue LoadError
  module Bundler::Random; end
  require_relative "vendor/securerandom/lib/securerandom"
  Gem::SecureRandom = Bundler::SecureRandom
  Gem::Random = Bundler::Random
end