html_acceptance 0.1.2 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
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 rake task
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 DATA_PATH='/yourproject/validations'
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.2
1
+ 0.1.4
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{html_acceptance}
8
- s.version = "0.1.2"
8
+ s.version = "0.1.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Eric Beland"]
@@ -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.load_from_file(file_root)
17
- @resourcepath = File.open("#{file_root}.resource.txt", 'r').read
18
- @html = File.open("#{file_root}.html.txt", 'r').read
19
- @exceptions = File.open("#{file_root}.exceptions.txt").read
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(env['DATA_PATH']).each_exception do |result|
12
- $stdout.puts "Validation Exceptions:\n #{result}"
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
- end
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: 31
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 4
10
+ version: 0.1.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Eric Beland