From 59a13448083080407e33c90ca0f02166ce88c01c Mon Sep 17 00:00:00 2001 From: tenderlove Date: Thu, 9 Feb 2012 18:44:27 +0000 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 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/psych/lib/psych/parser.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ext/psych/lib') diff --git a/ext/psych/lib/psych/parser.rb b/ext/psych/lib/psych/parser.rb index 5d75605d49..84085f1fb0 100644 --- a/ext/psych/lib/psych/parser.rb +++ b/ext/psych/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