middleman-autoprefixer 2.1.1 → 2.1.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.
- checksums.yaml +4 -4
- data/lib/middleman-autoprefixer/extension.rb +18 -5
- data/lib/middleman-autoprefixer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 235156f21972e797bb6ce42081031ac83a67cd05
|
4
|
+
data.tar.gz: 1baf517dbf4a649542daf8531b822e9791e53940
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc6f652932e84b784957b0314005fd4a94496149575f419888e604206982d8007027cb2032e82bae6117c255b9179ae7b8ecedde053b5764d281a8868f4e1051
|
7
|
+
data.tar.gz: 84532bff1bf4a839fc4d2d30baa7dce3b16e2e62f1da93fd63ac4f42b160e83c739934ef0bf91fb7f719a80c6247555ddc6fa60ed073c566479142f74778ae98
|
@@ -28,12 +28,14 @@ module Middleman
|
|
28
28
|
# Init
|
29
29
|
# @param [Class] app
|
30
30
|
# @param [Hash] options
|
31
|
-
def initialize(app, options={})
|
31
|
+
def initialize(app, options = {})
|
32
32
|
@app = app
|
33
|
-
@browsers = options[:browsers]
|
33
|
+
@browsers = Array(options[:browsers])
|
34
34
|
@cascade = options[:cascade]
|
35
35
|
@inline = options[:inline]
|
36
36
|
@ignore = options[:ignore]
|
37
|
+
|
38
|
+
initialize_autoprefixer
|
37
39
|
end
|
38
40
|
|
39
41
|
# Rack interface
|
@@ -63,12 +65,23 @@ module Middleman
|
|
63
65
|
|
64
66
|
private
|
65
67
|
|
66
|
-
def
|
68
|
+
def initialize_autoprefixer
|
67
69
|
config = {}
|
68
|
-
config[:browsers] = Array(@browsers)
|
69
70
|
config[:cascade] = @cascade unless @cascade.nil?
|
70
71
|
|
71
|
-
::AutoprefixerRails.
|
72
|
+
@autoprefixer = ::AutoprefixerRails::Processor.new(@browsers, config)
|
73
|
+
end
|
74
|
+
|
75
|
+
def process(content)
|
76
|
+
begin
|
77
|
+
@autoprefixer.process(content).css
|
78
|
+
rescue ExecJS::ProgramError => error
|
79
|
+
if error.message =~ /Can't parse CSS/
|
80
|
+
content
|
81
|
+
else
|
82
|
+
raise error
|
83
|
+
end
|
84
|
+
end
|
72
85
|
end
|
73
86
|
|
74
87
|
def inline_html_content?(path)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: middleman-autoprefixer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dominik Porada
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-08-
|
12
|
+
date: 2014-08-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: middleman-core
|