summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSHIBATA Hiroshi <hsbt@ruby-lang.org>2017-03-10 11:07:09 +0900
committerSHIBATA Hiroshi <hsbt@ruby-lang.org>2017-03-27 10:10:44 +0900
commitc984a2c7dfc79234d7375442ccfb6d51a363e783 (patch)
tree6b58649a6c9211779775f4b8aee2882c6ff9052a
parent3f3da6561bdc73714060519a5c505c6d39391851 (diff)
downloadpsych-c984a2c7dfc79234d7375442ccfb6d51a363e783.zip
Remove Psych.read_type_class
-rw-r--r--lib/psych/deprecated.rb10
-rw-r--r--test/psych/test_deprecated.rb12
2 files changed, 0 insertions, 22 deletions
diff --git a/lib/psych/deprecated.rb b/lib/psych/deprecated.rb
index bab453c..adb3fc9 100644
--- a/lib/psych/deprecated.rb
+++ b/lib/psych/deprecated.rb
@@ -15,16 +15,6 @@ module Psych
"tag:yaml.org,2002:#{thing}"
end
- def self.read_type_class type, reference
- warn "#{caller[0]}: read_type_class is deprecated" if $VERBOSE
- _, _, type, name = type.split ':', 4
-
- reference = name.split('::').inject(reference) do |k,n|
- k.const_get(n.to_sym)
- end if name
- [type, reference]
- end
-
def self.object_maker klass, hash
warn "#{caller[0]}: object_maker is deprecated" if $VERBOSE
klass.allocate.tap do |obj|
diff --git a/test/psych/test_deprecated.rb b/test/psych/test_deprecated.rb
index 1cfaab4..47cf984 100644
--- a/test/psych/test_deprecated.rb
+++ b/test/psych/test_deprecated.rb
@@ -128,18 +128,6 @@ module Psych
assert_equal 'tag:yaml.org,2002:foo', Psych.tagurize('foo')
end
- def test_read_type_class
- things = Psych.read_type_class 'tag:yaml.org,2002:int:Psych::TestDeprecated::QuickEmitter', Object
- assert_equal 'int', things.first
- assert_equal Psych::TestDeprecated::QuickEmitter, things.last
- end
-
- def test_read_type_class_no_class
- things = Psych.read_type_class 'tag:yaml.org,2002:int', Object
- assert_equal 'int', things.first
- assert_equal Object, things.last
- end
-
def test_object_maker
thing = Psych.object_maker(Object, { 'a' => 'b', 'c' => 'd' })
assert_instance_of(Object, thing)