Add XML engine configuration
This commit is contained in:
parent
c566c0d788
commit
84cd69bdfd
@ -48,11 +48,22 @@ module RablRails
|
|||||||
MultiJson.engine
|
MultiJson.engine
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.xml_engine=(name)
|
||||||
|
ActiveSupport::XmlMini.backend = name
|
||||||
|
rescue LoadError, NameError
|
||||||
|
Rails.logger.warn %Q(WARNING: rabl-rails could not load "#{name}" as XML engine, fallback to default)
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.xml_engine
|
||||||
|
ActiveSupport::XmlMini.backend
|
||||||
|
end
|
||||||
|
|
||||||
def self.cache_templates?
|
def self.cache_templates?
|
||||||
ActionController::Base.perform_caching && @@cache_templates
|
ActionController::Base.perform_caching && @@cache_templates
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.load_default_engines!
|
def self.load_default_engines!
|
||||||
self.json_engine = MultiJson.default_engine
|
self.json_engine = MultiJson.default_engine
|
||||||
|
self.xml_engine = 'LibXML'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -23,8 +23,6 @@ end
|
|||||||
|
|
||||||
require 'rabl-rails'
|
require 'rabl-rails'
|
||||||
|
|
||||||
ActiveSupport::XmlMini.backend = 'LibXML'
|
|
||||||
|
|
||||||
module ActiveSupport
|
module ActiveSupport
|
||||||
class TestCase
|
class TestCase
|
||||||
RSpec::Mocks::setup(self)
|
RSpec::Mocks::setup(self)
|
||||||
|
Loading…
Reference in New Issue
Block a user