2008-10-25 16:42:38 +00:00
|
|
|
require "rubygems"
|
2009-06-25 23:41:42 +00:00
|
|
|
require "rack"
|
2008-10-25 16:42:38 +00:00
|
|
|
|
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.
|
2008-11-15 00:50:45 +00:00
|
|
|
class WebratError < StandardError
|
|
|
|
end
|
|
|
|
|
2009-04-06 18:03:58 +00:00
|
|
|
VERSION = '0.4.4'
|
2008-11-15 00:50:45 +00:00
|
|
|
|
2008-11-19 20:52:56 +00:00
|
|
|
def self.require_xml
|
|
|
|
if on_java?
|
2009-05-11 04:11:01 +00:00
|
|
|
gem "nokogiri", ">= 1.2.4"
|
2008-11-19 20:52:56 +00:00
|
|
|
else
|
2009-05-11 04:11:01 +00:00
|
|
|
gem "nokogiri", ">= 1.0.6"
|
2008-11-19 20:52:56 +00:00
|
|
|
end
|
2009-05-11 05:27:04 +00:00
|
|
|
|
2009-05-11 04:11:01 +00:00
|
|
|
require "nokogiri"
|
|
|
|
require "webrat/core/xml/nokogiri"
|
2008-11-19 20:52:56 +00:00
|
|
|
end
|
2009-04-08 00:30:12 +00:00
|
|
|
|
2008-11-19 20:52:56 +00:00
|
|
|
def self.on_java?
|
|
|
|
RUBY_PLATFORM =~ /java/
|
|
|
|
end
|
2009-04-08 00:30:12 +00:00
|
|
|
|
2008-04-05 16:49:18 +00:00
|
|
|
end
|
|
|
|
|
2008-11-19 20:52:56 +00:00
|
|
|
Webrat.require_xml
|
2008-11-07 07:49:48 +00:00
|
|
|
|
2008-10-25 16:59:21 +00:00
|
|
|
require "webrat/core"
|