summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorJean Boussier <[email protected]>2025-05-03 12:57:39 +0200
committerHiroshi SHIBATA <[email protected]>2025-05-08 18:03:04 +0900
commit1f2a9dc2a912118e77ec9f01e9ad4002ccde52b5 ()
tree4a4defceb58af3fbb3beaf15e0d08d5402d93775 /ext
parent49b4e0350d1a55f9372760b0b164039c7535b85e (diff)
[ruby/psych] Refine Ruby 3.5 Set support.
Use feature testing to detect native Set, and don't rely on `Set#to_h` which wasn't intended as a public method. https://.com/ruby/psych/commit/d58cff11af
-rw-r--r--ext/psych/lib/psych.rb3
-rw-r--r--ext/psych/lib/psych/core_ext.rb15
2 files changed, 13 insertions, 5 deletions
@@ -23,7 +23,6 @@ require_relative 'psych/parser'
require_relative 'psych/omap'
require_relative 'psych/set'
require_relative 'psych/coder'
-require_relative 'psych/core_ext'
require_relative 'psych/stream'
require_relative 'psych/json/tree_builder'
require_relative 'psych/json/stream'
@@ -761,3 +760,5 @@ module Psych
self.domain_types = {}
# :startdoc:
end
@@ -18,12 +18,19 @@ if defined?(::IRB)
require_relative 'y'
end
-
-# TODO: how best to check for builtin Set?
-if defined?(::Set) && Object.const_source_location(:Set) == ["ruby", 0]
class Set
def encode_with(coder)
- coder["hash"] = to_h
end
def init_with(coder)