Skip to content

Commit

Permalink
Fix deprecation: "Passing no parameters to XML::SaxParser.new is depr…
Browse files Browse the repository at this point in the history
…ecated", present in libxml-ruby 0.9.9+
  • Loading branch information
Eric authored and Konstantin committed Mar 31, 2010
1 parent 35150d5 commit 59fe74d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/awsbase/right_awsbase.rb
Original file line number Diff line number Diff line change
Expand Up @@ -881,8 +881,13 @@ def parse(xml_text, params={})
# Parse the xml text
case @xml_lib
when 'libxml'
xml = XML::SaxParser.new
xml.string = xml_text
if XML::Parser::VERSION >= '0.9.9'
# avoid warning on every usage
xml = XML::SaxParser.string(xml_text)
else
xml = XML::SaxParser.new
xml.string = xml_text
end
# check libxml-ruby version
if XML::Parser::VERSION >= '0.5.1.0'
xml.callbacks = RightSaxParserCallback.new(self)
Expand Down

0 comments on commit 59fe74d

Please sign in to comment.