assert_valid_markup 0.5.1 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/assert_valid_markup.rb +13 -3
  3. metadata +36 -21
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.1
1
+ 0.6.0
@@ -100,7 +100,7 @@ class Test::Unit::TestCase
100
100
  tmpfile = Tempfile.new('xmllint')
101
101
  tmpfile.write(xmldata)
102
102
  tmpfile.close
103
- validation_output = `xmllint --catalogs --memory --noout #{dtd_validate ? '--valid' : ''} #{tmpfile.path} 2>&1`
103
+ validation_output = `xmllint --catalogs --memory --noout #{dtd_validate ? '--valid' : ''} #{tmpfile.path} 2>&1`.lines.to_a
104
104
  ENV.delete("XML_DEBUG_CATALOG")
105
105
 
106
106
  added_to_catalog = false
@@ -137,7 +137,17 @@ class Test::Unit::TestCase
137
137
  return local_validate(xmldata, dtd_validate, catalog_path)
138
138
  else
139
139
  validation_failed = validation_output.grep(/^#{Regexp.escape(tmpfile.path)}:/)
140
- return validation_failed.collect {|l| l.gsub(/^[^:]*:/, "Invalid markup: line ")}.join("\n")
140
+ msg = []
141
+ validation_failed.each do |l|
142
+ msg << l.gsub(/^[^:]*:/, "Invalid markup: line ")
143
+ if l =~ /^[^:]*:(\d+)/
144
+ line = $1.to_i
145
+ ((line - 1)..(line + 1)).each do |ln|
146
+ msg << "\t#{ln}: #{xmldata.lines.to_a[ln-1]}"
147
+ end
148
+ end
149
+ end
150
+ return msg.join("\n")
141
151
  end
142
152
  end
143
153
 
@@ -163,4 +173,4 @@ class Test::Unit::TestCase
163
173
  end
164
174
  return validation_result
165
175
  end
166
- end
176
+ end
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: assert_valid_markup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 6
8
+ - 0
9
+ version: 0.6.0
5
10
  platform: ruby
6
11
  authors:
7
12
  - Matt Conway
@@ -9,49 +14,57 @@ autorequire:
9
14
  bindir: bin
10
15
  cert_chain: []
11
16
 
12
- date: 2009-10-28 00:00:00 -04:00
17
+ date: 2010-03-29 00:00:00 -04:00
13
18
  default_executable:
14
19
  dependencies:
15
20
  - !ruby/object:Gem::Dependency
16
21
  name: mocha
17
- type: :development
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
20
24
  requirements:
21
25
  - - ">="
22
26
  - !ruby/object:Gem::Version
27
+ segments:
28
+ - 0
23
29
  version: "0"
24
- version:
30
+ type: :development
31
+ version_requirements: *id001
25
32
  - !ruby/object:Gem::Dependency
26
33
  name: shoulda
27
- type: :development
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
34
+ prerelease: false
35
+ requirement: &id002 !ruby/object:Gem::Requirement
30
36
  requirements:
31
37
  - - ">="
32
38
  - !ruby/object:Gem::Version
39
+ segments:
40
+ - 0
33
41
  version: "0"
34
- version:
42
+ type: :development
43
+ version_requirements: *id002
35
44
  - !ruby/object:Gem::Dependency
36
45
  name: activesupport
37
- type: :development
38
- version_requirement:
39
- version_requirements: !ruby/object:Gem::Requirement
46
+ prerelease: false
47
+ requirement: &id003 !ruby/object:Gem::Requirement
40
48
  requirements:
41
49
  - - ">="
42
50
  - !ruby/object:Gem::Version
51
+ segments:
52
+ - 0
43
53
  version: "0"
44
- version:
54
+ type: :development
55
+ version_requirements: *id003
45
56
  - !ruby/object:Gem::Dependency
46
57
  name: xml-simple
47
- type: :runtime
48
- version_requirement:
49
- version_requirements: !ruby/object:Gem::Requirement
58
+ prerelease: false
59
+ requirement: &id004 !ruby/object:Gem::Requirement
50
60
  requirements:
51
61
  - - ">="
52
62
  - !ruby/object:Gem::Version
63
+ segments:
64
+ - 0
53
65
  version: "0"
54
- version:
66
+ type: :runtime
67
+ version_requirements: *id004
55
68
  description: Also contains some conveniences such as a flag to clear w3c cache at runtime, and some other cleanups
56
69
  email: wr0ngway@yahoo.com
57
70
  executables: []
@@ -81,18 +94,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
81
94
  requirements:
82
95
  - - ">="
83
96
  - !ruby/object:Gem::Version
97
+ segments:
98
+ - 0
84
99
  version: "0"
85
- version:
86
100
  required_rubygems_version: !ruby/object:Gem::Requirement
87
101
  requirements:
88
102
  - - ">="
89
103
  - !ruby/object:Gem::Version
104
+ segments:
105
+ - 0
90
106
  version: "0"
91
- version:
92
107
  requirements: []
93
108
 
94
109
  rubyforge_project:
95
- rubygems_version: 1.3.5
110
+ rubygems_version: 1.3.6
96
111
  signing_key:
97
112
  specification_version: 3
98
113
  summary: Fork of assert_valid_markup, sped up by using xmllint locally rather than hitting w3c service