w3c_validators 1.3.4 → 1.3.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 808e0ab1a06eeddb2fdddc48b8561b0af6131543ec831f6e8116f1bfac116a80
4
- data.tar.gz: 3fbbfdd0e7c20abbd969199ddb9b5b9a8c753b54bdd75d39e4afc0a0a048c0c8
3
+ metadata.gz: 4377ec00a81f9c752fbd444aa2b82c6fa0cc714910582947afc10eaae5e1ad69
4
+ data.tar.gz: 5c8f9a570535f20d2056c03e43fed5438627963b9f85b15121d72f7ed7a5687f
5
5
  SHA512:
6
- metadata.gz: d4612201b2274705ba738ac9825c7bfce3b70b93b266c93ac46460cf6d55e02d236c950bf7b7a4f84c569cc1993f7c55bcddb11f07d2074fd26491e64892b989
7
- data.tar.gz: 3f98f9ec4200b52cc75d66b4a9aec62dbeefacf28cff95f965b11fe7f8ba2112a5d7975a8963fb4f15606164bfc7ddc406990af1d769a0eca1c54924d8d24625
6
+ metadata.gz: 3f6642641137784ed8b474b027c73d14176dd5eb2a2959fbed28f0e0226d29036fcaa01fb843d4d3c870ccc1849ebe3cf472d593f73534aadc2ea306cab7764b
7
+ data.tar.gz: 8438d1e0df9fc60a127c0d678c9315332647283066b99b9e02dbf03700b9d7559b32a28ea09a5ec0fdf4386afc285838dddf18baf8dc7a50197b6079e131012f
@@ -1,8 +1,7 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.5.1
4
- - 2.4.4
5
- - 2.3.7
6
- - 2.2.10
7
- - 2.1.10
3
+ - 2.6.3
4
+ - 2.5.5
5
+ - 2.4.6
6
+ - 2.3.8
8
7
 
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
+
@@ -202,8 +202,8 @@ protected
202
202
  end
203
203
  return results
204
204
 
205
- rescue Exception => e
206
- handle_exception e
205
+ rescue Exception => e
206
+ handle_exception e
207
207
  end
208
208
 
209
209
  # Parse the HEAD response into HTMLValidator::Results.
@@ -140,8 +140,8 @@ protected
140
140
 
141
141
  return results
142
142
 
143
- rescue Exception => e
144
- handle_exception e
143
+ rescue Exception => e
144
+ handle_exception e
145
145
  end
146
146
  end
147
147
  end
@@ -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
- rescue Exception => e
116
- handle_exception e
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 Net::HTTPServerException, SocketError, Errno::ECONNREFUSED
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
@@ -1,3 +1,3 @@
1
1
  module W3CValidators
2
- VERSION = "1.3.4"
2
+ VERSION = "1.3.5"
3
3
  end
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
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: 2018-08-13 00:00:00.000000000 Z
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.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.