From 2d9c05441220ec5079925994b074380a78d50d8a Mon Sep 17 00:00:00 2001 From: tenderlove Date: Sat, 24 Apr 2010 20:35:20 +0000 Subject: * ext/psych/lib/psych/deprecated.rb: adding support for deprecated "add_private_type" function * ext/psych/lib/psych.rb: ditto * ext/psych/lib/psych/visitors/to_ruby.rb: ditto * test/psych/test_deprecated.rb: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27480 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/psych/lib/psych/deprecated.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'ext/psych/lib/psych/deprecated.rb') diff --git a/ext/psych/lib/psych/deprecated.rb b/ext/psych/lib/psych/deprecated.rb index fdff46845d..b306b85bce 100644 --- a/ext/psych/lib/psych/deprecated.rb +++ b/ext/psych/lib/psych/deprecated.rb @@ -36,6 +36,20 @@ module Psych return 'null' if '' == thing ScalarScanner.new.tokenize(thing).class.name.downcase end + + def self.add_ruby_type type_tag, &block + warn "#{caller[0]}: add_ruby_type is deprecated, use add_domain_type" if $VERBOSE + domain = 'ruby.yaml.org,2002' + key = ['tag', domain, type_tag].join ':' + @domain_types[key] = [key, block] + end + + def self.add_private_type type_tag, &block + warn "#{caller[0]}: add_private_type is deprecated, use add_domain_type" if $VERBOSE + domain = 'x-private' + key = [domain, type_tag].join ':' + @domain_types[key] = [key, block] + end end class Object -- cgit v1.2.3