diff options
author | SHIBATA Hiroshi <hsbt@ruby-lang.org> | 2017-03-23 10:58:19 +0900 |
---|---|---|
committer | SHIBATA Hiroshi <hsbt@ruby-lang.org> | 2017-03-27 10:12:18 +0900 |
commit | 2cd35187087e4594f84462c0d583c2616e93e8c1 (patch) | |
tree | 5c915f5e6c74897b7496fe6356be0a1aad73b6df | |
parent | f6e4d772ec439b47077a18920cbb4bcb7400c5f1 (diff) | |
download | psych-2cd35187087e4594f84462c0d583c2616e93e8c1.tar.gz |
Removed deprecated yaml_initialize method
-rw-r--r-- | lib/psych/visitors/to_ruby.rb | 5 | ||||
-rw-r--r-- | test/psych/test_deprecated.rb | 24 |
2 files changed, 0 insertions, 29 deletions
diff --git a/lib/psych/visitors/to_ruby.rb b/lib/psych/visitors/to_ruby.rb index fd1c8e6..d1318b3 100644 --- a/lib/psych/visitors/to_ruby.rb +++ b/lib/psych/visitors/to_ruby.rb @@ -380,11 +380,6 @@ module Psych if o.respond_to?(:init_with) o.init_with c - elsif o.respond_to?(:yaml_initialize) - if $VERBOSE - warn "Implementing #{o.class}#yaml_initialize is deprecated, please implement \"init_with(coder)\"" - end - o.yaml_initialize c.tag, c.map else h.each { |k,v| o.instance_variable_set(:"@#{k}", v) } end diff --git a/test/psych/test_deprecated.rb b/test/psych/test_deprecated.rb index d09ff82..3961e36 100644 --- a/test/psych/test_deprecated.rb +++ b/test/psych/test_deprecated.rb @@ -49,30 +49,6 @@ module Psych assert_nil qe.value end - class YamlInit - attr_reader :name - attr_reader :value - - def initialize - @name = 'hello!!' - @value = 'Friday!' - end - - def yaml_initialize tag, vals - vals.each { |ivar, val| instance_variable_set "@#{ivar}", 'TGIF!' } - end - end - - def test_yaml_initialize - hash = { :yi => YamlInit.new } - hash2 = Psych.load Psych.dump hash - yi = hash2[:yi] - - assert_equal 'TGIF!', yi.name - assert_equal 'TGIF!', yi.value - assert_instance_of YamlInit, yi - end - class YamlInitAndInitWith attr_reader :name attr_reader :value |