autoprefixer-rails 0.6.20130721 → 0.6.20130728

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -9,6 +9,11 @@
9
9
  20130721:
10
10
  * Add Chrome 30 data.
11
11
 
12
+ 20130728:
13
+ * Don’t remove non-standard -webkit-background-clip: text.
14
+ * Don’t remove IE hack on CSS parse.
15
+ * Fix loading into Rails without Sprockets.
16
+
12
17
  == 0.5 (Ours is the Fury)
13
18
  * Rewrite Autoprefixer to be more flexible.
14
19
  * Use css, instead of Rework, to fix CSS parsing errors faster.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- autoprefixer-rails (0.6.20130721)
4
+ autoprefixer-rails (0.6.20130728)
5
5
  execjs
6
6
 
7
7
  GEM
@@ -66,7 +66,7 @@ GEM
66
66
  thor (>= 0.18.1, < 2.0)
67
67
  rake (10.1.0)
68
68
  ref (1.0.5)
69
- rspec-core (2.14.3)
69
+ rspec-core (2.14.4)
70
70
  rspec-expectations (2.14.0)
71
71
  diff-lcs (>= 1.1.3, < 2.0)
72
72
  rspec-mocks (2.14.1)
@@ -90,7 +90,7 @@ GEM
90
90
  libv8 (~> 3.11.8.12)
91
91
  ref
92
92
  thor (0.18.1)
93
- thread_safe (0.1.0)
93
+ thread_safe (0.1.2)
94
94
  atomic
95
95
  tilt (1.4.1)
96
96
  treetop (1.4.14)
data/README.md CHANGED
@@ -79,5 +79,5 @@ If you need to call Autoprefixer from plain Ruby code, it’s very easy:
79
79
 
80
80
  ```ruby
81
81
  require "autoprefixer-rails"
82
- prefxied = AutoprefixerRails.compile(css)
82
+ prefixed = AutoprefixerRails.compile(css)
83
83
  ```
@@ -21,7 +21,7 @@ require 'execjs'
21
21
  module AutoprefixerRails
22
22
  # Ruby to JS wrapper for Autoprefixer compiler instance
23
23
  class Compiler
24
- def initialize(browsers)
24
+ def initialize(browsers=nil)
25
25
  @browsers = browsers || []
26
26
  end
27
27
 
@@ -16,24 +16,27 @@ You should have received a copy of the GNU Lesser General Public License
16
16
  along with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
  =end
18
18
 
19
- require 'sprockets/railtie'
19
+ begin
20
+ require 'sprockets/railtie'
20
21
 
21
- module AutoprefixedRails
22
- class Railtie < ::Rails::Railtie
23
- rake_tasks do |app|
24
- require 'rake/autoprefixer_tasks'
25
- Rake::AutoprefixerTasks.new(browsers(app))
26
- end
22
+ module AutoprefixedRails
23
+ class Railtie < ::Rails::Railtie
24
+ rake_tasks do |app|
25
+ require 'rake/autoprefixer_tasks'
26
+ Rake::AutoprefixerTasks.new(browsers(app))
27
+ end
27
28
 
28
- initializer :setup_autoprefixer do |app|
29
- AutoprefixerRails.install(app.assets, browsers(app))
30
- end
29
+ initializer :setup_autoprefixer do |app|
30
+ AutoprefixerRails.install(app.assets, browsers(app))
31
+ end
31
32
 
32
- # Read browsers requirements from application config
33
- def browsers(app)
34
- file = app.root.join('config/autoprefixer.yml')
35
- config = file.exist? ? YAML.load_file(file) : { 'browsers' => nil }
36
- config['browsers']
33
+ # Read browsers requirements from application config
34
+ def browsers(app)
35
+ file = app.root.join('config/autoprefixer.yml')
36
+ config = file.exist? ? YAML.load_file(file) : { 'browsers' => nil }
37
+ config['browsers']
38
+ end
37
39
  end
38
40
  end
41
+ rescue LoadError
39
42
  end
@@ -1,3 +1,3 @@
1
1
  module AutoprefixerRails
