InternalW3cValidation 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +15 -0
  2. data/lib/InternalW3cValidator.rb +28 -0
  3. metadata +44 -0
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NDk1OWM5Yzc3MDM5ZmIxNGJkMjllZGU2N2YwYjRkY2Y2YjVmNDBiMw==
5
+ data.tar.gz: !binary |-
6
+ MTI0NzU4NjcxMGMwZGM2NjdlNzk3MGZkYmY2NzA1ODYxYzA4ZjMzZQ==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ MjY2MGJlZWE0OTZhNDRmYzAzYjE1NjQ3ZDBhZTk3MzhiODYyYjEzZDA1MzU1
10
+ ZDk2YWZlNjg5YjNmMmZjZWE2MTFhZTM2ZGY5MzNiNzYzZGYwMjJjNWI5MDc3
11
+ MDVkMzM1ZjBjZTRjZmMxMzNmYjU4MzgzNTdjNGMxZDUzNDEwZGQ=
12
+ data.tar.gz: !binary |-
13
+ NmNjMWYzMGU4NWY5MzUyNjMzOWI4YTY2N2I4ZDc1MjBjYWNkMGQwYmM2Njdj
14
+ MWQxY2I2MjA1OTIzYzQ1ZDZmODY5NjRjZTAxNjEzMzYzN2I0Y2QwM2FmODdh
15
+ MTFiYjk3Njg5MWYyNjM4NWFlZTI5ZTYzNDBjYmViOTFjNmQ4ZTg=
@@ -0,0 +1,28 @@
1
+ require 'peach'
2
+ require 'w3c_validators'
3
+
4
+ include W3CValidators
5
+
6
+ class InternalW3cValidator
7
+ def initialize(pageContentsRepository = PageContentsRepository.new)
8
+ @pageContentsRepository = pageContentsRepository
9
+ end
10
+
11
+ def validate_pages(pages)
12
+ errors = []
13
+ pages.peach do | page_uri |
14
+ pageHtml = @pageContentsRepository.get(page_uri)
15
+ result = MarkupValidator.new.validate_text(pageHtml)
16
+ errors += result.errors
17
+ end
18
+ return errors
19
+ end
20
+ end
21
+
22
+ class PageContentsRepository
23
+ require 'open-uri'
24
+
25
+ def get(pageUri)
26
+ open(pageUri).read
27
+ end
28
+ end
metadata ADDED
@@ -0,0 +1,44 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: InternalW3cValidation
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - iainjmitchell
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-04-17 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description:
14
+ email: iainjmitchell@gmail.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/InternalW3cValidator.rb
20
+ homepage: https://github.com/code-computerlove/internal-w3c-validation
21
+ licenses:
22
+ - MIT
23
+ metadata: {}
24
+ post_install_message:
25
+ rdoc_options: []
26
+ require_paths:
27
+ - lib
28
+ required_ruby_version: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ required_rubygems_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ requirements: []
39
+ rubyforge_project:
40
+ rubygems_version: 2.2.2
41
+ signing_key:
42
+ specification_version: 4
43
+ summary: Allows internal servers to be validated by W3C
44
+ test_files: []