diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-02-09 10:46:50 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-02-09 10:46:50 -0800 |
commit | 86e02603780a10107e64b2572347e85b257005c2 (patch) | |
tree | 81f769e0a04045c6ac9b6a587ee34ca73f8f6e88 /lib | |
parent | e2fcf9af9e95535401f816bc893839b9ad743a9e (diff) | |
download | psych-86e02603780a10107e64b2572347e85b257005c2.zip |
* 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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/psych/parser.rb | 4 |
1 files changed, 4 insertions, 0 deletions
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 |