autoprefixer-rails 1.1.20140226 → 1.1.20140302

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: a55c3e71029f2516953059b570d9259c5733202b
4
- data.tar.gz: 17e4a099f1514edad5869d28bdc94272c967f439
3
+ metadata.gz: ab86a9111b4e97aeeace72c81248d347d10d8fc4
4
+ data.tar.gz: c08519e59f7593286bdc0f4811063dee71e4f60e
5
5
  SHA512:
6
- metadata.gz: 7389999c08d8b53c26ed803ef8ca225e8f517d00a1800ee39d2828d0939987e2f8790da4b1017fceea083ae7e91c11526acec2077e5d5de1d6d896659821f1b7
7
- data.tar.gz: 304d6133360cd28dc783cd33040634a5f597bff0347f6a9cfdaefbfd75095f74180bfbf96b3072275e9770cb92c012363e5328c13f178db552eb0a78c841a518
6
+ metadata.gz: b3222ffac62ab22af9a5635d0cb7ddfabd579cdd0a482dc52dfd2f169ccebb4724d25f10964bbc934e43e98c03cb2dc7e331bacfd5a279fa14627c4adac67f30
7
+ data.tar.gz: f607cc1ea86a720e6dac1f034fab13d618a4ab9dd7e5ee889400ad87b8fb05f3762d03e2b004431cb4ca08c8015c89e35413863b9382f2b54e2056fe8bdc7dee
@@ -17,6 +17,12 @@
17
17
  * Chrome 33 is moved to released versions.
18
18
  * Add Chrome 36 data.
19
19
 
20
+ ### 20140302:
21
+ * Add `text-decoration-*` properties support.
22
+ * Update browsers usage statistics.
23
+ * Fix `cascade` options without `browsers` option (by Dominik Porada).
24
+ * Use new PostCSS version.
25
+
20
26
  ## 1.0 “Plus ultra”
21
27
  * Source map support.
22
28
  * Save origin indents and code formatting.
@@ -16,7 +16,7 @@ module AutoprefixerRails
16
16
  # * `from` with input CSS file name. Will be used in error messages.
17
17
  # * `to` with output CSS file name.
18
18
  # * `map` with true to generate new source map or with previous map.
19
- def process(css, opts = { })
19
+ def process(css, opts = {})
20
20
  result = processor.call('process', css, opts)
21
21
  Result.new(result['css'], result['map'])
22
22
  end
@@ -51,11 +51,12 @@ module AutoprefixerRails
51
51
 
52
52
  # Return JS code to create Autoprefixer instance
53
53
  def create_instance
54
+ options = @options.map { |k, v| "#{k}: #{v.inspect}"}.join(', ')
55
+
54
56
  if @browsers.empty?
55
- "var processor = autoprefixer;"
57
+ "var processor = autoprefixer({ #{options} });"
56
58
  else
57
59
  browsers = @browsers.map(&:to_s).join("', '")
58
- options = @options.map { |k, v| "#{k}: #{v.inspect}"}.join(',')
59
60
  "var processor = autoprefixer('#{browsers}', { #{options} });"
60
61
  end
61
62
  end
@@ -1,3 +1,3 @@
1
1
  module AutoprefixerRails
2
- VERSION = '1.1.20140226'.freeze unless defined? AutoprefixerRails::VERSION
2
+ VERSION = '1.1.20140302'.freeze unless defined? AutoprefixerRails::VERSION
3
3
  end
@@ -23,7 +23,16 @@ describe AutoprefixerRails do
23
23
  result.map.should be_a(String)
24
24
  end
25
25
 
26
- it "disable visual cascade on request" do
26
+ it "creates visual cascade by default" do
27
+ css = "a {\n transition: all 1s\n }"
28
+ result = AutoprefixerRails.process(@css)
29
+ result.css.should == "a {\n" +
30
+ " -webkit-transition: all 1s;\n" +
31
+ " transition: all 1s\n" +
32
+ "}\n"
33
+ end
34
+
35
+ it "disables visual cascade on request" do
27
36
  css = "a {\n transition: all 1s\n }"
28
37
  result = AutoprefixerRails.process(@css, cascade: false)
29
38
  result.css.should == "a {\n" +
@@ -5,46 +5,46 @@
5
5
  prefix: "-webkit-",
6
6
  minor: true,
7
7
  versions: [4.4, 4.3, 4.2, 4.1, 4, 3, 2.3, 2.2, 2.1],
8
- popularity: [0.0894926, 0.74151, 0.74151, 2.29485, 1.0803, 0.00639233, 1.35517, 0.0831003, 0.0255693]
8
+ popularity: [0.116989, 0.818925, 0.818925, 2.30729, 1.0464, 0.00649939, 1.29988, 0.0844921, 0.0259976]
9
9
  },
10
10
  bb: {
11
11
  prefix: "-webkit-",
12
12
  minor: true,
13
13
  versions: [10, 7],
14
- popularity: [0, 0.153316]
14
+ popularity: [0, 0.136974]
15
15
  },
16
16
  chrome: {
17
17
  prefix: "-webkit-",
18
18
  future: [36, 35, 34],
19
19
  versions: [33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4],
20
- popularity: [0.22869, 15.5204, 15.3756, 0.411642, 0.480249, 0.274428, 0.312543, 0.221067, 0.121968, 0.068607, 0.083853, 0.121968, 0.480249, 0.045738, 0.038115, 0.099099, 0.030492, 0.038115, 0.068607, 0.045738, 0.053361, 0.060984, 0.121968, 0.038115, 0.015246, 0.022869, 0.022869, 0.030492, 0.022869, 0.022869]
20
+ popularity: [2.44037, 27.2658, 1.60432, 0.33894, 0.459452, 0.256088, 0.30128, 0.22596, 0.120512, 0.067788, 0.082852, 0.097916, 0.60256, 0.045192, 0.03766, 0.07532, 0.030128, 0.03766, 0.060256, 0.045192, 0.052724, 0.060256, 0.120512, 0.03766, 0.015064, 0.022596, 0.022596, 0.030128, 0.022596, 0.022596]
21
21
  },
22
22
  ff: {
23
23
  prefix: "-moz-",
24
24
  future: [30, 29, 28],
25
25
  versions: [27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3.6, 3.5, 3, 2],
26
- popularity: [0.472626, 11.9757, 0.411642, 0.266805, 0.15246, 0.137214, 0.15246, 0.114345, 0.106722, 0.099099, 0.137214, 0.160083, 0.099099, 0.07623, 0.083853, 0.175329, 0.07623, 0.106722, 0.045738, 0.068607, 0.030492, 0.045738, 0.038115, 0.060984, 0.251559, 0.038115, 0.091476, 0.015246]
26
+ popularity: [6.04066, 6.51518, 0.241024, 0.256088, 0.135576, 0.128044, 0.143108, 0.11298, 0.097916, 0.090384, 0.128044, 0.173236, 0.105448, 0.07532, 0.07532, 0.180768, 0.07532, 0.090384, 0.045192, 0.067788, 0.030128, 0.045192, 0.03766, 0.052724, 0.233492, 0.03766, 0.07532, 0.015064]
27
27
  },
28
28
  ie: {
29
29
  prefix: "-ms-",
30
30
  versions: [11, 10, 9, 8, 7, 6, 5.5],
31
- popularity: [6.40778, 3.74183, 3.18016, 5.65625, 0.213593, 0.28479, 0.009298]
31
+ popularity: [6.68983, 3.50751, 2.98874, 5.19546, 0.185829, 0.240029, 0.009298]
32
32
  },
33
33
  ios: {
34
34
  prefix: "-webkit-",
35
35
  versions: [7, 6.1, 6, 5.1, 5, 4.3, 4.2, 4.1, 4, 3.2],
36
- popularity: [4.18754, 0.4515445, 0.4515445, 0.1317005, 0.1317005, 0.01075105, 0.01075105, 0.00537555, 0.00537555, 0]
36
+ popularity: [4.20662, 0.468007, 0.468007, 0.1333275, 0.1333275, 0.0108839, 0.0108839, 0.00544195, 0.00544195, 0]
37
37
  },
38
38
  opera: {
39
39
  prefix: "-o-",
40
40
  future: [21, 20],
41
41
  versions: [19, 18, 17, 16, 15, 12.1, 12, 11.6, 11.5, 11.1, 11, 10.6, 10.5, 10.1, 10, 9.6, 9.5],
42
- popularity: [0.038115, 0.358281, 0.030492, 0.022869, 0.015246, 0.419265, 0.038115, 0.030492, 0.015246, 0.008219, 0.008219, 0.007623, 0.008392, 0.007623, 0.007623, 0.0038115, 0.0038115]
42
+ popularity: [0.361536, 0.082852, 0.022596, 0.015064, 0.015064, 0.391664, 0.030128, 0.022596, 0.007532, 0.008219, 0.008219, 0.007532, 0.008392, 0.007532, 0.007532, 0.0038115, 0.0038115]
43
43
  },
44
44
  safari: {
45
45
  prefix: "-webkit-",
46
46
  versions: [7, 6.1, 6, 5.1, 5, 4, 3.2, 3.1],
47
- popularity: [1.11296, 0.815661, 0.602217, 0.930006, 0.274428, 0.114345, 0.008692, 0]
47
+ popularity: [1.26538, 0.760732, 0.497112, 0.881244, 0.256088, 0.090384, 0.008692, 0]
48
48
  }
49
49
  };
50
50
 
@@ -317,6 +317,15 @@
317
317
  "tab-size": {
318
318
  browsers: ["ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ff 16", "ff 17", "ff 18", "ff 19", "ff 20", "ff 21", "ff 22", "ff 23", "ff 24", "ff 25", "ff 26", "ff 27", "ff 28", "ff 29", "ff 30", "opera 10.6", "opera 11", "opera 11.1", "opera 11.5", "opera 11.6", "opera 12", "opera 12.1"]
319
319
  },
320
+ "text-decoration-color": {
321
+ browsers: ["ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ff 16", "ff 17", "ff 18", "ff 19", "ff 20", "ff 21", "ff 22", "ff 23", "ff 24", "ff 25", "ff 26", "ff 27", "ff 28", "ff 29", "ff 30"]
322
+ },
323
+ "text-decoration-line": {
324
+ browsers: ["ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ff 16", "ff 17", "ff 18", "ff 19", "ff 20", "ff 21", "ff 22", "ff 23", "ff 24", "ff 25", "ff 26", "ff 27", "ff 28", "ff 29", "ff 30"]
325
+ },
326
+ "text-decoration-style": {
327
+ browsers: ["chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "chrome 29", "chrome 30", "chrome 31", "chrome 32", "chrome 33", "chrome 34", "chrome 35", "chrome 36", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ff 16", "ff 17", "ff 18", "ff 19", "ff 20", "ff 21", "ff 22", "ff 23", "ff 24", "ff 25", "ff 26", "ff 27", "ff 28", "ff 29", "ff 30", "opera 15", "opera 16", "opera 17", "opera 18", "opera 19", "opera 20", "opera 21"]
328
+ },
320
329
  "touch-action": {
321
330
  browsers: ["ie 10"]
322
331
  },
