Skip to content

Commit

Permalink
Fix support for Ruby 3.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
stevegeek committed Feb 25, 2024
1 parent 03bed19 commit d18f5f0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/vident/stable_id.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# frozen_string_literal: true

require "random/formatter"
begin
# Introduced in Ruby 3.1
require "random/formatter"
rescue LoadError
# to support Ruby 3.0
require "securerandom"
end

module Vident
class StableId
Expand Down

0 comments on commit d18f5f0

Please sign in to comment.