css_parser 1.4.5 → 1.4.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/css_parser/parser.rb +2 -0
- data/lib/css_parser/rule_set.rb +2 -2
- data/lib/css_parser/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: 3266d5e76da74caaa4f66fcc40ba302f348ce36f
|
4
|
+
data.tar.gz: 9ce0b4f0879e2e17be75f7b60b73f6b16431bedc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ecf26eea3319b6f711e6e9615a43087a0faf622bd18fd44108b3985008f6455f7cbb0a38b4915d273e2b3c76a74d217bb6d1f0f9de0e41f87b7bdeca7a1bfe8
|
7
|
+
data.tar.gz: a3ae898d27a058630443c7be3f710e364bd0c593c4aa364d905ecc42454076bfaeb3c83f9dac56c847968b3c2701aa83aff66d9601342e986f4be3c3275875bb
|
data/lib/css_parser/parser.rb
CHANGED
@@ -80,6 +80,8 @@ module CssParser
|
|
80
80
|
rule_sets = []
|
81
81
|
|
82
82
|
selectors.each do |selector|
|
83
|
+
selector.gsub!(/\s+/, ' ')
|
84
|
+
selector.strip!
|
83
85
|
each_rule_set(media_types) do |rule_set, media_type|
|
84
86
|
if !rule_sets.member?(rule_set) && rule_set.selectors.member?(selector)
|
85
87
|
rule_sets << rule_set
|
data/lib/css_parser/rule_set.rb
CHANGED
@@ -469,7 +469,7 @@ module CssParser
|
|
469
469
|
if @declarations.has_key?(dest)
|
470
470
|
#puts "dest #{dest} already exists"
|
471
471
|
|
472
|
-
if @declarations[dest][:order] > @declarations[src][:order]
|
472
|
+
if @declarations[src][:order].nil? || (!@declarations[dest][:order].nil? && @declarations[dest][:order] > @declarations[src][:order])
|
473
473
|
#puts "skipping #{dest}:#{v} due to order "
|
474
474
|
return
|
475
475
|
else
|
@@ -505,7 +505,7 @@ module CssParser
|
|
505
505
|
# TODO: way too simplistic
|
506
506
|
#++
|
507
507
|
def parse_selectors!(selectors) # :nodoc:
|
508
|
-
@selectors = selectors.split(',').map { |s| s.strip }
|
508
|
+
@selectors = selectors.split(',').map { |s| s.gsub(/\s+/, ' ').strip }
|
509
509
|
end
|
510
510
|
end
|
511
511
|
end
|
data/lib/css_parser/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: css_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Dunae
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|