code_terminator 0.2.5 → 0.2.6

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: 7334a3f361f3189eecb60336d40da9508c4e086b
4
- data.tar.gz: 6bee9d20453dd1b59600e386bb8a0928ce45229e
3
+ metadata.gz: fc2acf54e2a55848ea0181de083bfb6a43a8414d
4
+ data.tar.gz: b4950c15a8c0888dc8630f78f1b24118a3440e30
5
5
  SHA512:
6
- metadata.gz: 0274f810102df8e3ff8f94423d60fa733fd984dc2351a345887d123b9a4cd5e6aa43b11f812ce45a4ec4e5832d914de21c0d5ab99579b4c2fb8b570fa37d42f3
7
- data.tar.gz: b595909e2023b80cdaef6543e63d00cd303fb54e5b1ddf3b0757fe79eadded1e5a8387b5071c4b03d7d285bce23fd9585c44b41b861cdda885efdef4f9e7a4db
6
+ metadata.gz: 4fdd2be5345a3f0618a7ae78ddd8d1e0f498b6e97b0e175a9d73081b310dfdb5a01a5d3060a5a78cd162fada9df5b5cd72bd3cc676857594e5046a67f91b1ecb
7
+ data.tar.gz: 892ec0c1cf7537bcb5b1f70ab53c59d0d59f67c2beab96b1a3d21f2e38d4c381070476039cadd174bc559bfff9cfd6e54988400a9474d1a65e4bc3f4cdd83a74
data/exercises/test.css CHANGED
@@ -1,2 +1,2 @@
1
1
  body {
2
- background-color: lightblue; }
2
+ background-color: yellow; }
@@ -180,14 +180,26 @@ class CodeTerminator::Css
180
180
  elements.each do |e|
181
181
  item = e[:selector]
182
182
  if !e[:property].nil?
183
- property = e[:property] + ": " + e[:value]
183
+
184
184
  parser_array = parser.find_by_selector(item)
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
- if !parser_property.include?(property)
189
- css_errors << "not the same property " + property + " in selector " + item
188
+ p parser_property.inspect
189
+
190
+ if e[:value]==""
191
+ property = e[:property] + ": "
192
+ if parser_property.empty? { |s| s.include?(property) }
193
+ css_errors << "not the same property " + property + " in selector " + item
194
+ end
195
+ else
196
+ property = e[:property] + ": " + e[:value]
197
+ if !parser_property.include?(property)
198
+ css_errors << "not the same property " + property + " in selector " + item
199
+ end
190
200
  end
201
+ p property
202
+
191
203
  else
192
204
  css_errors << "property "+ property + " not found in " + item
193
205
  end
@@ -184,9 +184,7 @@ class CodeTerminator::Html
184
184
  code = Nokogiri::HTML(code)
185
185
 
186
186
  elements = get_elements(source)
187
- #@elements = Html::PrintElements.call(elements)
188
- # '[{:parent=>"body", :tag=>"div"}, {:parent=>"body", :tag=>"div", :attribute=>"class", :value=>"col-md-12"}, {:parent=>"div", :tag=>"h2"}, {:parent=>"h2", :tag=>"text", :content=>"hola test"}, {:parent=>"div", :tag=>"h1"}] '
189
-
187
+
190
188
  elements.each do |e|
191
189
  item = e[:tag]
192
190
 
@@ -1,3 +1,3 @@
1
1
  module CodeTerminator
2
- VERSION = "0.2.5"
2
+ VERSION = "0.2.6"
3
3
  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.5
4
+ version: 0.2.6
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-25 00:00:00.000000000 Z
11
+ date: 2016-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler