w3c_validators 0.9.1 → 0.9.2

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.
data/README CHANGED
@@ -113,4 +113,6 @@ between each call to the W3C's validators per their request.
113
113
  Documentation and the source code are available at http://code.dunae.ca/w3c_validators.
114
114
 
115
115
  Written by Alex Dunae (dunae.ca, e-mail 'code' at the same domain), 2007.
116
+
117
+ Thanks to Ryan King (http://theryanking.com/) for creating the 0.9.1 update.
116
118
 
@@ -183,7 +183,13 @@ protected
183
183
  results.add_message(local_type, message_params)
184
184
  end
185
185
  end
186
-
186
+
187
+ doc.elements.each("env:Envelope/env:Body/env:Fault/env:Reason") do |message|
188
+ message.elements.each("env:Text") do |m|
189
+ results.add_message(:error, {:mesage => m.text})
190
+ end
191
+ end
192
+
187
193
  doc.elements.each("env:Envelope/env:Body/m:markupvalidationresponse/m:debug") do |debug|
188
194
  results.add_debug_message(debug.attribute('name').value, debug.text)
189
195
  end
@@ -38,7 +38,7 @@ module W3CValidators
38
38
  end
39
39
 
40
40
  def is_valid?
41
- @validity.downcase.strip == 'true'
41
+ @validity && @validity.downcase.strip == 'true'
42
42
  end
43
43
 
44
44
  # Returns an array of Message objects.
@@ -69,4 +69,16 @@ class MarkupValidatorTests < Test::Unit::TestCase
69
69
  assert_equal 0, r.errors.length
70
70
  assert_equal 0, r.warnings.length
71
71
  end
72
+
73
+ def test_validator_abort
74
+ @v.set_debug!
75
+ assert_nothing_raised do
76
+ r = @v.validate_uri('http://code.dunae.ca/w3c_validators/test/invalid_encoding.html')
77
+ assert !r.is_valid?
78
+ assert_equal 1, r.errors.length
79
+ assert_equal [], r.warnings
80
+ end
81
+ end
82
+
83
+
72
84
  end
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.4
2
+ rubygems_version: 0.9.2
3
3
  specification_version: 1
4
4
  name: w3c_validators
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.9.1
7
- date: 2007-11-19 00:00:00 -08:00
6
+ version: 0.9.2
7
+ date: 2008-02-08 00:00:00 -08:00
8
8
  summary: Wrapper for the World Wide Web Consortium's online validation services.
9
9
  require_paths:
10
10
  - lib