From 1e7ddfa7eaa9834f958db0646457e00b27ef4976 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Wed, 5 Jul 2023 18:47:41 +0900 Subject: [PATCH] [ruby/psych] Extract accessor methods without forwardable We should leave additional dependency if we leave from them. https://github.com/ruby/psych/commit/3d0325a774 --- ext/psych/lib/psych.rb | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/ext/psych/lib/psych.rb b/ext/psych/lib/psych.rb index 9e21325cff..ae167472f2 100644 --- a/ext/psych/lib/psych.rb +++ b/ext/psych/lib/psych.rb @@ -696,9 +696,6 @@ module Psych class << self if defined?(Ractor) - require 'forwardable' - extend Forwardable - class Config attr_accessor :load_tags, :dump_tags, :domain_types def initialize @@ -712,7 +709,29 @@ module Psych Ractor.current[:PsychConfig] ||= Config.new end - def_delegators :config, :load_tags, :dump_tags, :domain_types, :load_tags=, :dump_tags=, :domain_types= + def load_tags + config.load_tags + end + + def dump_tags + config.dump_tags + end + + def domain_types + config.domain_types + end + + def load_tags=(value) + config.load_tags = value + end + + def dump_tags=(value) + config.dump_tags = value + end + + def domain_types=(value) + config.domain_types = value + end else attr_accessor :load_tags attr_accessor :dump_tags