2
- VERSION = '0.6.20130721'.freeze unless defined? AutoprefixerRails::VERSION
2
+ VERSION = '0.6.20130728'.freeze unless defined? AutoprefixerRails::VERSION
3
3
  end
@@ -1,16 +1,16 @@
1
1
  require File.expand_path('../spec_helper', __FILE__)
2
2
 
3
3
  describe AutoprefixerRails do
4
- it "should process CSS" do
4
+ it "process CSS" do
5
5
  css = DIR.join('app/app/assets/stylesheets/test.css').read
6
6
  AutoprefixerRails.compile(css).should be_a(String)
7
7
  end
8
- it "should process CSS for selected browsers" do
8
+ it "process CSS for selected browsers" do
9
9
  css = DIR.join('app/app/assets/stylesheets/test.css').read
10
10
  AutoprefixerRails.compile(css, ['chrome 25']).should == PREFIXED
11
11
  end
12
12
 
13
- it "should integrate with Sprockets" do
13
+ it "integrates with Sprockets" do
14
14
  assets = Sprockets::Environment.new
15
15
  assets.append_path(DIR.join('app/app/assets/stylesheets'))
16
16
 
@@ -19,7 +19,7 @@ describe AutoprefixerRails do
19
19
  assets['test.css'].to_s.should == PREFIXED
20
20
  end
21
21
 
22
- it "should inspect" do
22
+ it "inspects" do
23
23
  inspect = AutoprefixerRails.compiler(['chrome 25']).inspect
24
24
  inspect.should =~ /Browsers:\n Chrome: 25\n\n/
25
25
  inspect.should =~ / transition: webkit/
@@ -6,7 +6,7 @@ describe CssController, :type => :controller do
6
6
  cache.rmtree if cache.exist?
7
7
  end
8
8
 
9
- it "should integrate with Rails" do
9
+ it "integrates with Rails" do
10
10
  get :test, :file => 'test'
11
11
  response.should be_success
12
12
  response.body.should == PREFIXED
@@ -14,7 +14,7 @@ describe CssController, :type => :controller do
14
14
  end
15
15
 
16
16
  describe 'Rake task' do
17
- it "should inspect" do
17
+ it "inspects" do
18
18
  inspect = `cd spec/app; bundle exec rake autoprefixer:inspect`
19
19
  inspect.should =~ /Browsers:\n Chrome: 25\n\n/
20
20
  inspect.should =~ / transition: webkit/