@@ -354,6 +363,10 @@
354
363
  "user-select": {
355
364
  browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "android 4.3", "android 4.4", "bb 7", "bb 10", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "chrome 29", "chrome 30", "chrome 31", "chrome 32", "chrome 33", "chrome 34", "chrome 35", "chrome 36", "ff 2", "ff 3", "ff 3.5", "ff 3.6", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ff 16", "ff 17", "ff 18", "ff 19", "ff 20", "ff 21", "ff 22", "ff 23", "ff 24", "ff 25", "ff 26", "ff 27", "ff 28", "ff 29", "ff 30", "ie 10", "ie 11", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 15", "opera 16", "opera 17", "opera 18", "opera 19", "opera 20", "opera 21", "safari 3.1", "safari 3.2", "safari 4", "safari 5", "safari 5.1", "safari 6", "safari 6.1", "safari 7"]
356
365
  },
366
+ wavy: {
367
+ props: ["text-decoration", "text-decoration-style"],
368
+ browsers: ["ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ff 16", "ff 17", "ff 18", "ff 19", "ff 20", "ff 21", "ff 22", "ff 23", "ff 24", "ff 25", "ff 26", "ff 27", "ff 28", "ff 29", "ff 30"]
369
+ },
357
370
  "zoom-in": {
358
371
  props: ["cursor"],
359
372
  browsers: ["chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "chrome 29", "chrome 30", "chrome 31", "chrome 32", "chrome 33", "chrome 34", "chrome 35", "chrome 36", "ff 2", "ff 3", "ff 3.5", "ff 3.6", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ff 16", "ff 17", "ff 18", "ff 19", "ff 20", "ff 21", "ff 22", "ff 23", "opera 15", "opera 16", "opera 17", "opera 18", "opera 19", "opera 20", "opera 21", "safari 3.1", "safari 3.2", "safari 4", "safari 5", "safari 5.1", "safari 6", "safari 6.1", "safari 7"]
@@ -4188,23 +4201,13 @@ var substr = 'ab'.substr(-1) === 'b'
4188
4201
  };
4189
4202
 
4190
4203
  MapGenerator.prototype.applyPrevMap = function() {
4191
- var from, prev, source;
4204
+ var from, prev;
4192
4205
  if (this.prevMap()) {
4193
4206
  prev = this.prevMap();
4194
4207
  prev = typeof prev === 'string' ? JSON.parse(prev) : prev instanceof mozilla.SourceMapConsumer ? mozilla.SourceMapGenerator.fromSourceMap(prev).toJSON() : typeof prev === 'object' && prev.toJSON ? prev.toJSON() : prev;
4195
- from = path.dirname(this.opts.from);
4196
- prev.sources = (function() {
4197
- var _i, _len, _ref, _results;
4198
- _ref = prev.sources;
4199
- _results = [];
4200
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
4201
- source = _ref[_i];
4202
- _results.push(this.relative(path.resolve(from, source)));
4203
- }
4204
- return _results;
4205
- }).call(this);
4206
4208
  prev = new mozilla.SourceMapConsumer(prev);
4207
- return this.map.applySourceMap(prev, this.relative(this.opts.from));
4209
+ from = this.relative(this.opts.from);
4210
+ return this.map.applySourceMap(prev, from, path.dirname(from));
4208
4211
  }
4209
4212
  };
4210
4213
 
