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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dd50ddcbc6c5575dae65ea7aa39bb9572f94c895
4
- data.tar.gz: 208a7389b8e4191cceb13fc5f3a740020ec46881
3
+ metadata.gz: 3266d5e76da74caaa4f66fcc40ba302f348ce36f
4
+ data.tar.gz: 9ce0b4f0879e2e17be75f7b60b73f6b16431bedc
5
5
  SHA512:
6
- metadata.gz: d6227b12349191b220553e9ea1f501548aa18155ceff220d008d047e3f46dc0cac28d24d9f756a6552016eeeb863ccd596e34c7c7547a8596610ef2af9f94429
7
- data.tar.gz: a2108f1f1f3944297e5665f1859a6a0be1a46401c4e86f342e61f5171f967fb840e9277f239cae8e190cb8fcb9f9d8e0183275454525eb12ade957a2446ec862
6
+ metadata.gz: 2ecf26eea3319b6f711e6e9615a43087a0faf622bd18fd44108b3985008f6455f7cbb0a38b4915d273e2b3c76a74d217bb6d1f0f9de0e41f87b7bdeca7a1bfe8
7
+ data.tar.gz: a3ae898d27a058630443c7be3f710e364bd0c593c4aa364d905ecc42454076bfaeb3c83f9dac56c847968b3c2701aa83aff66d9601342e986f4be3c3275875bb
@@ -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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module CssParser
2
- VERSION = "1.4.5".freeze
2
+ VERSION = "1.4.6".freeze
3
3
  end
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.5
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-06-28 00:00:00.000000000 Z
11
+ date: 2016-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable