autoprefixer-rails 1.0.20140103 → 1.0.20140109

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: 2a8833d0f241629e780252b29bc82d6409246a8b
4
- data.tar.gz: 32dc8334fcf37911bd9b168da413df6e4def789a
3
+ metadata.gz: 09c31b13c6b302a9fc5decd9853ecc63f33922d6
4
+ data.tar.gz: 4e82ad60883b66d7a9fc811015de15d7379105db
5
5
  SHA512:
6
- metadata.gz: 480f24e02eaf261efcdad5226a4b878f0e0aa1fc5d14d1f8168cc3d4517d329b982d0919813e6c18b14192e41dab2d021c68024a00e133e9227857ae830fef0c
7
- data.tar.gz: 36ce3d656e737701c61ddd677997e14e57e93c9a0c8f6ee811d0b6ee8c3199f0ac1318348b0b03b060c379957c003076a0518219c27e021ce179a635db5544b4
6
+ metadata.gz: eada118ab84de3ad2e0172616149502b1331640eeee8e1af0a674c40251e1f7f72b1a5ad8e815a4897601dfb9497058bbcfa2067ac8c5f50328c042c41770091
7
+ data.tar.gz: 03b82d3dc12f98b3fa6647d83b43faaf810e38f39aa51aae245fc55fd3d8a047b9f0ff10b7def99ec03211049a20f05b28837859d9dbbc6011340febf41e9eaf
data/ChangeLog.md CHANGED
@@ -26,6 +26,11 @@
26
26
  * Add webkit prefix for sticky position.
27
27
  * Update browsers popularity statistics.
28
28
 
29
+ ### 20140109:
30
+
31
+ * Add selectors and at-rules sections to debug info.
32
+ * Fix outdated prefixes cleaning.
33
+
29
34
  ## 0.8 “Unbowed, Unbent, Unbroken”
30
35
  * Add more browsers to defaults ("> 1%, last 2 versions, ff 17, opera 12.1"
31
36
  instead of just "last 2 browsers").
@@ -1,3 +1,3 @@
1
1
  module AutoprefixerRails
2
- VERSION = '1.0.20140103'.freeze unless defined? AutoprefixerRails::VERSION
2
+ VERSION = '1.0.20140109'.freeze unless defined? AutoprefixerRails::VERSION
3
3
  end
@@ -9,8 +9,5 @@ end
9
9
 
10
10
  module App
11
11
  class Application < Rails::Application
12
- config.encoding = "utf-8"
13
- config.assets.enabled = true
14
- config.assets.version = '1.0'
15
12
  end
16
13
  end
@@ -1,3 +1,2 @@
1
- require 'rubygems'
2
1
  ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
2
  require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
data/spec/spec_helper.rb CHANGED
@@ -1,9 +1,5 @@
1
- # encoding: utf-8
2
1
  ENV['RAILS_ENV'] ||= 'test'
3
2
 
4
- require 'pp'
5
- require 'sprockets'
6
-
7
3
  require_relative 'app/config/environment'
8
4
  require_relative '../lib/autoprefixer-rails'
9
5
 
@@ -434,8 +434,8 @@
434
434
  };
435
435
 
436
436
  Autoprefixer.prototype.postcss = function(css) {
437
- this.prefixes.processor.add(css);
438
- return this.prefixes.processor.remove(css);
437
+ this.prefixes.processor.remove(css);
438
+ return this.prefixes.processor.add(css);
439
439
  };
440
440
 
441
441
  Autoprefixer.prototype.info = function() {
@@ -1996,7 +1996,7 @@
1996
1996
  };
1997
1997
 
1998
1998
  module.exports = function(prefixes) {
1999
- var browser, data, list, name, needTransition, out, props, string, transitionProp, useTransition, value, values, version, versions, _i, _j, _len, _len1, _ref, _ref1, _ref2, _ref3, _ref4;
1999
+ var atrules, browser, data, list, name, needTransition, out, props, selector, selectors, string, transitionProp, useTransition, value, values, version, versions, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6;
2000
2000
  if (prefixes.browsers.selected.length === 0) {
2001
2001
  return "No browsers selected";
2002
2002
  }
@@ -2020,14 +2020,36 @@
2020
2020
  });
