csso-rails 0.3.1 → 0.3.2

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.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- csso-rails (0.3.1)
4
+ csso-rails (0.3.2)
5
5
  execjs (>= 1)
6
6
 
7
7
  GEM
data/Rakefile CHANGED
@@ -37,9 +37,17 @@ end
37
37
  directory 'vendor/csso'
38
38
  lib_template = 'lib/csso/csso.js.erb'
39
39
  file Csso::CSSO_JS_LIB => [lib_template, 'csso', 'vendor/csso', 'csso/.git/HEAD', 'csso/.git/refs/heads/master'] do
40
+ puts "Generating #{Csso::CSSO_JS_LIB}"
40
41
  `erb #{lib_template} > #{Csso::CSSO_JS_LIB}`
41
42
  end
42
43
 
43
44
  task :generate_files => [Csso::CSSO_JS_LIB]
44
45
 
46
+ task :rm_generated do
47
+ puts "Removing #{Csso::CSSO_JS_LIB}"
48
+ `rm #{Csso::CSSO_JS_LIB}`
49
+ end
50
+
51
+ task :regenerate => [:rm_generated, :generate_files]
52
+
45
53
  task :build => :generate_files
data/csso-rails.gemspec CHANGED
@@ -11,6 +11,7 @@ Gem::Specification.new do |s|
11
11
  s.homepage = "https://github.com/Vasfed/csso-rails"
12
12
  s.summary = %q{CSS Stylesheet optimizer/compressor for Rails}
13
13
  s.description = %q{Invoke the CSSO from Ruby}
14
+ s.license = 'MIT'
14
15
 
15
16
  s.rubyforge_project = "csso-rails"
16
17
 
data/lib/csso/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Csso
2
- VERSION = '0.3.1'
2
+ VERSION = '0.3.2'
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.7 revision 115eabd536a6224b08a59a57c64e2fdecb0f1350
5
+ Based on CSSO 1.3.8 revision 7061510a0f2b896cd7899836889b91453c4c6e2a
6
6
  */
7
7
 
8
8
  console = {
@@ -2838,6 +2838,7 @@ CSSOCompressor.prototype.freezeRulesets = function(token, rule, container, i) {
2838
2838
  info.freeze = this.freezeNeeded(selector);
2839
2839
  info.freezeID = this.selectorSignature(selector);
2840
2840
  info.pseudoID = this.composePseudoID(selector);
2841
+ info.pseudoSignature = this.pseudoSelectorSignature(selector, this.allowedPClasses, true);
2841
2842
  this.markSimplePseudo(selector);
2842
2843
 
2843
2844
  return token;
@@ -2892,7 +2893,7 @@ CSSOCompressor.prototype.selectorSignature = function(selector) {
2892
2893
  return a.join(',');
2893
2894
  };
2894
2895
 
2895
- CSSOCompressor.prototype.pseudoSelectorSignature = function(selector, exclude) {
2896
+ CSSOCompressor.prototype.pseudoSelectorSignature = function(selector, exclude, dontAppendExcludeMark) {
2896
2897
  var a = [], b = {}, ss, wasExclude = false;
2897
2898
  exclude = exclude || {};
2898
2899
 
@@ -2914,7 +2915,7 @@ CSSOCompressor.prototype.pseudoSelectorSignature = function(selector, exclude) {
2914
2915
 
2915
2916
  a.sort();
2916
2917
 
2917
- return a.join(',') + wasExclude;
2918
+ return a.join(',') + (dontAppendExcludeMark? '' : wasExclude);
2918
2919
  };
2919
2920
 
2920
2921
  CSSOCompressor.prototype.notFPClasses = {
@@ -3381,7 +3382,6 @@ CSSOCompressor.prototype.restructureBlock = function(token, rule, container, j,
3381
3382
  var x, p, v, imp, t,
3382
3383
  pre = this.pathUp(path) + '/' + selector + '/',
3383
3384
  ppre;
3384
-
3385
3385
  for (var i = token.length - 1; i > -1; i--) {
3386
3386
  x = token[i];
3387
3387
  if (x[1] === 'declaration') {
@@ -3401,7 +3401,7 @@ CSSOCompressor.prototype.restructureBlock = function(token, rule, container, j,
3401
3401
  } else {
3402
3402
  token.splice(i, 1);
3403
3403
  }
3404
- }
3404
+ }
3405
3405
  } else if (this.needless(p, props, pre, imp, v, x, freeze)) {
3406
3406
  token.splice(i, 1);
3407
3407
  } else {
@@ -3561,7 +3561,7 @@ CSSOCompressor.prototype.rejoinRuleset = function(token, rule, container, i) {
3561
3561
 
3562
3562
  if (!tb.length) return null;
3563
3563
 
3564
- if (ps.length && pb.length) {
3564
+ if (ps.length && pb.length && token[0].pseudoSignature == p[0].pseudoSignature) {
3565
3565
  if (token[1] !== p[1]) return;
3566
3566
  // try to join by selectors
3567
3567
  ph = this.getHash(ps);
@@ -3628,7 +3628,7 @@ CSSOCompressor.prototype.restructureRuleset = function(token, rule, container, i
3628
3628
 
3629
3629
  if (!tb.length) return null;
3630
3630
 
3631
- if (ps.length && pb.length) {
3631
+ if (ps.length && pb.length && token[0].pseudoSignature == p[0].pseudoSignature) {
3632
3632
  if (token[1] !== p[1]) return;
3633
3633
  // try to join by properties
3634
3634
  r = this.analyze(token, p);
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: csso-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-08-30 00:00:00.000000000 Z
12
+ date: 2013-09-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: execjs
@@ -85,7 +85,8 @@ files:
85
85
  - spec/csso/csso_spec.rb
86
86
  - vendor/csso/csso.js
87
87
  homepage: https://github.com/Vasfed/csso-rails
88
- licenses: []
88
+ licenses:
89
+ - MIT
89
90
  post_install_message:
90
91
  rdoc_options: []
91
92
  require_paths:
@@ -98,7 +99,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
98
99
  version: '0'
99
100
  segments:
100
101
  - 0
101
- hash: 2484248260249532687
102
+ hash: -4417280419298130483
102
103
  required_rubygems_version: !ruby/object:Gem::Requirement
103
104
  none: false
104
105
  requirements:
@@ -107,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
107
108
  version: '0'
108
109
  segments:
109
110
  - 0
110
- hash: 2484248260249532687
111
+ hash: -4417280419298130483
111
112
  requirements: []
112
113
  rubyforge_project: csso-rails
113
114
  rubygems_version: 1.8.24