webrat 0.3.2 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/History.txt +6 -0
  2. data/lib/webrat.rb +20 -13
  3. metadata +4 -3
data/History.txt CHANGED
@@ -1,3 +1,9 @@
1
+ == 0.3.3 / 2008-12-28
2
+
3
+ * Minor enhancements
4
+
5
+ * Fix compatibility with Nokogiri 1.1.0 on MRI
6
+
1
7
  == 0.3.2 / 2008-11-08
2
8
 
3
9
  * Minor enhancements
data/lib/webrat.rb CHANGED
@@ -3,25 +3,32 @@ require "rubygems"
3
3
  $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__))) unless $LOAD_PATH.include?(File.expand_path(File.dirname(__FILE__)))
4
4
 
5
5
  module Webrat
6
- VERSION = '0.3.2'
6
+ VERSION = '0.3.3'
7
7
 
8
8
  def self.root #:nodoc:
9
9
  defined?(RAILS_ROOT) ? RAILS_ROOT : Merb.root
10
10
  end
11
+
12
+ def self.require_xml
13
+ gem "nokogiri", ">= 1.1.0"
14
+
15
+ if on_java?
16
+ # We need Nokogiri's CSS to XPath support, even if using REXML and Hpricot for parsing and searching
17
+ require "nokogiri/css"
18
+ require "hpricot"
19
+ require "rexml/document"
20
+ else
21
+ require "nokogiri"
22
+ require "webrat/core/nokogiri"
23
+ end
24
+ end
25
+
26
+ def self.on_java?
27
+ RUBY_PLATFORM =~ /java/
28
+ end
11
29
  end
12
30
 
13
- # We need Nokogiri's CSS to XPath support, even if using REXML
14
- require "nokogiri/css"
15
-
16
- # Require nokogiri and fall back on rexml
17
- begin
18
- require "nokogiri"
19
- require "webrat/core/nokogiri"
20
- rescue LoadError => e
21
- require "rexml/document"
22
- warn("Standard REXML library is slow. Please consider installing nokogiri.\nUse \"sudo gem install nokogiri\"")
23
- end
24
-
31
+ Webrat.require_xml
25
32
  require "webrat/core"
26
33
 
27
34
  # TODO: This is probably not a good idea.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webrat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryan Helmkamp
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-11-08 00:00:00 -05:00
12
+ date: 2008-12-28 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -87,6 +87,7 @@ files:
87
87
  - lib/webrat/selenium/selenium_session.rb
88
88
  - lib/webrat/selenium.rb
89
89
  - lib/webrat/sinatra.rb
90
+ - lib/webrat/test
90
91
  - lib/webrat.rb
91
92
  has_rdoc: true
92
93
  homepage: http://github.com/brynary/webrat
@@ -110,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
111
  requirements: []
111
112
 
112
113
  rubyforge_project:
113
- rubygems_version: 1.3.0
114
+ rubygems_version: 1.3.1
114
115
  signing_key:
115
116
  specification_version: 2
116
117
  summary: Webrat. Ruby Acceptance Testing for Web applications