diff options
author | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-05-15 16:25:39 +0000 |
---|---|---|
committer | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-05-15 16:25:39 +0000 |
commit | 4616913dc5a23132bafe60ea36d07bd3b440316f (patch) | |
tree | 3a1499a72dad0f6102006b5c47529b5abd3601fc /ext | |
parent | dec4e1cd2db6c11143900f017c8d6453a33c1161 (diff) | |
download | ruby-4616913dc5a23132bafe60ea36d07bd3b440316f.tar.gz |
* ext/psych/lib/psych/visitors/yaml_tree.rb: only emit warnings when
-w is enabled.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r-- | ext/psych/lib/psych/visitors/yaml_tree.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/psych/lib/psych/visitors/yaml_tree.rb b/ext/psych/lib/psych/visitors/yaml_tree.rb index bb5331ce4c..a9f8df9e60 100644 --- a/ext/psych/lib/psych/visitors/yaml_tree.rb +++ b/ext/psych/lib/psych/visitors/yaml_tree.rb @@ -50,7 +50,9 @@ module Psych def self.new emitter = nil, ss = nil, options = nil return super if emitter && ss && options - warn "This API is deprecated, please pass an emitter, scalar scanner, and options or call #{self.class}.create() (#{caller.first})" + if $VERBOSE + warn "This API is deprecated, please pass an emitter, scalar scanner, and options or call #{self.class}.create() (#{caller.first})" + end create emitter, ss end |