Sha256: 82c4743c71621f19208f4f94ff0ad76b5ca9ece11904e26dad25edbe5361dbf2

Contents?: true

Size: 573 Bytes

Versions: 5

Compression:

Stored size: 573 Bytes

Contents

require "sax-machine/version"
require "sax-machine/sax_document"
require "sax-machine/sax_configure"
require "sax-machine/sax_config"

module SAXMachine
  def self.handler
    @@handler ||= nil
  end

  def self.handler=(handler)
    if handler
      require "sax-machine/handlers/sax_#{handler}_handler"
      @@handler = handler
    end
  end
end

# Try handlers
[:ox, :oga].each do |handler|
  begin
    SAXMachine.handler = handler
    break
  rescue LoadError
  end
end

# Still no handler, use Nokogiri
if SAXMachine.handler.nil?
  SAXMachine.handler = :nokogiri
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
sax-machine-1.3.2 lib/sax-machine.rb
sax-machine-1.3.1 lib/sax-machine.rb
sax-machine-1.3.0 lib/sax-machine.rb
sax-machine-1.2.0 lib/sax-machine.rb
sax-machine-1.1.1 lib/sax-machine.rb