@@ -378,7 +378,7 @@ module.exports = function(css, options){
378
378
  var pos = position();
379
379
 
380
380
  // prop
381
- var prop = match(/^(\*?[-\w]+)\s*/);
381
+ var prop = match(/^(\*?[//*-\w]+)\s*/);
382
382
  if (!prop) return;
383
383
  prop = prop[0];
384
384
 
@@ -462,13 +462,12 @@ module.exports = function(css, options){
462
462
  var name = m[1];
463
463
 
464
464
  if (!open()) return error("@keyframes missing '{'");
465
- comments();
466
465
 
467
466
  var frame;
468
- var frames = [];
467
+ var frames = comments();
469
468
  while (frame = keyframe()) {
470
469
  frames.push(frame);
471
- comments();
470
+ frames = frames.concat(comments());
472
471
  }
473
472
 
474
473
  if (!close()) return error("@keyframes missing '}'");
@@ -493,9 +492,8 @@ module.exports = function(css, options){
493
492
  var supports = m[1].trim();
494
493
 
495
494
  if (!open()) return error("@supports missing '{'");
496
- comments();
497
495
 
498
- var style = rules();
496
+ var style = comments().concat(rules());
499
497
 
500
498
  if (!close()) return error("@supports missing '}'");
501
499
 
@@ -518,9 +516,8 @@ module.exports = function(css, options){
518
516
  var media = m[1].trim();
519
517
 
520
518
  if (!open()) return error("@media missing '{'");
521
- comments();
522
519
 
523
- var style = rules();
520
+ var style = comments().concat(rules());
524
521
 
525
522
  if (!close()) return error("@media missing '}'");
526
523
 
@@ -541,16 +538,15 @@ module.exports = function(css, options){
541
538
  if (!m) return;
542
539
 
543
540
  var sel = selector() || [];
544
- var decls = [];
545
541
 
546
542
  if (!open()) return error("@page missing '{'");
547
- comments();
543
+ var decls = comments();
548
544
 
549
545
  // declarations
550
546
  var decl;
551
547
  while (decl = declaration()) {
552
548
  decls.push(decl);
553
- comments();
549
+ decls = decls.concat(comments());
554
550
  }
555
551
 
556
552
  if (!close()) return error("@page missing '}'");
@@ -575,9 +571,8 @@ module.exports = function(css, options){
575
571
  var doc = m[2].trim();
576
572
 
577
573
  if (!open()) return error("@document missing '{'");
578
- comments();
579
574
 
580
- var style = rules();
575
+ var style = comments().concat(rules());
581
576
 
582
577
  if (!close()) return error("@document missing '}'");
583
578
 
@@ -1422,7 +1417,7 @@ require.register("autoprefixer/lib/autoprefixer.js", function(exports, require,
1422
1417
  };
1423
1418
 
1424
1419
  Autoprefixer.prototype.removeBadComments = function(css) {
1425
- return css.replace(/\/\*[^\*]*\*\/\s*:/g, ':').replace(/\/\*[^\*]*\{[^\*]*\*\//g, '');
1420
+ return css.replace(/\/\*[^\*]*\{[^\*]*\*\//g, '');
1426
1421
  };
1427
1422
 
1428
1423
  return Autoprefixer;
@@ -2200,6 +2195,35 @@ require.register("autoprefixer/lib/autoprefixer/hacks/align-self.js", function(e
2200
2195
 
2201
2196
  }).call(this);
2202
2197
 
2198
+ });
2199
+ require.register("autoprefixer/lib/autoprefixer/hacks/background-clip.js", function(exports, require, module){
2200
+ (function() {
2201
+ var BackgroundClip, Declaration,
2202
+ __hasProp = {}.hasOwnProperty,
2203
+ __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; };
2204
+
2205
+ Declaration = require('../declaration');
2206
+
2207
+ BackgroundClip = (function(_super) {
2208
+ __extends(BackgroundClip, _super);
2209
+
2210
+ BackgroundClip.names = ['background-clip'];
2211
+
2212
+ function BackgroundClip() {
2213
+ BackgroundClip.__super__.constructor.apply(this, arguments);
2214
+ if (this.value.indexOf('text') !== -1) {
2215
+ this.unprefixed = this.prop = '-nonstandard-background-clip';
2216
+ }
2217
+ }
2218
+
2219
+ return BackgroundClip;
2220
+
2221
+ })(Declaration);
2222
+
2223
+ module.exports = BackgroundClip;
2224
+
2225
+ }).call(this);
2226
+
2203
2227
  });
2204
2228
  require.register("autoprefixer/lib/autoprefixer/hacks/border-radius.js", function(exports, require, module){
2205
2229
  (function() {
@@ -3320,6 +3344,8 @@ require.register("autoprefixer/lib/autoprefixer/rule.js", function(exports, requ
3320
3344
 
3321
3345
  Declaration.register(require('./hacks/justify-content'));
3322
3346
 
3347
+ Declaration.register(require('./hacks/background-clip'));
3348
+
3323
3349
  Rule = (function() {
3324
3350
  function Rule(declarations, prefix) {
3325
3351
  this.declarations = declarations;
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autoprefixer-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.20130721
4
+ version: 0.6.20130728
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-07-21 00:00:00.000000000 Z
12
+ date: 2013-07-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: execjs
@@ -84,7 +84,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
84
84
  version: '0'
85
85
  segments:
86
86
  - 0
87
- hash: -1437076640064251505
87
+ hash: -718744127602576598
88
88
  required_rubygems_version: !ruby/object:Gem::Requirement
89
89
  none: false
90
90
  requirements:
@@ -93,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
93
  version: '0'
94
94
  segments:
95
95
  - 0
96
- hash: -1437076640064251505
96
+ hash: -718744127602576598
97
97
  requirements: []
98
98
  rubyforge_project:
99
99
  rubygems_version: 1.8.23