Creation of a function xml instead of a hack for Nokogiri::XML

This commit is contained in:
erwanlr
2013-03-11 17:59:26 +01:00
parent 64c3c29597
commit de3d62ba92
7 changed files with 15 additions and 22 deletions

View File

@@ -1,14 +1,5 @@
# encoding: UTF-8
# Default option changed from DEFAULT_XML to NOBLANKS
module Nokogiri
class << self
def XML thing, url = nil, encoding = nil, options = XML::ParseOptions::NOBLANKS, &block
Nokogiri::XML::Document.parse(thing, url, encoding, options, &block)
end
end
end
# Since ruby 1.9.2, URI::escape is obsolete
# See http://rosettacode.org/wiki/URL_encoding#Ruby and http://www.ruby-forum.com/topic/207489
if RUBY_VERSION >= '1.9.2'