code_terminator 0.4.10 → 0.4.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exercises/issue14.html +0 -1
- data/lib/code_terminator/html.rb +23 -12
- data/lib/code_terminator/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b76dd452042adda33c441f4a7e84c6dcb1d5f26
|
4
|
+
data.tar.gz: 20d8fcaee74dc97e05af018c83e5776d85eaed70
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74548c5bbfd5d923759db75f972f727e286b3f778ea86d392fd8816021dfb3a0266560c864499dc95558a0d1a30e289c7d7e1df7424ce1d8ac3e41b9e813d677
|
7
|
+
data.tar.gz: 0f3cf3d0e45ab2765274601f337e583ac49939e245dfd4abafb88c2ec8b1896123d4f873aa337b78422c22500a16f10fdf6ce7cae989000a8b7422c7d554a860
|
data/exercises/issue14.html
CHANGED
data/lib/code_terminator/html.rb
CHANGED
@@ -269,23 +269,33 @@ class CodeTerminator::Html
|
|
269
269
|
# Check the text
|
270
270
|
if !e[:content].nil?
|
271
271
|
if code.css(e[:parent]).count < 2
|
272
|
-
|
273
272
|
#new code
|
274
273
|
if code.css(e[:parent]).class == Nokogiri::XML::NodeSet
|
275
274
|
text_found = false
|
276
275
|
error330 = nil
|
277
|
-
code.css(e[:parent]).children.
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
276
|
+
if code.css(e[:parent]).children.any?
|
277
|
+
code.css(e[:parent]).children.each do |node_child|
|
278
|
+
|
279
|
+
if node_child.class != Nokogiri::XML::Element
|
280
|
+
#embebed code
|
281
|
+
#if code.css(e[:parent]).text != e[:content]
|
282
|
+
if node_child.text.strip != e[:content].strip
|
283
|
+
error330 = new_error(element: e, type: 330, description: "The text inside `<#{e[:parent]}>` should be #{e[:content]}.")
|
284
|
+
else
|
285
|
+
text_found = true
|
286
|
+
end
|
287
|
+
#end embebed code
|
288
|
+
end
|
285
289
|
end
|
286
|
-
|
287
|
-
|
288
|
-
|
290
|
+
else
|
291
|
+
if code.css(e[:parent]).text.strip != e[:content].strip
|
292
|
+
p "text of node: " + code.css(e[:parent]).text
|
293
|
+
error330 = new_error(element: e, type: 330, description: "The text inside `<#{e[:parent]}>` should be #{e[:content]}.")
|
294
|
+
else
|
295
|
+
text_found = true
|
296
|
+
end
|
297
|
+
end
|
298
|
+
|
289
299
|
if !text_found && !error330.nil?
|
290
300
|
html_errors << error330
|
291
301
|
error330 = nil
|
@@ -297,6 +307,7 @@ class CodeTerminator::Html
|
|
297
307
|
exist = false
|
298
308
|
code.css(e[:parent]).each do |code_css|
|
299
309
|
#if code_css.at_css(e[:tag]).parent.name == e[:parent]
|
310
|
+
p "text content: " + code_css.text
|
300
311
|
if code_css.text == e[:content]
|
301
312
|
exist = true
|
302
313
|
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.4.
|
4
|
+
version: 0.4.11
|
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-11-
|
11
|
+
date: 2016-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|