Skip to content

Commit

Permalink
🐛 Ensure set is loaded in ruby 3.1
Browse files Browse the repository at this point in the history
`set` doesn't need to be explicitly loaded in ruby 3.2+.  Previously, we
loaded it in the tests, so they passed.  But running the actual code
that uses Set could raise an exception.
  • Loading branch information
nevans committed Oct 24, 2024
1 parent cc13c91 commit 43e6a66
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion benchmarks/table-regexps.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
prelude: |
require "json"
require "set"
require "set" unless defined?(::Set)
all_codepoints = (0..0x10ffff).map{_1.chr("UTF-8") rescue nil}.compact
Expand Down
2 changes: 2 additions & 0 deletions lib/net/imap/sequence_set.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

require "set" unless defined?(::Set)

module Net
class IMAP

Expand Down
2 changes: 2 additions & 0 deletions rakelib/string_prep_tables_generator.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

require "set" unless defined?(::Set)

# Generator for stringprep regexps.
#
# Combines Unicode character classes with generated tables. Generated regexps
Expand Down
1 change: 0 additions & 1 deletion test/net/imap/test_sequence_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

require "net/imap"
require "test/unit"
require "set"

class IMAPSequenceSetTest < Test::Unit::TestCase
# alias for convenience
Expand Down
1 change: 0 additions & 1 deletion test/net/imap/test_stringprep_tables.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
require "net/imap"
require "test/unit"
require "json"
require "set"

require_relative "../../../rakelib/string_prep_tables_generator"

Expand Down

0 comments on commit 43e6a66

Please sign in to comment.