Permalink
Browse files

* ext/psych/lib/psych/visitors/to_ruby.rb: ToRuby visitor can be

  constructed with a ScalarScanner.
* ext/psych/lib/psych/visitors/yaml_tree.rb: ScalarScanner can be
  passed to the YAMLTree visitor.
  • Loading branch information...
1 parent 89ff730 commit 68a91d5e6446cacac9ded1c03381244557b02e2e @tenderlove tenderlove committed Oct 3, 2011
Showing with 12 additions and 5 deletions.
  1. +7 −0 CHANGELOG.rdoc
  2. +3 −3 lib/psych/visitors/to_ruby.rb
  3. +2 −2 lib/psych/visitors/yaml_tree.rb
View
@@ -1,3 +1,10 @@
+Tue Oct 4 05:59:24 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/visitors/to_ruby.rb: ToRuby visitor can be
+ constructed with a ScalarScanner.
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: ScalarScanner can be
+ passed to the YAMLTree visitor.
+
Tue Oct 4 05:47:23 2011 Aaron Patterson <aaron@tenderlovemaking.com>
* ext/psych/lib/psych/visitors/to_ruby.rb: Define Regexp::NOENCODING
@@ -9,10 +9,10 @@ module Visitors
###
# This class walks a YAML AST, converting each node to ruby
class ToRuby < Psych::Visitors::Visitor
- def initialize
- super
+ def initialize ss = ScalarScanner.new
+ super()
@st = {}
- @ss = ScalarScanner.new
+ @ss = ss
@domain_types = Psych.domain_types
end
@@ -12,13 +12,13 @@ class YAMLTree < Psych::Visitors::Visitor
alias :finished? :finished
alias :started? :started
- def initialize options = {}, emitter = Psych::TreeBuilder.new
+ def initialize options = {}, emitter = TreeBuilder.new, ss = ScalarScanner.new
super()
@started = false
@finished = false
@emitter = emitter
@st = {}
- @ss = ScalarScanner.new
+ @ss = ss
@options = options
@dispatch_cache = Hash.new do |h,klass|

0 comments on commit 68a91d5

Please sign in to comment.