csso-rails 0.3.3 → 0.3.4

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: f348466dbf9fcc505bfac786253c5015f5b75e41
4
- data.tar.gz: e6429cbdbe44a344e4913aee08b545eb8139bbc7
3
+ metadata.gz: 6cb8a4eb6367349f29c00704f908afde8f9d7fda
4
+ data.tar.gz: 4776678150e433ac596ae766e674006067e83b47
5
5
  SHA512:
6
- metadata.gz: fc6c958f36d17d9e59894d9db0a2d987e0c7fd7a645a6edae72261412da36e6eb4f5420dac23fa59864f10ec9aeb3c5e51b6623cab7a03e28c9467cfd1dc31b2
7
- data.tar.gz: 80b063cba7ed2f87b66575c98d33e6920f4756cea73d7aa7391aed09286ddf365f293370d8d013c2cc3f39f5bd7448f922ced6cbb9d9a013f6479cad10c7af09
6
+ metadata.gz: 1d270266a5098ec9771d77053ae1fb7368c607abf68b915b4e4a675291261501f5bcccf99c6f4158714f451fe558635cd0e0cd14725150915fb17253276402d6
7
+ data.tar.gz: 1985e583db9f94894a41654a923fed65958be938ced6b4b8e8d096fbc044c5b33edd55112ee7d1901585f65ab1ad5b129d77c411812064c0cf1e958e73a10015
data/Gemfile.lock CHANGED
@@ -1,15 +1,15 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- csso-rails (0.3.3)
4
+ csso-rails (0.3.4)
5
5
  execjs (>= 1)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- execjs (2.0.1)
11
- minitest (5.0.3)
12
- rake (10.0.4)
10
+ execjs (2.0.2)
11
+ minitest (5.3.1)
12
+ rake (10.1.1)
13
13
 
14
14
  PLATFORMS
15
15
  ruby
data/lib/csso/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Csso
2
- VERSION = '0.3.3'
2
+ VERSION = '0.3.4'
3
3
  CSSO_JS_LIB = 'vendor/csso/csso.js'
4
4
  end
data/vendor/csso/csso.js CHANGED
@@ -2,7 +2,7 @@
2
2
  THIS FILE IS AUTOGENERATED! DO NOT EDIT!
3
3
  See lib/csso/csso.js.erb instead.
4
4
 
5
- Based on CSSO 1.3.10 revision ed443db03803fb9e04918e1c6307053c2a731160
5
+ Based on CSSO 1.3.11 revision b3268f562bd252091c6384a918d54d6759ba7fad
6
6
  */
7
7
 
