Sha256: d2dd00eb595370ebe6d7302a815994a765d93f92e409da83443aff773621fd6c
Contents?: true
Size: 557 Bytes
Versions: 8
Compression:
Stored size: 557 Bytes
Contents
module EPUB class Parser class XMLDocument class << self attr_accessor :backend def new(xml) case backend when :Oga Oga.parse_xml(xml) when :Nokogiri Nokogiri.XML(xml) else REXML::Document.new(xml) end end end end end end %i[Nokogiri Oga REXML].each do |backend| begin require "epub/parser/xml_document/refinements/#{backend.downcase}" EPUB::Parser::XMLDocument.backend ||= backend rescue LoadError end end
Version data entries
8 entries across 8 versions & 1 rubygems