Sha256: 7ebe81e352bfb9e7792793b435b66e4e54bbb335b2171f9b1fa61fff6e9bef4c

Contents?: true

Size: 754 Bytes

Versions: 4

Compression:

Stored size: 754 Bytes

Contents

require "rubygems"

$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__))) unless $LOAD_PATH.include?(File.expand_path(File.dirname(__FILE__)))

module Webrat
  # The common base class for all exceptions raised by Webrat.
  class WebratError < StandardError
  end

  VERSION = '0.4.3'

  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"
      require "webrat/core/xml/nokogiri"
    end
  end
  
  def self.on_java?
    RUBY_PLATFORM =~ /java/
  end
  
end

Webrat.require_xml

require "webrat/core"

Version data entries

4 entries across 4 versions & 3 rubygems

Version Path
jferris-webrat-0.4.3.0.1238640835 lib/webrat.rb
jferris-webrat-0.4.3 lib/webrat.rb
mmurphy-webrat-0.4.4 lib/webrat.rb
webrat-0.4.3 lib/webrat.rb