Don't require rubygems at runtime (Simon Rozet)

This commit is contained in:
Bryan Helmkamp 2009-08-10 20:14:48 -04:00
parent 29186616f5
commit 987766b10d
4 changed files with 9 additions and 24 deletions

View File

@ -1,3 +1,9 @@
== Git
* Minor enhancements
* Don't require rubygems at runtime (Simon Rozet)
== 0.4.5 / 2009-08-10
* Major enhancements

View File

@ -1,29 +1,9 @@
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
def self.require_xml
if on_java?
gem "nokogiri", ">= 1.2.4"
else
gem "nokogiri", ">= 1.0.6"
end
require "nokogiri"
require "webrat/core/xml/nokogiri"
end
def self.on_java?
RUBY_PLATFORM =~ /java/
end
end
Webrat.require_xml
require "webrat/core"

View File

@ -1,5 +1,4 @@
require "webrat"
gem "selenium-client", ">=1.2.16"
require "selenium/client"
require "webrat/selenium/silence_stream"
require "webrat/selenium/selenium_session"

View File

@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
module Webrat
describe Field do
unless Webrat.on_java?
unless RUBY_PLATFORM =~ /java/
it "should have nice inspect output" do
html = <<-HTML
<html>