Use nokogiri on JRuby
This commit is contained in:
parent
8b1e88d4ff
commit
0e18a4141e
9
Gemfile
9
Gemfile
@ -3,9 +3,16 @@ source "http://rubygems.org"
|
||||
gemspec
|
||||
|
||||
gem 'oj'
|
||||
gem 'libxml-ruby'
|
||||
gem 'plist'
|
||||
|
||||
platforms :ruby do
|
||||
gem 'libxml-ruby'
|
||||
end
|
||||
|
||||
platforms :jruby do
|
||||
gem 'nokogiri'
|
||||
end
|
||||
|
||||
group :test do
|
||||
gem 'rspec-mocks'
|
||||
end
|
||||
|
@ -76,7 +76,12 @@ module RablRails
|
||||
|
||||
def self.load_default_engines!
|
||||
self.json_engine = MultiJson.default_engine
|
||||
self.xml_engine = 'LibXML' if defined?(LibXML)
|
||||
self.plist_engine = Plist::Emit if defined?(Plist)
|
||||
|
||||
if defined?(LibXML)
|
||||
self.xml_engine = 'LibXML'
|
||||
elsif defined?(Nokogiri)
|
||||
self.xml_engine = 'Nokogiri'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -1,7 +1,4 @@
|
||||
require 'test_helper'
|
||||
require 'plist'
|
||||
|
||||
RablRails.plist_engine = Plist::Emit
|
||||
|
||||
class TestPlistRenderer < ActiveSupport::TestCase
|
||||
INDENT_REGEXP = /\n(\s)*/
|
||||
|
@ -22,6 +22,15 @@ class <<Singleton
|
||||
end
|
||||
|
||||
require 'rabl-rails'
|
||||
require 'plist'
|
||||
|
||||
if RUBY_ENGINE == 'ruby'
|
||||
require 'libxml'
|
||||
else
|
||||
require 'nokogiri'
|
||||
end
|
||||
|
||||
RablRails.load_default_engines!
|
||||
|
||||
module ActiveSupport
|
||||
class TestCase
|
||||
|
Loading…
Reference in New Issue
Block a user