diff options
author | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-03-26 03:42:21 +0000 |
---|---|---|
committer | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-03-26 03:42:21 +0000 |
commit | f82b8e76e8151550c4d989bddf4aa07a87930810 (patch) | |
tree | e037abd3a89532cee2b343fb35198a53099cd715 /lib/yaml/basenode.rb | |
parent | e959fda8ff3a45cb60d8fc0459e5de15df9c3c0a (diff) |
* lib/yaml/basenode.rb: deprecating YPath methods
* lib/yaml/stream.rb: deprecating YAML::Stream#edit
* test/yaml/test_yaml.rb: requiring yaml/ypath for tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/yaml/basenode.rb')
-rw-r--r-- | lib/yaml/basenode.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/yaml/basenode.rb b/lib/yaml/basenode.rb index 5439903f42..f92f8c8c3a 100644 --- a/lib/yaml/basenode.rb +++ b/lib/yaml/basenode.rb @@ -1,7 +1,6 @@ # # YAML::BaseNode class # -require 'yaml/ypath' module YAML @@ -15,6 +14,7 @@ module YAML # qualified nodes. # def select( ypath_str ) + warn "#{caller[0]}: select is deprecated" if $VERBOSE matches = match_path( ypath_str ) # @@ -34,6 +34,7 @@ module YAML # transformed nodes. # def select!( ypath_str ) + warn "#{caller[0]}: select!() is deprecated" if $VERBOSE matches = match_path( ypath_str ) # @@ -53,6 +54,7 @@ module YAML # qualified paths. # def search( ypath_str ) + warn "#{caller[0]}: search() is deprecated" if $VERBOSE matches = match_path( ypath_str ) if matches @@ -67,6 +69,7 @@ module YAML end def at( seg ) + warn "#{caller[0]}: at() is deprecated" if $VERBOSE if Hash === @value self[seg] elsif Array === @value and seg =~ /\A\d+\Z/ and @value[seg.to_i] @@ -78,6 +81,8 @@ module YAML # YPath search returning a complete depth array # def match_path( ypath_str ) + warn "#{caller[0]}: match_path is deprecated" if $VERBOSE + require 'yaml/ypath' depth = 0 matches = [] YPath.each_path( ypath_str ) do |ypath| @@ -91,6 +96,7 @@ module YAML # Search a node for a single YPath segment # def match_segment( ypath, depth ) + warn "#{caller[0]}: match_segment is deprecated" if $VERBOSE deep_nodes = [] seg = ypath.segments[ depth ] if seg == "/" @@ -200,6 +206,7 @@ module YAML end def children_with_index + warn "#{caller[0]}: children_with_index is deprecated, use children" if $VERBOSE if Hash === @value @value.keys.collect { |i| [self[i], i] } elsif Array === @value |