8
8
  console = {
@@ -3022,7 +3022,7 @@ CSSOCompressor.prototype.cleanWhitespace = function(token, rule, container, i) {
3022
3022
 
3023
3023
  if (nr === 'unknown') token[2] = '\n';
3024
3024
  else {
3025
- if (!(container[1] === 'atrulerq' && !pr) && !this.issue16(container, i)) {
3025
+ if (!(container[1] === 'atrulerq' && !pr) && !this.issue16(container, i) && !this.issue165(container, pr, nr)) {
3026
3026
  if (nr !== null && pr !== null) {
3027
3027
  if (this._cleanWhitespace(nr, false) || this._cleanWhitespace(pr, true)) return null;
3028
3028
  } else return null;
@@ -3039,6 +3039,11 @@ CSSOCompressor.prototype.issue16 = function(container, i) {
3039
3039
  return (i !== 2 && i !== container.length - 1 && container[i - 1][1] === 'uri');
3040
3040
  };
3041
3041
 
3042
+ //See https://github.com/css/csso/issues/165
3043
+ CSSOCompressor.prototype.issue165 = function(container, pr, nr) {
3044
+ return container[1] === 'atrulerq' && pr === 'braces' && nr === 'ident';
3045
+ };
3046
+
3042
3047
  CSSOCompressor.prototype._cleanWhitespace = function(r, left) {
3043
3048
  switch(r) {
3044
3049
  case 's':
@@ -3159,11 +3164,26 @@ CSSOCompressor.prototype.compressFunctionColor = function(token) {
3159
3164
  if (t === 'number') v.push(body[i]);
3160
3165
  else if (t !== 'operator') { v = []; break }
3161
3166
  }
3167
+
3168
+ // check if color is followed by number
3169
+ var parent = token[0].parent;
3170
+ var parentIx = parent.indexOf(token);
3171
+ var appendSpace = parent[parentIx + 1] && parent[parentIx + 1][1] != 's';
3172
+
3162
3173
  if (v.length === 3) {
3163
3174
  h += (t = Number(v[0][2]).toString(16)).length === 1 ? '0' + t : t;
3164
3175
  h += (t = Number(v[1][2]).toString(16)).length === 1 ? '0' + t : t;
3165
3176
  h += (t = Number(v[2][2]).toString(16)).length === 1 ? '0' + t : t;
3166
- if (h.length === 6) return this._compressHashColor(h, {});
3177
+ if (h.length === 6) {
3178
+ var vhash = this._compressHashColor(h, {});
3179
+ if (appendSpace) {
3180
+ // che: I guess this is not right: modify color token with
3181
+ // indentation, but I can't find any better solution right now
3182
+ vhash[2] += ' ';
3183
+ }
3184
+
3185
+ return vhash;
3186
+ }
3167
3187
  }
3168
3188
  }
3169
3189
  };
@@ -3171,9 +3191,9 @@ CSSOCompressor.prototype.compressFunctionColor = function(token) {
3171
3191
  CSSOCompressor.prototype.compressDimension = function(token) {
3172
3192
  var declaration;
3173
3193
  if (token[2][2] === '0') {
3174
- if (token[3][2] === 's' && (declaration = this.findDeclaration(token))) {
3194
+ if ((token[3][2] === 's' || token[3][2] === 'ms') && (declaration = this.findDeclaration(token))) {
3175
3195
  var declName = declaration[2][2][2];
3176
- if (declName === '-moz-transition') return; // https://github.com/css/csso/issues/82
3196
+ if (declName === '-moz-transition' || declName === 'transition') return; // https://github.com/css/csso/issues/82, also support recent Fx versions
3177
3197
  if (declName === '-moz-animation' || declName === 'animation') return; // https://github.com/css/csso/issues/100
3178
3198
  }
3179
3199
  return token[2];
metadata CHANGED
@@ -1,55 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: csso-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vasily Fedoseyev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-27 00:00:00.000000000 Z
11
+ date: 2014-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: execjs
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: minitest
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  description: Invoke the CSSO from Ruby
@@ -60,8 +60,8 @@ executables:
60
60
  extensions: []
61
61
  extra_rdoc_files: []
62
62
  files:
63
- - .gitignore
64
- - .rspec
63
+ - ".gitignore"
64
+ - ".rspec"
65
65
  - Gemfile
66
66
  - Gemfile.lock
67
67
  - README.md
@@ -88,17 +88,17 @@ require_paths:
88
88
  - lib
89
89
  required_ruby_version: !ruby/object:Gem::Requirement
90
90
  requirements:
91
- - - '>='
91
+ - - ">="
92
92
  - !ruby/object:Gem::Version
93
93
  version: '0'
94
94
  required_rubygems_version: !ruby/object:Gem::Requirement
95
95
  requirements:
96
- - - '>='
96
+ - - ">="
97
97
  - !ruby/object:Gem::Version
98
98
  version: '0'
99
99
  requirements: []
100
100
  rubyforge_project: csso-rails
101
- rubygems_version: 2.0.14
101
+ rubygems_version: 2.2.0.rc.1
102
102
  signing_key:
103
103
  specification_version: 4
104
104
  summary: CSS Stylesheet optimizer/compressor for Rails