Changing requiring of nokogiri to work on jruby
This commit is contained in:
parent
1bdead1655
commit
3abaa924cc
@ -14,16 +14,14 @@ module Webrat
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# We need Nokogiri's CSS to XPath support, even if using REXML and Hpricot for parsing and searching
|
if RUBY_PLATFORM =~ /java/
|
||||||
require "nokogiri/css"
|
# We need Nokogiri's CSS to XPath support, even if using REXML and Hpricot for parsing and searching
|
||||||
|
require "nokogiri/css"
|
||||||
# Require nokogiri and fall back on rexml+Hpricot
|
|
||||||
begin
|
|
||||||
require "nokogiri"
|
|
||||||
require "webrat/core/nokogiri"
|
|
||||||
rescue LoadError => e
|
|
||||||
require "hpricot"
|
require "hpricot"
|
||||||
require "rexml/document"
|
require "rexml/document"
|
||||||
|
else
|
||||||
|
require "nokogiri"
|
||||||
|
require "webrat/core/nokogiri"
|
||||||
end
|
end
|
||||||
|
|
||||||
require "webrat/core"
|
require "webrat/core"
|
||||||
|
Loading…
Reference in New Issue
Block a user