webrat/lib/webrat.rb

35 lines
754 B
Ruby
Raw Normal View History

2008-10-25 16:42:38 +00:00
require "rubygems"
2008-10-25 16:59:21 +00:00
$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__))) unless $LOAD_PATH.include?(File.expand_path(File.dirname(__FILE__)))
2008-04-04 16:12:46 +00:00
module Webrat
2008-11-25 06:34:34 +00:00
# The common base class for all exceptions raised by Webrat.
class WebratError < StandardError
end
2009-04-06 18:03:58 +00:00
VERSION = '0.4.4'
def self.require_xml
gem "nokogiri", ">= 1.0.6"
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"
2008-11-30 06:38:55 +00:00
require "webrat/core/xml/nokogiri"
end
end
def self.on_java?
RUBY_PLATFORM =~ /java/
end
2008-04-05 16:49:18 +00:00
end
Webrat.require_xml
2008-10-25 16:59:21 +00:00
require "webrat/core"