indirect-webrat 0.7.4 → 0.7.5
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +7 -1
- data/lib/webrat/core/xml.rb +11 -6
- data/webrat.gemspec +1 -1
- metadata +3 -3
data/History.txt
CHANGED
@@ -1,8 +1,14 @@
|
|
1
|
+
== 0.7.5 / 2011-11-19
|
2
|
+
|
3
|
+
* Minor enhancements
|
4
|
+
|
5
|
+
* have_selector on XML documents without re-parsing them as HTML
|
6
|
+
|
1
7
|
== 0.7.4 / 2011-11-19
|
2
8
|
|
3
9
|
* Minor enhancements
|
4
10
|
|
5
|
-
* parse XML as XML instead of as HTML
|
11
|
+
* parse XML as XML instead of as HTML (Alex Eagle/Anton Orel)
|
6
12
|
* handle controller redirects correctly (Daniel Libanori)
|
7
13
|
* work with rspec it { should blah } examples (Dmytrii Nagirniak)
|
8
14
|
* compatibility with Launchy 2.0 (Jeremy Hinegardner)
|
data/lib/webrat/core/xml.rb
CHANGED
@@ -6,14 +6,19 @@ module Webrat #:nodoc:
|
|
6
6
|
def self.document(stringlike) #:nodoc:
|
7
7
|
return stringlike.dom if stringlike.respond_to?(:dom)
|
8
8
|
|
9
|
-
|
9
|
+
case stringlike
|
10
|
+
when Nokogiri::HTML::Document
|
11
|
+
when Nokogiri::XML::NodeSet
|
10
12
|
stringlike
|
11
|
-
elsif Nokogiri::XML::NodeSet === stringlike
|
12
|
-
stringlike
|
13
|
-
elsif stringlike.respond_to?(:body)
|
14
|
-
Nokogiri.parse(stringlike.body.to_s)
|
15
13
|
else
|
16
|
-
|
14
|
+
stringlike = stringlike.body if stringlike.respond_to?(:body)
|
15
|
+
stringlike = stringlike.to_s
|
16
|
+
|
17
|
+
if stringlike =~ /\<\?xml/
|
18
|
+
Nokogiri::XML(stringlike)
|
19
|
+
else
|
20
|
+
Nokogiri::HTML(stringlike)
|
21
|
+
end
|
17
22
|
end
|
18
23
|
end
|
19
24
|
|
data/webrat.gemspec
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: indirect-webrat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 9
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 7
|
9
|
-
-
|
10
|
-
version: 0.7.
|
9
|
+
- 5
|
10
|
+
version: 0.7.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Bryan Helmkamp
|