css_parser 1.10.0 → 1.11.0

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
  SHA256:
3
- metadata.gz: 5de40b5ed5a0e298dcf2bbb5461b0643a2044f0ee314f1211695da1e8b0c15a1
4
- data.tar.gz: 8db5565c440bb65113054f58354d8dcfb4c761b2e3a1b1c4d4d758c9f74aa3f8
3
+ metadata.gz: 351dd37c4f67732bcc07deb8d86c00ff6d15931787a3c08880ee8b4321fdf27e
4
+ data.tar.gz: bc830e26b6b15e06af401f0a1e9abed835e2deec34cd2986c428baca1d51d18b
5
5
  SHA512:
6
- metadata.gz: 28b3ff2dcd11c1803a74175fdebd8592aab0da5b5df608a92923a9c56bb1dd41fba217b73ccc1a919b4ba6468c9ecb1e5a57f4fd4cce989307f08acf0c7d28ac
7
- data.tar.gz: 3a0bcb5fb3c71f057ce7bdcf506aeca30829bb22558787d1d73c8a3a539f65cc9bcef9ead07c87f379378ec6885cc31b919582c1961eb8e921f81b04c620e949
6
+ metadata.gz: 0013771da7b78cf5f9ef4edb4af039a535d4b9e8709d68808159a27df9f6d76649f6976f4bbecace5773e5b7b1d1fc3e3a7afbd85be267765d5beee2ac565877
7
+ data.tar.gz: 7ef404fe368409bb2951764e232b2364522b76a5c72f171c4560f5ba70a3c51b0d149709a9e4777ae2bc8049241358b6b382005fdc18298ea0d8b24085476a15
@@ -511,23 +511,22 @@ module CssParser
511
511
  #
512
512
  # TODO: this is extremely similar to create_background_shorthand! and should be combined
513
513
  def create_border_shorthand! # :nodoc:
514
- values = []
515
-
516
- BORDER_STYLE_PROPERTIES.each do |property|
514
+ values = BORDER_STYLE_PROPERTIES.map do |property|
517
515
  next unless (declaration = declarations[property])
518
516
  next if declaration.important
519
-
520
517
  # can't merge if any value contains a space (i.e. has multiple values)
521
518
  # we temporarily remove any spaces after commas for the check (inside rgba, etc...)
522
- return nil if declaration.value.gsub(/,\s/, ',').strip =~ /\s/
519
+ next if declaration.value.gsub(/,\s/, ',').strip =~ /\s/
523
520
 
524
- values << declaration.value
521
+ declaration.value
522
+ end.compact
523
+
524
+ return if values.size != BORDER_STYLE_PROPERTIES.size
525
525
 
526
+ BORDER_STYLE_PROPERTIES.each do |property|
526
527
  declarations.delete(property)
527
528
  end
528
529
 
529
- return if values.empty?
530
-
531
530
  declarations['border'] = values.join(' ')
532
531
  end
533
532
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CssParser
4
- VERSION = '1.10.0'.freeze
4
+ VERSION = '1.11.0'.freeze
5
5
  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.10.0
4
+ version: 1.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Dunae
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-27 00:00:00.000000000 Z
11
+ date: 2021-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable