Fixing require statement for Nokogiri on JRuby

This commit is contained in:
Bryan Helmkamp 2008-12-29 00:36:53 -05:00
parent 6d5205b7b7
commit 3d522a476a
1 changed files with 4 additions and 3 deletions

View File

@ -12,13 +12,14 @@ module Webrat
def self.require_xml
gem "nokogiri", ">= 1.1.0"
# We need Nokogiri's CSS to XPath support, even if using
# REXML and Hpricot for parsing and searching
require "nokogiri"
if on_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
end