code_terminator 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/code_terminator-0.2.5.gem +0 -0
- data/code_terminator-0.2.6.gem +0 -0
- data/lib/code_terminator/css.rb +15 -5
- data/lib/code_terminator/html.rb +26 -6
- data/lib/code_terminator/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25941d00626fb70ed84292b3cc0ab04b43210705
|
4
|
+
data.tar.gz: a2b84902e9de3783173141d6df9e07977469fa1e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3f5462fda6d99fc756772324786f688675c571ffdefed1642f4dabd4ea14b16cee7924e15e8e636a7c3d6df6e638db1c74df6f94568dc65b53e7365a235da84
|
7
|
+
data.tar.gz: d7f0ea3dddb4c2e8ada76dafb5e1ee2861022b48b8b1f6fa3d95f491a3f9fa228669f908746a923d9af4d14f335f1d6e90457856b0df25e847a9b0d41908fc4a
|
Binary file
|
Binary file
|
data/lib/code_terminator/css.rb
CHANGED
@@ -185,23 +185,33 @@ class CodeTerminator::Css
|
|
185
185
|
if parser_array.any?
|
186
186
|
parser_property = parser_array[0].split(";")
|
187
187
|
parser_property.each {|a| a.strip! if a.respond_to? :strip! }
|
188
|
-
p parser_property.inspect
|
189
188
|
|
190
189
|
if e[:value]==""
|
191
190
|
property = e[:property] + ": "
|
192
191
|
if parser_property.empty? { |s| s.include?(property) }
|
193
|
-
|
192
|
+
node = Hash.new
|
193
|
+
node[:element] = e
|
194
|
+
node[:type] = 111
|
195
|
+
node[:description] = "not the same property " + property + " in selector " + item
|
196
|
+
css_errors << node
|
194
197
|
end
|
195
198
|
else
|
196
199
|
property = e[:property] + ": " + e[:value]
|
197
200
|
if !parser_property.include?(property)
|
198
|
-
|
201
|
+
node = Hash.new
|
202
|
+
node[:element] = e
|
203
|
+
node[:type] = 111
|
204
|
+
node[:description] = "not the same property " + property + " in selector " + item
|
205
|
+
css_errors << node
|
199
206
|
end
|
200
207
|
end
|
201
|
-
p property
|
202
208
|
|
203
209
|
else
|
204
|
-
|
210
|
+
node = Hash.new
|
211
|
+
node[:element] = e
|
212
|
+
node[:type] = 101
|
213
|
+
node[:description] = "property "+ property + " not found in " + item
|
214
|
+
css_errors << node
|
205
215
|
end
|
206
216
|
end
|
207
217
|
end
|
data/lib/code_terminator/html.rb
CHANGED
@@ -184,7 +184,7 @@ class CodeTerminator::Html
|
|
184
184
|
code = Nokogiri::HTML(code)
|
185
185
|
|
186
186
|
elements = get_elements(source)
|
187
|
-
|
187
|
+
|
188
188
|
elements.each do |e|
|
189
189
|
item = e[:tag]
|
190
190
|
|
@@ -192,7 +192,11 @@ class CodeTerminator::Html
|
|
192
192
|
|
193
193
|
if !e[:content].nil?
|
194
194
|
if code.css(e[:parent]).text != e[:content]
|
195
|
-
|
195
|
+
node = Hash.new
|
196
|
+
node[:element] = e
|
197
|
+
node[:type] = 330
|
198
|
+
node[:description] = e[:parent] + " haven't the same text " + e[:content]
|
199
|
+
html_errors << node
|
196
200
|
end
|
197
201
|
#e[:content] == code.css()
|
198
202
|
|
@@ -203,22 +207,38 @@ class CodeTerminator::Html
|
|
203
207
|
|
204
208
|
if !e[:attribute].nil?
|
205
209
|
if code.css(e[:tag]).attribute(e[:attribute]).nil?
|
206
|
-
|
210
|
+
node = Hash.new
|
211
|
+
node[:element] = e
|
212
|
+
node[:type] = 334
|
213
|
+
node[:description] = e[:attribute] + " not exist in " + e[:tag]
|
214
|
+
html_errors << node
|
207
215
|
else
|
208
216
|
if code.css(e[:tag]).attribute(e[:attribute]).value != e[:value]
|
209
|
-
|
217
|
+
node = Hash.new
|
218
|
+
node[:element] = e
|
219
|
+
node[:type] = 333
|
220
|
+
node[:description] = e[:attribute] + " not is the same value " + e[:value]
|
221
|
+
html_errors << node
|
210
222
|
end
|
211
223
|
end
|
212
224
|
end
|
213
225
|
|
214
226
|
if code.at_css(e[:tag]).parent.name != e[:parent]
|
215
|
-
|
227
|
+
node = Hash.new
|
228
|
+
node[:element] = e
|
229
|
+
node[:type] = 440
|
230
|
+
node[:description] = e[:tag] + " not exist in " + e[:parent]
|
231
|
+
html_errors << node
|
216
232
|
end
|
217
233
|
|
218
234
|
else
|
219
235
|
|
220
236
|
if code.at_css(e[:tag]).nil?
|
221
|
-
|
237
|
+
node = Hash.new
|
238
|
+
node[:element] = e
|
239
|
+
node[:type] = 404
|
240
|
+
node[:description] = e[:tag] + " not exist"
|
241
|
+
html_errors << node
|
222
242
|
end
|
223
243
|
|
224
244
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: code_terminator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evelin Ponce
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -79,6 +79,8 @@ files:
|
|
79
79
|
- code_terminator-0.2.2.gem
|
80
80
|
- code_terminator-0.2.3.gem
|
81
81
|
- code_terminator-0.2.4.gem
|
82
|
+
- code_terminator-0.2.5.gem
|
83
|
+
- code_terminator-0.2.6.gem
|
82
84
|
- code_terminator.gemspec
|
83
85
|
- exe/code_terminator
|
84
86
|
- exercises/new.html
|