summaryrefslogtreecommitdiff
path: root/ext/psych/lib
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-09 18:44:27 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-09 18:44:27 +0000
commit59a13448083080407e33c90ca0f02166ce88c01c (patch)
treed565965a8f0bf7325e28ecac6fee2e8a09d816d2 /ext/psych/lib
parent14c97cf9b6721d55f8f5afa0e7be7e7e80311aea (diff)
* 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
Diffstat (limited to 'ext/psych/lib')
-rw-r--r--ext/psych/lib/psych/parser.rb4
1 files changed, 4 insertions, 0 deletions
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