ndd-url_checker 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/LICENSE.txt +18 -17
  4. data/README.md +14 -7
  5. data/lib/ndd/url_checker.rb +6 -0
  6. data/lib/ndd/url_checker/reporting_url_checker.rb +4 -0
  7. data/lib/ndd/url_checker/status.rb +1 -0
  8. data/lib/ndd/url_checker/status_decorator.rb +11 -0
  9. data/lib/ndd/url_checker/version.rb +5 -0
  10. metadata +9 -249
  11. data/.document +0 -5
  12. data/.rspec +0 -1
  13. data/.ruby-gemset +0 -1
  14. data/.ruby-version +0 -1
  15. data/.travis.yml +0 -16
  16. data/Gemfile +0 -50
  17. data/Gemfile.lock +0 -162
  18. data/Guardfile +0 -38
  19. data/Rakefile +0 -51
  20. data/VERSION +0 -1
  21. data/lib/ndd/url_checker/reporting_url_checker.csv.erb +0 -4
  22. data/lib/ndd/url_checker/reporting_url_checker.html.erb +0 -188
  23. data/lib/ndd/url_checker/reporting_url_checker.json.erb +0 -27
  24. data/ndd-url_checker.gemspec +0 -134
  25. data/spec/ndd/url_checker/abstract_url_checker_spec.rb +0 -11
  26. data/spec/ndd/url_checker/blocking_url_checker_spec.rb +0 -12
  27. data/spec/ndd/url_checker/forked_url_checker_spec.rb +0 -12
  28. data/spec/ndd/url_checker/parallel_url_checker_spec.rb +0 -62
  29. data/spec/ndd/url_checker/reporting_url_checker/custom.txt.erb +0 -8
  30. data/spec/ndd/url_checker/reporting_url_checker/multiple_urls.csv +0 -6
  31. data/spec/ndd/url_checker/reporting_url_checker/multiple_urls.html +0 -246
  32. data/spec/ndd/url_checker/reporting_url_checker/multiple_urls.json +0 -49
  33. data/spec/ndd/url_checker/reporting_url_checker/multiple_urls.txt +0 -26
  34. data/spec/ndd/url_checker/reporting_url_checker/single_url.csv +0 -2
  35. data/spec/ndd/url_checker/reporting_url_checker/single_url.html +0 -182
  36. data/spec/ndd/url_checker/reporting_url_checker/single_url.json +0 -25
  37. data/spec/ndd/url_checker/reporting_url_checker/single_url.txt +0 -6
  38. data/spec/ndd/url_checker/reporting_url_checker_spec.rb +0 -131
  39. data/spec/ndd/url_checker/status_decorator_spec.rb +0 -208
  40. data/spec/ndd/url_checker/status_spec.rb +0 -510
  41. data/spec/ndd/url_checker/threaded_url_checker_spec.rb +0 -13
  42. data/spec/spec_helper.rb +0 -81
  43. data/spec/support/multiple_url_checker_spec.rb +0 -58
  44. data/spec/support/single_url_checker_spec.rb +0 -252
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 013fff194ae9760d6089a8d95fbb7bc37fa1ca30
4
- data.tar.gz: c840c0b74fb3240cb79832a2a7f7154709ad4b8b
3
+ metadata.gz: 868566bed28d9a8caf5259c31fdd6b6b2ecb95ad
4
+ data.tar.gz: 8a9b63c51ca2e69439ceb9878b42bd39f4ff2d8c
5
5
  SHA512:
6
- metadata.gz: 81691aaa997394bed87fa5d8104c1cd62bc84fd0951648c8b167b524000348f686724dabe2d9ac76b5ebea7f04cec2e5c95d0d6bce7f0a3b55ed11179faec78a
7
- data.tar.gz: 2fa122594050d258bd2aaa008470e9e12f6bd81b90f28045ec6aa5f3e4c79793cd74d4b9b4148a6501575e56ac00c69d0e791c9e36d6fcff57b808df3797de76
6
+ metadata.gz: 870b530f65492340c01815bb2dbdc6c9d9696353ca5846be03a6a58bb489fee95ef2141909ef08415b593a61882ab9c08edbb4120bee35e701afeefbbb0ef35e
7
+ data.tar.gz: b611b6a1d9fcb60e213c1ae7ede2ff887acee9e1b4856ad514837ae9d22f4a7d8f2d105abe9656c9d952b027b97ac795f3e26bef8179aab57a8b4a1c4c244b1c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # NDD URL Checker changelog
2
2
 
