756e6d2ad8
* This will significantly decrease the size of the msf install (~5 MB) * ActiveRecord & ActiveSupport are still used, and have been moved to lib/ git-svn-id: file:///home/svn/framework3/trunk@10682 4d416f70-5f16-0410-b530-b9f4589650da
32 lines
657 B
Ruby
32 lines
657 B
Ruby
module ActiveSupport
|
|
# = XmlMini
|
|
#
|
|
# To use the much faster libxml parser:
|
|
# gem 'libxml-ruby', '=0.9.7'
|
|
# XmlMini.backend = 'LibXML'
|
|
module XmlMini
|
|
extend self
|
|
|
|
attr_reader :backend
|
|
delegate :parse, :to => :backend
|
|
|
|
def backend=(name)
|
|
if name.is_a?(Module)
|
|
@backend = name
|
|
else
|
|
require "active_support/xml_mini/#{name.to_s.downcase}.rb"
|
|
@backend = ActiveSupport.const_get("XmlMini_#{name}")
|
|
end
|
|
end
|
|
|
|
def with_backend(name)
|
|
old_backend, self.backend = backend, name
|
|
yield
|
|
ensure
|
|
self.backend = old_backend
|
|
end
|
|
end
|
|
|
|
XmlMini.backend = 'REXML'
|
|
end
|