w3c_validators 1.3.4 → 1.3.5
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.
- checksums.yaml +4 -4
- data/.travis.yml +4 -5
- data/CHANGELOG +5 -0
- data/lib/w3c_validators/markup_validator.rb +2 -2
- data/lib/w3c_validators/nu_validator.rb +2 -2
- data/lib/w3c_validators/validator.rb +9 -3
- data/lib/w3c_validators/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4377ec00a81f9c752fbd444aa2b82c6fa0cc714910582947afc10eaae5e1ad69
|
4
|
+
data.tar.gz: 5c8f9a570535f20d2056c03e43fed5438627963b9f85b15121d72f7ed7a5687f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f6642641137784ed8b474b027c73d14176dd5eb2a2959fbed28f0e0226d29036fcaa01fb843d4d3c870ccc1849ebe3cf472d593f73534aadc2ea306cab7764b
|
7
|
+
data.tar.gz: 8438d1e0df9fc60a127c0d678c9315332647283066b99b9e02dbf03700b9d7559b32a28ea09a5ec0fdf4386afc285838dddf18baf8dc7a50197b6079e131012f
|
data/.travis.yml
CHANGED
data/CHANGELOG
CHANGED
@@ -68,3 +68,8 @@
|
|
68
68
|
* add test of ruby 2.5
|
69
69
|
* remove unused variable in nu validator code
|
70
70
|
|
71
|
+
== Version 1.3.5
|
72
|
+
* replace Net::HTTPServerException (deprecated) by Net::HTTPClientException
|
73
|
+
* fix bad indentation of rescue in validators classes
|
74
|
+
* add test for ruby 2.6, update 2.5, 2.4, 2.3 tested version and remove 2.2 and 2.1 versions
|
75
|
+
|
@@ -16,6 +16,7 @@ module W3CValidators
|
|
16
16
|
HEAD_STATUS_HEADER = 'X-W3C-Validator-Status'
|
17
17
|
HEAD_ERROR_COUNT_HEADER = 'X-W3C-Validator-Errors'
|
18
18
|
SOAP_OUTPUT_PARAM = 'soap12'
|
19
|
+
USE_NEW_EXCEPTION = Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.6')
|
19
20
|
|
20
21
|
attr_reader :results, :validator_uri
|
21
22
|
|
@@ -112,8 +113,8 @@ module W3CValidators
|
|
112
113
|
response.value
|
113
114
|
return response
|
114
115
|
|
115
|
-
|
116
|
-
|
116
|
+
rescue Exception => e
|
117
|
+
handle_exception e
|
117
118
|
end
|
118
119
|
|
119
120
|
def create_multipart_data(options) # :nodoc:
|
@@ -173,8 +174,13 @@ module W3CValidators
|
|
173
174
|
# Big thanks to ara.t.howard and Joel VanderWerf on Ruby-Talk for the exception handling help.
|
174
175
|
#++
|
175
176
|
def handle_exception(e, msg = '') # :nodoc:
|
177
|
+
if USE_NEW_EXCEPTION
|
178
|
+
http_exception = Net::HTTPClientException
|
179
|
+
else
|
180
|
+
http_exception = Net::HTTPServerException
|
181
|
+
end
|
176
182
|
case e
|
177
|
-
when
|
183
|
+
when http_exception, SocketError, Errno::ECONNREFUSED
|
178
184
|
msg = "unable to connect to the validator at #{@validator_uri} (response was #{e.message})."
|
179
185
|
raise ValidatorUnavailable, msg, caller
|
180
186
|
when JSON::ParserError, Nokogiri::XML::SyntaxError
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: w3c_validators
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Dunae
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -189,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
189
189
|
version: '0'
|
190
190
|
requirements: []
|
191
191
|
rubyforge_project:
|
192
|
-
rubygems_version: 2.7.
|
192
|
+
rubygems_version: 2.7.6
|
193
193
|
signing_key:
|
194
194
|
specification_version: 4
|
195
195
|
summary: A Ruby wrapper for the World Wide Web Consortium’s online validation services.
|