ruby-changes:15178
From: tenderlove <ko1@a...>
Date: Fri, 26 Mar 2010 12:46:26 +0900 (JST)
Subject: [ruby-changes:15178] Ruby:r27058 (trunk): * lib/yaml/basenode.rb: deprecating YPath methods
tenderlove 2010-03-26 12:42:21 +0900 (Fri, 26 Mar 2010) New Revision: 27058 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=27058 Log: * 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. Modified files: trunk/ChangeLog trunk/lib/yaml/basenode.rb trunk/lib/yaml/stream.rb trunk/test/yaml/test_yaml.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 27057) +++ ChangeLog (revision 27058) @@ -1,3 +1,9 @@ +Fri Mar 26 12:36:10 2010 Aaron Patterson <aaron@t...> + + * lib/yaml/basenode.rb: deprecating YPath methods + + * lib/yaml/stream.rb: deprecating YAML::Stream#edit + Fri Mar 26 12:29:28 2010 Aaron Patterson <aaron@t...> * lib/yaml/encoding.rb: YAML.encode, YAML.decode are deprecated. Index: lib/yaml/basenode.rb =================================================================== --- lib/yaml/basenode.rb (revision 27057) +++ lib/yaml/basenode.rb (revision 27058) @@ -1,7 +1,6 @@ # # YAML::BaseNode class # -require 'yaml/ypath' module YAML @@ -15,6 +14,7 @@ # qualified nodes. # def select( ypath_str ) + warn "#{caller[0]}: select is deprecated" if $VERBOSE matches = match_path( ypath_str ) # @@ -34,6 +34,7 @@ # transformed nodes. # def select!( ypath_str ) + warn "#{caller[0]}: select!() is deprecated" if $VERBOSE matches = match_path( ypath_str ) # @@ -53,6 +54,7 @@ # 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 @@ 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 @@ # 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 @@ # 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 @@ 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 Index: lib/yaml/stream.rb =================================================================== --- lib/yaml/stream.rb (revision 27057) +++ lib/yaml/stream.rb (revision 27058) @@ -21,6 +21,7 @@ end def edit( doc_num, doc ) + warn "#{caller[0]}: edit is deprecated" if $VERBOSE @documents[ doc_num ] = doc end Index: test/yaml/test_yaml.rb =================================================================== --- test/yaml/test_yaml.rb (revision 27057) +++ test/yaml/test_yaml.rb (revision 27058) @@ -4,6 +4,7 @@ # require 'test/unit' require 'yaml' +require 'yaml/ypath' # [ruby-core:01946] module YAML_Tests -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/