ruby-changes:64512
From: Marc-Andre <ko1@a...>
Date: Wed, 23 Dec 2020 15:09:05 +0900 (JST)
Subject: [ruby-changes:64512] 3ee0ad9190 (master): [ruby/psych] Don't use instance variables directly for config
https://git.ruby-lang.org/ruby.git/commit/?id=3ee0ad9190 From 3ee0ad919034fbc098939979c872d041a82c4334 Mon Sep 17 00:00:00 2001 From: Marc-Andre Lafortune <github@m...> Date: Mon, 21 Dec 2020 20:01:54 -0500 Subject: [ruby/psych] Don't use instance variables directly for config diff --git a/ext/psych/lib/psych.rb b/ext/psych/lib/psych.rb index 347160e..0b62362 100644 --- a/ext/psych/lib/psych.rb +++ b/ext/psych/lib/psych.rb @@ -595,28 +595,25 @@ module Psych https://github.com/ruby/ruby/blob/trunk/ext/psych/lib/psych.rb#L595 end # :stopdoc: - @domain_types = {} def self.add_domain_type domain, type_tag, &block key = ['tag', domain, type_tag].join ':' - @domain_types[key] = [key, block] - @domain_types["tag:#{type_tag}"] = [key, block] + domain_types[key] = [key, block] + domain_types["tag:#{type_tag}"] = [key, block] end def self.add_builtin_type type_tag, &block domain = 'yaml.org,2002' key = ['tag', domain, type_tag].join ':' - @domain_types[key] = [key, block] + domain_types[key] = [key, block] end def self.remove_type type_tag - @domain_types.delete type_tag + domain_types.delete type_tag end - @load_tags = {} - @dump_tags = {} def self.add_tag tag, klass - @load_tags[tag] = klass.name - @dump_tags[klass] = tag + load_tags[tag] = klass.name + dump_tags[klass] = tag end # Workaround for emulating `warn '...', uplevel: 1` in Ruby 2.4 or lower. @@ -639,5 +636,8 @@ module Psych https://github.com/ruby/ruby/blob/trunk/ext/psych/lib/psych.rb#L636 attr_accessor :dump_tags attr_accessor :domain_types end + self.load_tags = {} + self.dump_tags = {} + self.domain_types = {} # :startdoc: end -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/