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 +4 -4
- data/exercises/test.css +1 -1
- data/lib/code_terminator/css.rb +15 -3
- data/lib/code_terminator/html.rb +1 -3
- 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: fc2acf54e2a55848ea0181de083bfb6a43a8414d
|
4
|
+
data.tar.gz: b4950c15a8c0888dc8630f78f1b24118a3440e30
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4fdd2be5345a3f0618a7ae78ddd8d1e0f498b6e97b0e175a9d73081b310dfdb5a01a5d3060a5a78cd162fada9df5b5cd72bd3cc676857594e5046a67f91b1ecb
|
7
|
+
data.tar.gz: 892ec0c1cf7537bcb5b1f70ab53c59d0d59f67c2beab96b1a3d21f2e38d4c381070476039cadd174bc559bfff9cfd6e54988400a9474d1a65e4bc3f4cdd83a74
|
data/exercises/test.css
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
body {
|
2
|
-
background-color:
|
2
|
+
background-color: yellow; }
|
data/lib/code_terminator/css.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
189
|
-
|
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
|
data/lib/code_terminator/html.rb
CHANGED
@@ -184,9 +184,7 @@ class CodeTerminator::Html
|
|
184
184
|
code = Nokogiri::HTML(code)
|
185
185
|
|
186
186
|
elements = get_elements(source)
|
187
|
-
|
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
|
|
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.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-
|
11
|
+
date: 2016-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|