3
+ ## Version 0.3.3
4
+
5
+ - Update dependencies
6
+ - Remove Jeweler and use default workflow
7
+ - Add Ruby 2.3 to Travis build
8
+ - Remove Ruby 2.0 and 2.1 from Travis build
9
+ - Remove RDoc and tune Yardoc
10
+
3
11
  ## Version 0.3.2
4
12
 
5
13
  - Update dependencies to fix security alerts
data/LICENSE.txt CHANGED
@@ -1,20 +1,21 @@
1
- Copyright (c) 2014 David DIDIER
1
+ The MIT License (MIT)
2
2
 
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
3
+ Copyright (c) 2016 David DIDIER
10
4
 
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
13
11
 
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md CHANGED
@@ -11,13 +11,13 @@ An URL validator.
11
11
 
12
12
  The API documentation can be find at [RubyDoc](http://www.rubydoc.info/github/ddidier/ndd-url_checker).
13
13
 
14
+
15
+
14
16
  ## Prerequisites
15
17
 
16
- This gem requires Ruby 2.x and is tested with:
18
+ This gem requires Ruby 2.x and [is tested against some versions](https://travis-ci.org/ddidier/ndd-url_checker).
19
+
17
20
 
18
- - Ruby 2.0.0
19
- - Ruby 2.1.6
20
- - Ruby 2.2.2
21
21
 
22
22
  ## Usage
23
23
 
@@ -78,7 +78,14 @@ report_as_text = checker.report(:json, '/some/report.json')
78
78
  report_as_text = checker.report('/some/template.erb', '/some/report.html')
79
79
  ```
80
80
 
81
- ## Copyright
82
81
 
83
- Copyright (c) 2014 David DIDIER.
84
- See `LICENSE.txt` for further details.
82
+
83
+ ## Contributing
84
+
85
+ Bug reports and pull requests are welcome on GitHub at https://github.com/ddidier/ndd-url_checker.
86
+
87
+
88
+
89
+ ## License
90
+
91
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
@@ -6,3 +6,9 @@ require 'ndd/url_checker/reporting_url_checker'
6
6
  require 'ndd/url_checker/status'
7
7
  require 'ndd/url_checker/status_decorator'
8
8
  require 'ndd/url_checker/threaded_url_checker'
9
+ require 'ndd/url_checker/version'
10
+
11
+ module NDD # :nodoc:
12
+ module UrlChecker # :nodoc:
13
+ end
14
+ end
@@ -21,6 +21,10 @@ module NDD
21
21
  @delegate = delegate_checker
22
22
  end
23
23
 
24
+ # Checks that the given URLs are valid.
25
+ # @param urls [String, Array<String>] the URLs to check
26
+ # @return [NDD::UrlChecker::Status, Array<NDD::UrlChecker::Status>] a single status for a single URL, an array
27
+ # of status for multiple parameters
24
28
  def check(*urls)
25
29
  results = nil
26
30
  benchmark = Benchmark.measure { results = @delegate.check(*urls) }
@@ -76,6 +76,7 @@ module NDD
76
76
  update_code(:unknown_host, %i(unknown redirected))
77
77
  end
78
78
 
79
+ # Returns the status representation
79
80
  def to_s
80
81
  self.inspect
81
82
  end
@@ -7,10 +7,16 @@ module NDD
7
7
  # @author David DIDIER
8
8
  class StatusDecorator < SimpleDelegator
9
9
 
10
+ # Returns the CSS class associated with the status.
10
11
  def code_as_css
11
12
  code.to_s.gsub(/_/, '-')
12
13
  end
13
14
 
15
+ # Returns:
16
+ # - nil if the status is :direct
17
+ # - the number of redirections if the status is :redirected or :too_many_redirects
18
+ # - the error if the status is :failed
19
+ # - the last URL if the status is :unknown_host
14
20
  def details_title
15
21
  case code
16
22
  when :direct then
@@ -27,6 +33,10 @@ module NDD
27
33
  end
28
34
  end
29
35
 
36
+ # Returns:
37
+ # - nil if the status is :direct
38
+ # - all the URLs if the status is :redirected or :too_many_redirects or :unknown_host
39
+ # - the error message if the status is :failed
30
40
  def details_body
31
41
  case code
32
42
  when :direct then
@@ -44,6 +54,7 @@ module NDD
44
54
  end
45
55
  end
46
56
 
57
+ # Returns an HTML description of the status.
47
58
  def details_body_as_html
48
59
  body = <<-HTML.gsub(/^ +/, '')
49
60
  <p><em>Status:</em> #{code}</p>
@@ -0,0 +1,5 @@
1
+ module NDD
2
+ module UrlChecker
3
+ VERSION = '0.3.3' # :nodoc:
4
+ end
5
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ndd-url_checker
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
  - David DIDIER
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-08 00:00:00.000000000 Z
11
+ date: 2016-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cod
@@ -38,216 +38,6 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.8'
41
- - !ruby/object:Gem::Dependency
42
- name: bundler
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '1.7'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '1.7'
55
- - !ruby/object:Gem::Dependency
56
- name: guard
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '2.13'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: '2.13'
69
- - !ruby/object:Gem::Dependency
70
- name: guard-bundler
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '2.0'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: '2.0'
83
- - !ruby/object:Gem::Dependency
84
- name: guard-rspec
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: '4.6'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "~>"
95
- - !ruby/object:Gem::Version
96
- version: '4.6'
97
- - !ruby/object:Gem::Dependency
98
- name: guard-spork
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - "~>"
102
- - !ruby/object:Gem::Version
103
- version: '2.0'
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - "~>"
109
- - !ruby/object:Gem::Version
110
- version: '2.0'
111
- - !ruby/object:Gem::Dependency
112
- name: jeweler
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - "~>"
116
- - !ruby/object:Gem::Version
117
- version: '2.0'
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - "~>"
123
- - !ruby/object:Gem::Version
124
- version: '2.0'
125
- - !ruby/object:Gem::Dependency
126
- name: rdoc
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - "~>"
130
- - !ruby/object:Gem::Version
131
- version: '4.1'
132
- type: :development
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - "~>"
137
- - !ruby/object:Gem::Version
138
- version: '4.1'
139
- - !ruby/object:Gem::Dependency
140
- name: rspec
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - "~>"
144
- - !ruby/object:Gem::Version
145
- version: '3.3'
146
- type: :development
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - "~>"
151
- - !ruby/object:Gem::Version
152
- version: '3.3'
153
- - !ruby/object:Gem::Dependency
154
- name: rspec-collection_matchers
155
- requirement: !ruby/object:Gem::Requirement
156
- requirements:
157
- - - "~>"
158
- - !ruby/object:Gem::Version
159
- version: '1.1'
160
- type: :development
161
- prerelease: false
162
- version_requirements: !ruby/object:Gem::Requirement
163
- requirements:
164
- - - "~>"
165
- - !ruby/object:Gem::Version
166
- version: '1.1'
167
- - !ruby/object:Gem::Dependency
168
- name: simplecov
169
- requirement: !ruby/object:Gem::Requirement
170
- requirements:
171
- - - "~>"
172
- - !ruby/object:Gem::Version
173
- version: '0.9'
174
- type: :development
175
- prerelease: false
176
- version_requirements: !ruby/object:Gem::Requirement
177
- requirements:
178
- - - "~>"
179
- - !ruby/object:Gem::Version
180
- version: '0.9'
181
- - !ruby/object:Gem::Dependency
182
- name: spork
183
- requirement: !ruby/object:Gem::Requirement
184
- requirements:
185
- - - "~>"
186
- - !ruby/object:Gem::Version
187
- version: '0.9'
188
- type: :development
189
- prerelease: false
190
- version_requirements: !ruby/object:Gem::Requirement
191
- requirements:
192
- - - "~>"
193
- - !ruby/object:Gem::Version
194
- version: '0.9'
195
- - !ruby/object:Gem::Dependency
196
- name: webmock
197
- requirement: !ruby/object:Gem::Requirement
198
- requirements:
199
- - - "~>"
200
- - !ruby/object:Gem::Version
201
- version: '1.20'
202
- type: :development
203
- prerelease: false
204
- version_requirements: !ruby/object:Gem::Requirement
205
- requirements:
206
- - - "~>"
207
- - !ruby/object:Gem::Version
208
- version: '1.20'
209
- - !ruby/object:Gem::Dependency
210
- name: yard
211
- requirement: !ruby/object:Gem::Requirement
212
- requirements:
213
- - - "~>"
214
- - !ruby/object:Gem::Version
215
- version: '0.8'
216
- type: :development
217
- prerelease: false
218
- version_requirements: !ruby/object:Gem::Requirement
219
- requirements:
220
- - - "~>"
221
- - !ruby/object:Gem::Version
222
- version: '0.8'
223
- - !ruby/object:Gem::Dependency
224
- name: libnotify
225
- requirement: !ruby/object:Gem::Requirement
226
- requirements:
227
- - - ">="
228
- - !ruby/object:Gem::Version
229
- version: '0'
230
- type: :development
231
- prerelease: false
232
- version_requirements: !ruby/object:Gem::Requirement
233
- requirements:
234
- - - ">="
235
- - !ruby/object:Gem::Version
236
- version: '0'
237
- - !ruby/object:Gem::Dependency
238
- name: rb-inotify
239
- requirement: !ruby/object:Gem::Requirement
240
- requirements:
241
- - - ">="
242
- - !ruby/object:Gem::Version
243
- version: '0'
244
- type: :development
245
- prerelease: false
246
- version_requirements: !ruby/object:Gem::Requirement
247
- requirements:
248
- - - ">="
249
- - !ruby/object:Gem::Version
250
- version: '0'
251
41
  description: Validate URLs
252
42
  email: c_inconnu2@yahoo.fr
253
43
  executables: []
@@ -256,53 +46,20 @@ extra_rdoc_files:
256
46
  - LICENSE.txt
257
47
  - README.md
258
48
  files:
259
- - ".document"
260
- - ".rspec"
261
- - ".ruby-gemset"
262
- - ".ruby-version"
263
- - ".travis.yml"
264
49
  - CHANGELOG.md
265
- - Gemfile
266
- - Gemfile.lock
267
- - Guardfile
268
50
  - LICENSE.txt
269
51
  - README.md
270
- - Rakefile
271
- - VERSION
272
52
  - lib/ndd/url_checker.rb
273
53
  - lib/ndd/url_checker/abstract_url_checker.rb
274
54
  - lib/ndd/url_checker/blocking_url_checker.rb
275
55
  - lib/ndd/url_checker/forked_url_checker.rb
276
56
  - lib/ndd/url_checker/parallel_url_checker.rb
277
- - lib/ndd/url_checker/reporting_url_checker.csv.erb
278
- - lib/ndd/url_checker/reporting_url_checker.html.erb
279
- - lib/ndd/url_checker/reporting_url_checker.json.erb
280
57
  - lib/ndd/url_checker/reporting_url_checker.rb
281
58
  - lib/ndd/url_checker/status.rb
282
59
  - lib/ndd/url_checker/status_decorator.rb
283
60
  - lib/ndd/url_checker/threaded_url_checker.rb
284
- - ndd-url_checker.gemspec
285
- - spec/ndd/url_checker/abstract_url_checker_spec.rb
286
- - spec/ndd/url_checker/blocking_url_checker_spec.rb
287
- - spec/ndd/url_checker/forked_url_checker_spec.rb
288
- - spec/ndd/url_checker/parallel_url_checker_spec.rb
289
- - spec/ndd/url_checker/reporting_url_checker/custom.txt.erb
290
- - spec/ndd/url_checker/reporting_url_checker/multiple_urls.csv
291
- - spec/ndd/url_checker/reporting_url_checker/multiple_urls.html
292
- - spec/ndd/url_checker/reporting_url_checker/multiple_urls.json
293
- - spec/ndd/url_checker/reporting_url_checker/multiple_urls.txt
294
- - spec/ndd/url_checker/reporting_url_checker/single_url.csv
295
- - spec/ndd/url_checker/reporting_url_checker/single_url.html
296
- - spec/ndd/url_checker/reporting_url_checker/single_url.json
297
- - spec/ndd/url_checker/reporting_url_checker/single_url.txt
298
- - spec/ndd/url_checker/reporting_url_checker_spec.rb
299
- - spec/ndd/url_checker/status_decorator_spec.rb
300
- - spec/ndd/url_checker/status_spec.rb
301
- - spec/ndd/url_checker/threaded_url_checker_spec.rb
302
- - spec/spec_helper.rb
303
- - spec/support/multiple_url_checker_spec.rb
304
- - spec/support/single_url_checker_spec.rb
305
- homepage: http://github.com/ddidier/ndd-url_checker
61
+ - lib/ndd/url_checker/version.rb
62
+ homepage: https://github.com/ddidier/ndd-url_checker
306
63
  licenses:
307
64
  - MIT
308
65
  metadata: {}
@@ -314,7 +71,10 @@ required_ruby_version: !ruby/object:Gem::Requirement
314
71
  requirements:
315
72
  - - ">="
316
73
  - !ruby/object:Gem::Version
317
- version: '0'
74
+ version: 2.0.0
75
+ - - "<"
76
+ - !ruby/object:Gem::Version
77
+ version: '2.4'
318
78
  required_rubygems_version: !ruby/object:Gem::Requirement
319
79
  requirements:
320
80
  - - ">="
@@ -322,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
322
82
  version: '0'
323
83
  requirements: []
324
84
  rubyforge_project:
325
- rubygems_version: 2.5.0
85
+ rubygems_version: 2.5.1
326
86
  signing_key:
327
87
  specification_version: 4
328
88
  summary: Validate URLs