html_validation 0.5.6 → 0.6.0
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.rdoc
CHANGED
@@ -91,7 +91,7 @@ On linux/OS X machines, confirm the right installation path using: which tidy
|
|
91
91
|
in the data_folder. Typically this is the default folder: .validation in the project root.
|
92
92
|
After a validation fails, run the thor task to accept or reject validation exceptions.
|
93
93
|
|
94
|
-
From your project's root folder, run:
|
94
|
+
From your project's root folder, run: html_validation review
|
95
95
|
|
96
96
|
The result string is checked as a whole, so changes require re-review.
|
97
97
|
|
@@ -5,7 +5,7 @@ require 'thor'
|
|
5
5
|
require 'html_validation'
|
6
6
|
|
7
7
|
|
8
|
-
class
|
8
|
+
class HTMLValidationReview < Thor
|
9
9
|
include PageValidations
|
10
10
|
desc "review", "Review and Accept (or fix and rerun) HTML Validation errors"
|
11
11
|
|
@@ -30,4 +30,4 @@ class Validation < Thor
|
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
|
-
|
33
|
+
HTMLValidationReview.start
|
data/html_validation.gemspec
CHANGED
@@ -12,6 +12,6 @@ Gem::Specification.new do |gem|
|
|
12
12
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
13
13
|
gem.name = "html_validation"
|
14
14
|
gem.require_paths = ["lib"]
|
15
|
-
gem.executables = ['
|
15
|
+
gem.executables = ['html_validation']
|
16
16
|
gem.version = PageValidations::HTML_VALIDATOR_VERSION
|
17
17
|
end
|
@@ -1,37 +1,37 @@
|
|
1
1
|
|
2
2
|
|
3
3
|
module PageValidations
|
4
|
-
|
4
|
+
|
5
5
|
class HaveValidHTML
|
6
|
-
|
6
|
+
|
7
7
|
# This is the matching method called by RSpec
|
8
8
|
# The response is passed in as an argument when you do this:
|
9
9
|
# page.should have_valid_html
|
10
|
-
|
10
|
+
|
11
11
|
@@html_in_failures = false
|
12
|
-
|
12
|
+
|
13
13
|
def self.show_html_in_failures=(val)
|
14
14
|
@@html_in_failures = val
|
15
15
|
end
|
16
|
-
|
16
|
+
|
17
17
|
def matches?(page)
|
18
18
|
h = HTMLValidation.new
|
19
19
|
@v = h.validation(page.body, page.current_url)
|
20
20
|
@v.valid?
|
21
21
|
end
|
22
|
-
|
22
|
+
|
23
23
|
def description
|
24
24
|
"Have valid html"
|
25
25
|
end
|
26
26
|
|
27
27
|
def failure_message_for_should
|
28
|
-
"#{@v.resource} Invalid html (fix or run '
|
28
|
+
"#{@v.resource} Invalid html (fix or run 'html_validation review' to add exceptions)\n#{@v.resource} exceptions:\n #{@v.exceptions}\n\n #{@v.html if @@html_in_failures}"
|
29
29
|
end
|
30
|
-
|
30
|
+
|
31
31
|
def failure_message_for_should_not
|
32
32
|
"#{@v.resource} Expected valid? to fail but didn't. Did you accidentally accept these validation errors? \n#{@v.resource} exceptions:\n #{@v.exceptions}\n\n #{@v.html if @@html_in_failures}"
|
33
|
-
end
|
34
|
-
|
33
|
+
end
|
34
|
+
|
35
35
|
end
|
36
36
|
|
37
37
|
def have_valid_html
|
@@ -60,7 +60,7 @@ module PageValidations
|
|
60
60
|
# Note that changing this setting (or any flag) can change how
|
61
61
|
# the result files are seen in terms of their acceptance.
|
62
62
|
# Meaning, if you have previously accepted a page with warnings either
|
63
|
-
# on or off, you will probably need to re-run the '
|
63
|
+
# on or off, you will probably need to re-run the 'html_validation review' command
|
64
64
|
# following your first run with the new setting.
|
65
65
|
def self.show_warnings=(val)
|
66
66
|
if val
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: html_validation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -16,7 +16,7 @@ description: HTML Validation lets you validate html locally. Lets you build html
|
|
16
16
|
email:
|
17
17
|
- ebeland@gmail.com
|
18
18
|
executables:
|
19
|
-
-
|
19
|
+
- html_validation
|
20
20
|
extensions: []
|
21
21
|
extra_rdoc_files: []
|
22
22
|
files:
|
@@ -28,7 +28,7 @@ files:
|
|
28
28
|
- LICENSE.txt
|
29
29
|
- README.rdoc
|
30
30
|
- Rakefile
|
31
|
-
- bin/
|
31
|
+
- bin/html_validation
|
32
32
|
- html_validation.gemspec
|
33
33
|
- lib/html_validation.rb
|
34
34
|
- lib/html_validation/have_valid_html.rb
|