From 86e02603780a10107e64b2572347e85b257005c2 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Thu, 9 Feb 2012 10:46:50 -0800 Subject: * ext/psych/parser.c: removed external encoding setter, allow parser to be reused. * ext/psych/lib/psych/parser.rb: added external encoding setter. * test/psych/test_parser.rb: test parser reuse --- lib/psych/parser.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib') diff --git a/lib/psych/parser.rb b/lib/psych/parser.rb index 5d75605..84085f1 100644 --- a/lib/psych/parser.rb +++ b/lib/psych/parser.rb @@ -36,12 +36,16 @@ module Psych # The handler on which events will be called attr_accessor :handler + # Set the encoding for this parser to +encoding+ + attr_writer :external_encoding + ### # Creates a new Psych::Parser instance with +handler+. YAML events will # be called on +handler+. See Psych::Parser for more details. def initialize handler = Handler.new @handler = handler + @external_encoding = ANY end end end -- cgit v1.2.3