2021
2021
  out += ' ' + browser + ': ' + list.join(', ') + "\n";
2022
2022
  }
2023
+ atrules = '';
2024
+ _ref2 = prefixes.add;
2025
+ for (name in _ref2) {
2026
+ data = _ref2[name];
2027
+ if (name[0] === '@' && data.prefixes) {
2028
+ atrules += prefix(name, false, data.prefixes);
2029
+ }
2030
+ }
2031
+ if (atrules !== '') {
2032
+ out += "\nAt-Rules:\n" + atrules;
2033
+ }
2034
+ selectors = '';
2035
+ _ref3 = prefixes.add.selectors;
2036
+ for (_j = 0, _len1 = _ref3.length; _j < _len1; _j++) {
2037
+ selector = _ref3[_j];
2038
+ if (selector.prefixes) {
2039
+ selectors += prefix(selector.name, false, selector.prefixes);
2040
+ }
2041
+ }
2042
+ if (selectors !== '') {
2043
+ out += "\nSelectors:\n" + selectors;
2044
+ }
2023
2045
  values = '';
2024
2046
  props = '';
2025
2047
  useTransition = false;
2026
- needTransition = (_ref2 = prefixes.add.transition) != null ? _ref2.prefixes : void 0;
2027
- _ref3 = prefixes.add;
2028
- for (name in _ref3) {
2029
- data = _ref3[name];
2030
- if (data.prefixes) {
2048
+ needTransition = (_ref4 = prefixes.add.transition) != null ? _ref4.prefixes : void 0;
2049
+ _ref5 = prefixes.add;
2050
+ for (name in _ref5) {
2051
+ data = _ref5[name];
2052
+ if (name[0] !== '@' && data.prefixes) {
2031
2053
  transitionProp = needTransition && prefixes.data[name].transition;
2032
2054
  if (transitionProp) {
2033
2055
  useTransition = true;
@@ -2042,9 +2064,9 @@
2042
2064
  })) {
2043
2065
  continue;
2044
2066
  }
2045
- _ref4 = data.values;
2046
- for (_j = 0, _len1 = _ref4.length; _j < _len1; _j++) {
2047
- value = _ref4[_j];
2067
+ _ref6 = data.values;
2068
+ for (_k = 0, _len2 = _ref6.length; _k < _len2; _k++) {
2069
+ value = _ref6[_k];
2048
2070
  string = prefix(value.name, false, value.prefixes);
2049
2071
  if (values.indexOf(string) === -1) {
2050
2072
  values += string;
@@ -2411,7 +2433,7 @@
2411
2433
  selector = Selector.load(name, prefixes);
2412
2434
  for (_j = 0, _len1 = prefixes.length; _j < _len1; _j++) {
2413
2435
  prefix = prefixes[_j];
2414
- remove.selectors.push(selector.prefixed(prefix));
2436
+ remove.selectors.push(selector.checker(prefix));
2415
2437
  }
2416
2438
  } else if (name[0] === '@') {
2417
2439
  for (_k = 0, _len2 = prefixes.length; _k < _len2; _k++) {
@@ -2583,7 +2605,7 @@
2583
2605
  };
2584
2606
 
2585
2607
  Processor.prototype.remove = function(css) {
2586
- var selector, _i, _len, _ref,
2608
+ var checker, _i, _len, _ref,
2587
2609
  _this = this;
2588
2610
  css.eachAtRule(function(rule, i) {
2589
2611
  if (_this.prefixes.remove['@' + rule.name]) {
@@ -2592,15 +2614,15 @@
2592
2614
  });
2593
2615
  _ref = this.prefixes.remove.selectors;
2594
2616
  for (_i = 0, _len = _ref.length; _i < _len; _i++) {
2595
- selector = _ref[_i];
2617
+ checker = _ref[_i];
2596
2618
  css.eachRule(function(rule, i) {
2597
- if (rule.selector.indexOf(selector) !== -1) {
2619
+ if (checker(rule)) {
2598
2620
  return rule.parent.remove(i);
2599
2621
  }
2600
2622
  });
2601
2623
  }
2602
2624
  return css.eachDecl(function(decl, i) {
2603
- var checker, notHack, rule, unprefixed, _j, _len1, _ref1, _ref2;
2625
+ var notHack, rule, unprefixed, _j, _len1, _ref1, _ref2;
2604
2626
  rule = decl.parent;
2605
2627
  unprefixed = _this.prefixes.unprefixed(decl.prop);
2606
2628
  if ((_ref1 = _this.prefixes.remove[decl.prop]) != null ? _ref1.remove : void 0) {
@@ -2633,7 +2655,7 @@
2633
2655
 
2634
2656
  },{"./utils":35,"./value":36,"postcss/lib/vendor":52}],34:[function(require,module,exports){
2635
2657
  (function() {
2636
- var Prefixer, Selector, utils, _ref,
2658
+ var Prefixer, Selector, utils,
2637
2659
  __hasProp = {}.hasOwnProperty,
2638
2660
  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
2639
2661
 
@@ -2644,25 +2666,45 @@
2644
2666
  Selector = (function(_super) {
2645
2667
  __extends(Selector, _super);
2646
2668
 
2647
- function Selector() {
2648
- _ref = Selector.__super__.constructor.apply(this, arguments);
2649
- return _ref;
2669
+ function Selector(name, prefixes, all) {
2670
+ this.name = name;
2671
+ this.prefixes = prefixes;
2672
+ this.all = all;
2673
+ this.regexpCache = {};
2650
2674
  }
2651
2675
 
2652
- Selector.prototype.check = function(rule) {
2653
- return rule.selector.indexOf(this.name) !== -1;
2676
+ Selector.prototype.check = function(rule, prefix) {
2677
+ var name;
2678
+ name = prefix ? this.prefixed(prefix) : this.name;
2679
+ if (rule.selector.indexOf(name) !== -1) {
2680
+ return !!rule.selector.match(this.regexp(prefix));
2681
+ } else {
2682
+ return false;
2683
+ }
2684
+ };
2685
+
2686
+ Selector.prototype.checker = function(prefix) {
2687
+ var _this = this;
2688
+ return function(rule) {
2689
+ return _this.check(rule, prefix);
2690
+ };
2654
2691
  };
2655
2692
 
2656
2693
  Selector.prototype.prefixed = function(prefix) {
2657
2694
  return this.name.replace(/^([^\w]*)/, '$1' + prefix);
2658
2695
  };
2659
2696
 
2660
- Selector.prototype.regexp = function() {
2661
- return this.regexpCache || (this.regexpCache = new RegExp(utils.escapeRegexp(this.name), 'gi'));
2697
+ Selector.prototype.regexp = function(prefix) {
2698
+ var name;
2699
+ if (this.regexpCache[prefix]) {
2700
+ return this.regexpCache[prefix];
2701
+ }
2702
+ name = prefix ? this.prefixed(prefix) : this.name;
2703
+ return this.regexpCache = new RegExp('(^|[^:])' + utils.escapeRegexp(name), 'gi');
2662
2704
  };
2663
2705
 
2664
2706
  Selector.prototype.replace = function(selector, prefix) {
2665
- return selector.replace(this.regexp(), this.prefixed(prefix));
2707
+ return selector.replace(this.regexp(), '$1' + this.prefixed(prefix));
2666
2708
  };
2667
2709
 
2668
2710
  Selector.prototype.add = function(rule, prefix) {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autoprefixer-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.20140103
4
+ version: 1.0.20140109
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Sitnik
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-03 00:00:00.000000000 Z
11
+ date: 2014-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: execjs
@@ -65,7 +65,6 @@ files:
65
65
  - spec/app/config/environments/test.rb
66
66
  - spec/app/config/initializers/secret_token.rb
67
67
  - spec/app/config/routes.rb
68
- - spec/app/vendor/assets/stylesheets/foreign.css
69
68
  - spec/autoprefixer_spec.rb
70
69
  - spec/rails_spec.rb
71
70
  - spec/spec_helper.rb
@@ -1 +0,0 @@
1
- .f { transition: none }