From ad3c1061a78f6efe0ee3584d92b3df448da9891f Mon Sep 17 00:00:00 2001 From: tenderlove Date: Tue, 27 Apr 2010 20:19:16 +0000 Subject: * ext/psych/lib/psych/deprecated.rb: adding deprecated "read_type_class" method * test/psych/test_deprecated.rb: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27518 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/psych/lib/psych/deprecated.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'ext') diff --git a/ext/psych/lib/psych/deprecated.rb b/ext/psych/lib/psych/deprecated.rb index 1d401d920f..dd4ca6b68f 100644 --- a/ext/psych/lib/psych/deprecated.rb +++ b/ext/psych/lib/psych/deprecated.rb @@ -56,6 +56,16 @@ module Psych return thing unless String === thing "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 end class Object -- cgit v1.2.3