ruby-changes:17663
From: tenderlove <ko1@a...>
Date: Wed, 3 Nov 2010 06:25:38 +0900 (JST)
Subject: [ruby-changes:17663] Ruby:r29672 (trunk): * ext/psych/lib/psych/visitors/visitor.rb (initialize): push accessor
tenderlove 2010-11-03 06:25:27 +0900 (Wed, 03 Nov 2010) New Revision: 29672 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=29672 Log: * ext/psych/lib/psych/visitors/visitor.rb (initialize): push accessor methods to subclass that actually uses them. Modified files: trunk/ChangeLog trunk/ext/psych/lib/psych/visitors/visitor.rb trunk/ext/psych/lib/psych/visitors/yaml_tree.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 29671) +++ ChangeLog (revision 29672) @@ -1,3 +1,8 @@ +Tue Nov 2 22:50:25 2010 Aaron Patterson <aaron@t...> + + * ext/psych/lib/psych/visitors/visitor.rb (initialize): push accessor + methods to subclass that actually uses them. + Tue Nov 2 22:47:08 2010 Aaron Patterson <aaron@t...> * ext/psych/lib/psych/visitors/visitor.rb (accept): switch to Index: ext/psych/lib/psych/visitors/visitor.rb =================================================================== --- ext/psych/lib/psych/visitors/visitor.rb (revision 29671) +++ ext/psych/lib/psych/visitors/visitor.rb (revision 29672) @@ -1,15 +1,6 @@ module Psych module Visitors class Visitor - attr_reader :started, :finished - alias :finished? :finished - alias :started? :started - - def initialize - @started = false - @finished = false - end - def accept target visit target end Index: ext/psych/lib/psych/visitors/yaml_tree.rb =================================================================== --- ext/psych/lib/psych/visitors/yaml_tree.rb (revision 29671) +++ ext/psych/lib/psych/visitors/yaml_tree.rb (revision 29672) @@ -8,8 +8,14 @@ # builder.tree # => #<Psych::Nodes::Stream .. } # class YAMLTree < Psych::Visitors::Visitor + attr_reader :started, :finished + alias :finished? :finished + alias :started? :started + def initialize options = {}, emitter = Psych::TreeBuilder.new super() + @started = false + @finished = false @emitter = emitter @st = {} @ss = ScalarScanner.new -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/