aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/xml_mini.rb
blob: d2a882b68590b32dfa3170b163c50d3eea29f19e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
module ActiveSupport
  # = XmlMini
  module XmlMini
    extend self
    delegate :parse, :to => :@backend

    def backend=(name)
      require "active_support/xml_mini/#{name.to_s.downcase}.rb"
      @backend = ActiveSupport.const_get("XmlMini_#{name}")
    end
  end

  begin
    gem 'libxml-ruby', '=0.9.4', '=0.9.7'
    XmlMini.backend = 'LibXML'
  rescue Gem::LoadError
    XmlMini.backend = 'REXML'
  end
end