html_acceptance 0.1.2 → 0.1.4
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 +3 -3
- data/VERSION +1 -1
- data/html_acceptance.gemspec +1 -1
- data/lib/html_acceptance/html_acceptance_result.rb +4 -4
- data/lib/tasks/html_acceptance.rake +6 -12
- metadata +3 -3
data/README.rdoc
CHANGED
@@ -36,10 +36,10 @@ any errors and warnings.
|
|
36
36
|
When failures occur, data regarding the failure, the html involved, and the exception
|
37
37
|
return is stored within the data folder passed into HTMLAcceptance. To accept the failures/errors
|
38
38
|
just open the folder, and find the .exception.txt file for the resource and rename it with
|
39
|
-
.accepted.txt. Alternately, to review all failing tests, copy the html_acceptance
|
40
|
-
and run it as follows:
|
39
|
+
.accepted.txt. Alternately, to review all failing tests, copy the included html_acceptance
|
40
|
+
rake task into your app and run it as follows:
|
41
41
|
|
42
|
-
rake html_acceptance
|
42
|
+
rake html_acceptance[/tmp/validation]
|
43
43
|
|
44
44
|
Replace the data path with whatever folder you passed to HTMLAcceptance when you initially
|
45
45
|
ran the validations.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.4
|
data/html_acceptance.gemspec
CHANGED
@@ -13,10 +13,10 @@ class HTMLAcceptanceResult
|
|
13
13
|
end
|
14
14
|
|
15
15
|
# takes a .url.txt and loads the data into this object
|
16
|
-
def self.
|
17
|
-
|
18
|
-
|
19
|
-
|
16
|
+
def self.load_from_files(datapath)
|
17
|
+
resource = File.open("#{datapath}.resource.txt", 'r').read
|
18
|
+
html = File.open("#{datapath}.html.txt", 'r').read
|
19
|
+
HTMLAcceptanceResult.new(resource, html, datapath)
|
20
20
|
end
|
21
21
|
|
22
22
|
# Validates an html string using html tidy. If there are no warnings or exceptions, or
|
@@ -1,20 +1,14 @@
|
|
1
|
-
require 'rake'
|
2
|
-
#require 'html_acceptance'
|
3
1
|
|
4
2
|
desc 'Accept HTML validation exceptions results'
|
5
|
-
task :html_acceptance do
|
6
|
-
|
7
|
-
unless ENV.include?("DATA_PATH")
|
8
|
-
raise "usage: rake html_acceptance DATA_PATH=foo"
|
9
|
-
end
|
3
|
+
task :html_acceptance, :data_path do |t, args|
|
10
4
|
|
11
|
-
HTMLAcceptance.new(
|
12
|
-
$stdout.puts "Validation Exceptions:\n
|
5
|
+
HTMLAcceptance.new(args.data_path).each_exception do |result|
|
6
|
+
$stdout.puts "Validation Exceptions for #{result.resource}:\n#{result.exceptions}"
|
13
7
|
$stdout.puts "Accept (y)es or (n)o"
|
14
8
|
sin=$stdin.gets
|
15
|
-
result.accept! if sin.first == 'y'
|
16
|
-
exit if sin == 'exit'
|
17
|
-
|
9
|
+
result.accept! if sin.first.downcase == 'y'
|
10
|
+
exit if sin.downcase == 'exit'
|
11
|
+
end
|
18
12
|
|
19
13
|
end
|
20
14
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: html_acceptance
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 4
|
10
|
+
version: 0.1.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Eric Beland
|