Changing requiring of nokogiri to work on jruby

This commit is contained in:
Bryan Helmkamp 2008-11-17 00:05:57 -05:00
parent 1bdead1655
commit 3abaa924cc

View File

@ -14,16 +14,14 @@ module Webrat
end
# 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
if RUBY_PLATFORM =~ /java/
# We need Nokogiri's CSS to XPath support, even if using REXML and Hpricot for parsing and searching
require "nokogiri/css"
require "hpricot"
require "rexml/document"
else
require "nokogiri"
require "webrat/core/nokogiri"
end
require "webrat/core"