summaryrefslogtreecommitdiff
path: root/ext/psych/lib/psych
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-24 19:58:34 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-24 19:58:34 +0000
commitb57db764b0856ddae30deed32a104c4016f0ffae (patch)
tree164b0d5823e086607a51793623a8d01e3b2d661e /ext/psych/lib/psych
parent9ac224eb2699d528f7c3544861f02a5255605f4f (diff)
* ext/psych/lib/psych/deprecated.rb: supporting detect_implicit method
* test/psych/test_deprecated.rb: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/psych/lib/psych')
-rw-r--r--ext/psych/lib/psych/deprecated.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/psych/lib/psych/deprecated.rb b/ext/psych/lib/psych/deprecated.rb
index 093f145302..fdff46845d 100644
--- a/ext/psych/lib/psych/deprecated.rb
+++ b/ext/psych/lib/psych/deprecated.rb
@@ -30,6 +30,12 @@ module Psych
list.each(&block)
end
+ def self.detect_implicit thing
+ warn "#{caller[0]}: detect_implicit is deprecated" if $VERBOSE
+ return '' unless String === thing
+ return 'null' if '' == thing
+ ScalarScanner.new.tokenize(thing).class.name.downcase
+ end
end
class Object