code_terminator 0.5.4 → 0.5.5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 233ef9c63180ce9c609c9d3443768dc21c248fc1
4
- data.tar.gz: 5160c33790932470001b17ed022ffcc8444b9aff
3
+ metadata.gz: 69aeb452b012e5dc968c16d8c681cbf4fecf7f66
4
+ data.tar.gz: 46ee19a648f0e36810939a865a720e9c26398d68
5
5
  SHA512:
6
- metadata.gz: de1ab5d12911a2b911f86d75bdf5c7591d4511d14924575a34b8a090b21aa9162cceb6c9a9ade5837b87e63f55bf202e4c84f77f3f6a200fb971a65dccbab292
7
- data.tar.gz: 1fec0cee3909f8fdbc1c792f22781f38bd1fc397e35e536a9034b4bb0705110fe48de0ac1f0c8e621e8db29eeda42d8c485076869d612b7e31cdf59759ff5911
6
+ metadata.gz: aff1e3b6f3dda1b7334d8cdc58eff28429f4c32b221a144113a8687c17c95f8d155cb112a7e81e2e9732934f070b2ebb048baabbcb58b346114620fe10007ef1
7
+ data.tar.gz: 0cf2eb1b7efb088d79856de00f72d05133b5d8c0d6062f366e06c1910b1709aad9b3591b7067d468235ca71c722c54aa1490f51167b59b63a0f411571b0673b8
@@ -378,22 +378,22 @@ class CodeTerminator::Html
378
378
  # if tag_element
379
379
  if e[:attribute]
380
380
 
381
- p "e --- " + e[:tag].to_s
382
- p "e pt--- " + e[:pointer].to_s
383
- p "e parent pt--- " + e[:parent_pointer].to_s
384
- p "e attribute --- " + e[:attribute].to_s
381
+ # p "e --- " + e[:tag].to_s
382
+ # p "e pt--- " + e[:pointer].to_s
383
+ # p "e parent pt--- " + e[:parent_pointer].to_s
384
+ # p "e attribute --- " + e[:attribute].to_s
385
385
 
386
386
 
387
387
  # if tag.attribute(e[:attribute])
388
388
  # p "elements count = " + css_code_checked.to_s
389
389
  tag_element = css_code_checked.select {|element| element[:pointer].to_s == tag.pointer_id.to_s && element[:original_pointer] == e[:pointer] }.first
390
- p "tag --" + tag.name.to_s
391
- p "tag --" + tag.to_s
392
- p "tag parent -- " + tag.parent.name.to_s
393
- p "tag pointer -- " + tag.pointer_id.to_s
394
- p "tag parent pointer -- " + tag.parent.pointer_id.to_s
395
- p "tag attribute -- " + tag.attribute(e[:attribute]).to_s
396
- p "parent_element --- " + tag_element.to_s
390
+ # p "tag --" + tag.name.to_s
391
+ # p "tag --" + tag.to_s
392
+ # p "tag parent -- " + tag.parent.name.to_s
393
+ # p "tag pointer -- " + tag.pointer_id.to_s
394
+ # p "tag parent pointer -- " + tag.parent.pointer_id.to_s
395
+ # p "tag attribute -- " + tag.attribute(e[:attribute]).to_s
396
+ # p "parent_element --- " + tag_element.to_s
397
397
  # else
398
398
  # end
399
399
 
@@ -403,7 +403,7 @@ class CodeTerminator::Html
403
403
  # p "attribute element " + e[:attribute].to_s
404
404
  # p "attribute tag " + tag.attribute(e[:attribute]).name.to_s
405
405
  # if e[:attribute] != tag.attribute(e[:attribute]).name
406
- p html_errors << new_error(element: e, type: 334, description: "`<#{e[:tag]}>` should have an attribute named #{e[:attribute]}")
406
+ html_errors << new_error(element: e, type: 334, description: "`<#{e[:tag]}>` should have an attribute named #{e[:attribute]}")
407
407
  # end
408
408
  end
409
409
  else
@@ -470,7 +470,8 @@ class CodeTerminator::Html
470
470
  # tag_count = code.css(x[:tag]).length
471
471
  tag_count = elements.select {|element| element[:parent_pointer].to_s == x[:parent_pointer].to_s && element[:tag].to_s == x[:tag]}.count
472
472
  # p x[:tag]!="body"
473
- if tag_count >= 1 && !(x[:tag]=="body" || x[:tag]=="head" || x[:tag]=="text" || x[:tag]=="comment")
473
+ if tag_count >= 1 && !(x[:tag]=="body" || x[:tag]=="head" || x[:tag]=="text" || x[:tag]=="comment" || x[:tag]=="img")
474
+ # if tag_count >= 1 && !(x[:tag]!="div")
474
475
  if x[:count] < tag_count
475
476
  html_errors << new_error(element: x[:tag], type: 404, description: "Remember to add the `<#{x[:tag]}>` tag")
476
477
  end
@@ -590,7 +591,7 @@ class CodeTerminator::Html
590
591
  #@e, node_child
591
592
  #save a error330, text_found
592
593
  #return true (flag)
593
- if node_child.class == Nokogiri::XML::Text && e[:content] != "comment"
594
+ if node_child.class == Nokogiri::XML::Text && e[:tag] != "comment"
594
595
  node_child.text.strip != e[:content].strip ? error330 = new_error(element: e, type: 330, description: "The text inside `<#{e[:parent]}>` should be #{e[:content]}") : text_found = true
595
596
  end
596
597
  end #each
@@ -1,3 +1,3 @@
1
1
  module CodeTerminator
2
- VERSION = "0.5.4"
2
+ VERSION = "0.5.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: code_terminator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evelin Ponce