@@ -5870,7 +5873,7 @@ define(function (_dereq_, exports, module) {
5870
5873
  * - sourceRoot: Optional. The URL root from which all sources are relative.
5871
5874
  * - sourcesContent: Optional. An array of contents of the original source files.
5872
5875
  * - mappings: A string of base64 VLQs which contain the actual mappings.
5873
- * - file: The generated file this source map is associated with.
5876
+ * - file: Optional. The generated file this source map is associated with.
5874
5877
  *
5875
5878
  * Here is an example source map, taken from the source map spec[0]:
5876
5879
  *
@@ -6154,7 +6157,7 @@ define(function (_dereq_, exports, module) {
6154
6157
  "generatedColumn",
6155
6158
  util.compareByGeneratedPositions);
6156
6159
 
6157
- if (mapping) {
6160
+ if (mapping && mapping.generatedLine === needle.generatedLine) {
6158
6161
  var source = util.getArg(mapping, 'source', null);
6159
6162
  if (source && this.sourceRoot) {
6160
6163
  source = util.join(this.sourceRoot, source);
@@ -6336,14 +6339,17 @@ define(function (_dereq_, exports, module) {
6336
6339
 
6337
6340
  /**
6338
6341
  * An instance of the SourceMapGenerator represents a source map which is
6339
- * being built incrementally. To create a new one, you must pass an object
6340
- * with the following properties:
6342
+ * being built incrementally. You may pass an object with the following
6343
+ * properties:
6341
6344
  *
6342
6345
  * - file: The filename of the generated source.
6343
- * - sourceRoot: An optional root for all URLs in this source map.
6346
+ * - sourceRoot: A root for all relative URLs in this source map.
6344
6347
  */
6345
6348
  function SourceMapGenerator(aArgs) {
6346
- this._file = util.getArg(aArgs, 'file');
6349
+ if (!aArgs) {
6350
+ aArgs = {};
6351
+ }
6352
+ this._file = util.getArg(aArgs, 'file', null);
6347
6353
  this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);
6348
6354
  this._sources = new ArraySet();
6349
6355
  this._names = new ArraySet();
@@ -6473,11 +6479,23 @@ define(function (_dereq_, exports, module) {
6473
6479
  * @param aSourceMapConsumer The source map to be applied.
6474
6480
  * @param aSourceFile Optional. The filename of the source file.
6475
6481
  * If omitted, SourceMapConsumer's file property will be used.
6482
+ * @param aSourceMapPath Optional. The dirname of the path to the source map
6483
+ * to be applied. If relative, it is relative to the SourceMapConsumer.
6484
+ * This parameter is needed when the two source maps aren't in the same
6485
+ * directory, and the source map to be applied contains relative source
6486
+ * paths. If so, those relative source paths need to be rewritten
6487
+ * relative to the SourceMapGenerator.
6476
6488
  */
6477
6489
  SourceMapGenerator.prototype.applySourceMap =
6478
- function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile) {
6490
+ function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
6479
6491
  // If aSourceFile is omitted, we will use the file property of the SourceMap
6480
6492
  if (!aSourceFile) {
6493
+ if (!aSourceMapConsumer.file) {
6494
+ throw new Error(
6495
+ 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +
6496
+ 'or the source map\'s "file" property. Both were omitted.'
6497
+ );
6498
+ }
6481
6499
  aSourceFile = aSourceMapConsumer.file;
6482
6500
  }
6483
6501
  var sourceRoot = this._sourceRoot;
@@ -6500,10 +6518,12 @@ define(function (_dereq_, exports, module) {
6500
6518
  });
6501
6519
  if (original.source !== null) {
6502
6520
  // Copy mapping
6521
+ mapping.source = original.source;
6522
+ if (aSourceMapPath) {
6523
+ mapping.source = util.join(aSourceMapPath, mapping.source)
6524
+ }
6503
6525
  if (sourceRoot) {
6504
- mapping.source = util.relative(sourceRoot, original.source);
6505
- } else {
6506
- mapping.source = original.source;
6526
+ mapping.source = util.relative(sourceRoot, mapping.source);
6507
6527
  }
6508
6528
  mapping.originalLine = original.line;
6509
6529
  mapping.originalColumn = original.column;
@@ -6762,41 +6782,16 @@ define(function (_dereq_, exports, module) {
6762
6782
  var lastMapping = null;
6763
6783
 
6764
6784
  aSourceMapConsumer.eachMapping(function (mapping) {
6765
- if (lastMapping === null) {
6766
- // We add the generated code until the first mapping
6767
- // to the SourceNode without any mapping.
6768
- // Each line is added as separate string.
6769
- while (lastGeneratedLine < mapping.generatedLine) {
6770
- node.add(remainingLines.shift() + "\n");
6771
- lastGeneratedLine++;
6772
- }
6773
- if (lastGeneratedColumn < mapping.generatedColumn) {
6774
- var nextLine = remainingLines[0];
6775
- node.add(nextLine.substr(0, mapping.generatedColumn));
6776
- remainingLines[0] = nextLine.substr(mapping.generatedColumn);
6777
- lastGeneratedColumn = mapping.generatedColumn;
6778
- }
6779
- } else {
6785
+ if (lastMapping !== null) {
6780
6786
  // We add the code from "lastMapping" to "mapping":
6781
6787
  // First check if there is a new line in between.
6782
6788
  if (lastGeneratedLine < mapping.generatedLine) {
6783
6789
  var code = "";
6784
- // Associate full lines with "lastMapping"
6785
- do {
6786
- code += remainingLines.shift() + "\n";
6787
- lastGeneratedLine++;
6788
- lastGeneratedColumn = 0;
6789
- } while (lastGeneratedLine < mapping.generatedLine);
6790
- // When we reached the correct line, we add code until we
6791
- // reach the correct column too.
6792
- if (lastGeneratedColumn < mapping.generatedColumn) {
6793
- var nextLine = remainingLines[0];
6794
- code += nextLine.substr(0, mapping.generatedColumn);
6795
- remainingLines[0] = nextLine.substr(mapping.generatedColumn);
6796
- lastGeneratedColumn = mapping.generatedColumn;
6797
- }
6798
- // Create the SourceNode.
6799
- addMappingWithCode(lastMapping, code);
6790
+ // Associate first line with "lastMapping"
6791
+ addMappingWithCode(lastMapping, remainingLines.shift() + "\n");
6792
+ lastGeneratedLine++;
6793
+ lastGeneratedColumn = 0;
6794
+ // The remaining code is added without mapping
6800
6795
  } else {
6801
6796
  // There is no new line in between.
6802
6797
  // Associate the code between "lastGeneratedColumn" and
@@ -6808,14 +6803,37 @@ define(function (_dereq_, exports, module) {
6808
6803
  lastGeneratedColumn);
6809
6804
  lastGeneratedColumn = mapping.generatedColumn;
6810
6805
  addMappingWithCode(lastMapping, code);
6806
+ // No more remaining code, continue
6807
+ lastMapping = mapping;
6808
+ return;
6811
6809
  }
6812
6810
  }
6811
+ // We add the generated code until the first mapping
6812
+ // to the SourceNode without any mapping.
6813
+ // Each line is added as separate string.
6814
+ while (lastGeneratedLine < mapping.generatedLine) {
6815
+ node.add(remainingLines.shift() + "\n");
6816
+ lastGeneratedLine++;
6817
+ }
6818
+ if (lastGeneratedColumn < mapping.generatedColumn) {
6819
+ var nextLine = remainingLines[0];
6820
+ node.add(nextLine.substr(0, mapping.generatedColumn));
6821
+ remainingLines[0] = nextLine.substr(mapping.generatedColumn);
6822
+ lastGeneratedColumn = mapping.generatedColumn;
6823
+ }
6813
6824
  lastMapping = mapping;
6814
6825
  }, this);
6815
6826
  // We have processed all mappings.
6816
- // Associate the remaining code in the current line with "lastMapping"
6817
- // and add the remaining lines without any mapping
6818
- addMappingWithCode(lastMapping, remainingLines.join("\n"));
6827
+ if (remainingLines.length > 0) {
6828
+ if (lastMapping) {
6829
+ // Associate the remaining code in the current line with "lastMapping"
6830
+ var lastLine = remainingLines.shift();
6831
+ if (remainingLines.length > 0) lastLine += "\n";
6832
+ addMappingWithCode(lastMapping, lastLine);
6833
+ }
6834
+ // and add the remaining lines without any mapping
6835
+ node.add(remainingLines.join("\n"));
6836
+ }
6819
6837
 
6820
6838
  // Copy sourcesContent into SourceNode
6821
6839
  aSourceMapConsumer.sources.forEach(function (sourceFile) {
@@ -7053,10 +7071,28 @@ define(function (_dereq_, exports, module) {
7053
7071
  lastOriginalSource = null;
7054
7072
  sourceMappingActive = false;
7055
7073
  }
7056
- chunk.split('').forEach(function (ch) {
7074
+ chunk.split('').forEach(function (ch, idx, array) {
7057
7075
  if (ch === '\n') {
7058
7076
  generated.line++;
7059
7077
  generated.column = 0;
7078
+ // Mappings end at eol
7079
+ if (idx + 1 === array.length) {
7080
+ lastOriginalSource = null;
7081
+ sourceMappingActive = false;
7082
+ } else if (sourceMappingActive) {
7083
+ map.addMapping({
7084
+ source: original.source,
7085
+ original: {
7086
+ line: original.line,
7087
+ column: original.column
7088
+ },
7089
+ generated: {
7090
+ line: generated.line,
7091
+ column: generated.column
7092
+ },
7093
+ name: original.name
7094
+ });
7095
+ }
7060
7096
  } else {
7061
7097
  generated.column++;
7062
7098
  }
@@ -7106,8 +7142,8 @@ define(function (_dereq_, exports, module) {
7106
7142
  }
7107
7143
  exports.getArg = getArg;
7108
7144
 
7109
- var urlRegexp = /([\w+\-.]+):\/\/((\w+:\w+)@)?([\w.]+)?(:(\d+))?(\S+)?/;
7110
- var dataUrlRegexp = /^data:.+\,.+/;
7145
+ var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/;
7146
+ var dataUrlRegexp = /^data:.+\,.+$/;
7111
7147
 
7112
7148
  function urlParse(aUrl) {
7113
7149
  var match = aUrl.match(urlRegexp);
@@ -7116,18 +7152,22 @@ define(function (_dereq_, exports, module) {
7116
7152
  }
7117
7153
  return {
7118
7154
  scheme: match[1],
7119
- auth: match[3],
7120
- host: match[4],
7121
- port: match[6],
7122
- path: match[7]
7155
+ auth: match[2],
7156
+ host: match[3],
7157
+ port: match[4],
7158
+ path: match[5]
7123
7159
  };
7124
7160
  }
7125
7161
  exports.urlParse = urlParse;
7126
7162
 
7127
7163
  function urlGenerate(aParsedUrl) {
7128
- var url = aParsedUrl.scheme + "://";
7164
+ var url = '';
7165
+ if (aParsedUrl.scheme) {
7166
+ url += aParsedUrl.scheme + ':';
7167
+ }
7168
+ url += '//';
7129
7169
  if (aParsedUrl.auth) {
7130
- url += aParsedUrl.auth + "@"
7170
+ url += aParsedUrl.auth + '@';
7131
7171
  }
7132
7172
  if (aParsedUrl.host) {
7133
7173
  url += aParsedUrl.host;
@@ -7142,19 +7182,112 @@ define(function (_dereq_, exports, module) {
7142
7182
  }
7143
7183
  exports.urlGenerate = urlGenerate;
7144
7184
 
7185
+ /**
7186
+ * Normalizes a path, or the path portion of a URL:
7187
+ *
7188
+ * - Replaces consequtive slashes with one slash.
7189
+ * - Removes unnecessary '.' parts.
7190
+ * - Removes unnecessary '<dir>/..' parts.
7191
+ *
7192
+ * Based on code in the Node.js 'path' core module.
7193
+ *
7194
+ * @param aPath The path or url to normalize.
7195
+ */
7196
+ function normalize(aPath) {
7197
+ var path = aPath;
7198
+ var url = urlParse(aPath);
7199
+ if (url) {
7200
+ if (!url.path) {
7201
+ return aPath;
7202
+ }
7203
+ path = url.path;
7204
+ }
7205
+ var isAbsolute = (path.charAt(0) === '/');
7206
+
7207
+ var parts = path.split(/\/+/);
7208
+ for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
7209
+ part = parts[i];
7210
+ if (part === '.') {
7211
+ parts.splice(i, 1);
7212
+ } else if (part === '..') {
7213
+ up++;
7214
+ } else if (up > 0) {
7215
+ if (part === '') {
7216
+ // The first part is blank if the path is absolute. Trying to go
7217
+ // above the root is a no-op. Therefore we can remove all '..' parts
7218
+ // directly after the root.
7219
+ parts.splice(i + 1, up);
7220
+ up = 0;
7221
+ } else {
7222
+ parts.splice(i, 2);
7223
+ up--;
7224
+ }
7225
+ }
7226
+ }
7227
+ path = parts.join('/');
7228
+
7229
+ if (path === '') {
7230
+ path = isAbsolute ? '/' : '.';
7231
+ }
7232
+
7233
+ if (url) {
7234
+ url.path = path;
7235
+ return urlGenerate(url);
7236
+ }
7237
+ return path;
7238
+ }
7239
+ exports.normalize = normalize;
7240
+
7241
+ /**
7242
+ * Joins two paths/URLs.
7243
+ *
7244
+ * @param aRoot The root path or URL.
7245
+ * @param aPath The path or URL to be joined with the root.
7246
+ *
7247
+ * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a
7248
+ * scheme-relative URL: Then the scheme of aRoot, if any, is prepended
7249
+ * first.
7250
+ * - Otherwise aPath is a path. If aRoot is a URL, then its path portion
7251
+ * is updated with the result and aRoot is returned. Otherwise the result
7252
+ * is returned.
7253
+ * - If aPath is absolute, the result is aPath.
7254
+ * - Otherwise the two paths are joined with a slash.
7255
+ * - Joining for example 'http://' and 'www.example.com' is also supported.
7256
+ */
7145
7257
  function join(aRoot, aPath) {
7146
- var url;
7258
+ var aPathUrl = urlParse(aPath);
7259
+ var aRootUrl = urlParse(aRoot);
7260
+ if (aRootUrl) {
7261
+ aRoot = aRootUrl.path || '/';
7262
+ }
7263
+
7264
+ // `join(foo, '//www.example.org')`
7265
+ if (aPathUrl && !aPathUrl.scheme) {
7266
+ if (aRootUrl) {
7267
+ aPathUrl.scheme = aRootUrl.scheme;
7268
+ }
7269
+ return urlGenerate(aPathUrl);
7270
+ }
7147
7271
 
7148
- if (aPath.match(urlRegexp) || aPath.match(dataUrlRegexp)) {
7272
+ if (aPathUrl || aPath.match(dataUrlRegexp)) {
7149
7273
  return aPath;
7150
7274
  }
7151
7275
 
7152
- if (aPath.charAt(0) === '/' && (url = urlParse(aRoot))) {
7153
- url.path = aPath;
7154
- return urlGenerate(url);
7276
+ // `join('http://', 'www.example.com')`
7277
+ if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
7278
+ aRootUrl.host = aPath;
7279
+ return urlGenerate(aRootUrl);
7155
7280
  }
7156
7281
 
7157
- return aRoot.replace(/\/$/, '') + '/' + aPath;
7282
+ var joined = aPath.charAt(0) === '/'
7283
+ ? aPath
7284
+ : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath);
7285
+
7286
+ if (aRootUrl) {
7287
+ aRootUrl.path = joined;
7288
+ return urlGenerate(aRootUrl);
7289
+ }
7290
+ return joined;
7158
7291
  }
7159
7292
  exports.join = join;
7160
7293
 
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.1.20140226
4
+ version: 1.1.20140302
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-02-26 00:00:00.000000000 Z
11
+ date: 2014-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: execjs