middleman-autoprefixer 2.4.1 → 2.4.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/features/autoprefixer.feature +9 -0
- data/fixtures/proxy-app/config.rb +4 -0
- data/fixtures/proxy-app/source/index.html +12 -0
- data/fixtures/proxy-app/source/stylesheets/page.scss +4 -0
- data/lib/middleman-autoprefixer/extension.rb +12 -8
- data/lib/middleman-autoprefixer/version.rb +1 -1
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a796682ed038777cf1cdefba85c150595cf2f8d
|
4
|
+
data.tar.gz: 428018dee0965ecfe7eb03c9a15d712971a6c5ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8958165a0ea6522fef96a920705b1d5a63171ef741d4ff27f067ec41cf48a5a2f21478e287d851bec74cbbd8637ca0440191d7ce6b944d6566f742f8f8a69a1
|
7
|
+
data.tar.gz: a1444d22fa01ba20f45ae56126493eddb0433c83b007d774c12b8a3f630ea2f5ee40970f9b17832dac3469669af697419436653a634735992c6a758d481b8d50
|
@@ -55,3 +55,12 @@ Feature: Postprocessing stylesheets with Autoprefixer in different configuration
|
|
55
55
|
When I go to "/stylesheets/nope.css"
|
56
56
|
Then I should not see "-ms-border-radius"
|
57
57
|
And I should see "border-radius"
|
58
|
+
|
59
|
+
Scenario: With arbitrary proxy paths
|
60
|
+
Given the Server is running at "proxy-app"
|
61
|
+
When I go to "/proxy"
|
62
|
+
Then I should not see "-ms-border-radius"
|
63
|
+
And I should see "border-radius"
|
64
|
+
When I go to "/proxy-inline"
|
65
|
+
Then I should not see "-ms-border-radius"
|
66
|
+
And I should see "border-radius"
|
@@ -41,7 +41,11 @@ module Middleman
|
|
41
41
|
# @return [Array]
|
42
42
|
def call(env)
|
43
43
|
status, headers, response = @app.call(env)
|
44
|
-
|
44
|
+
|
45
|
+
type = headers['Content-Type'].split(';').first
|
46
|
+
path = env['PATH_INFO']
|
47
|
+
|
48
|
+
prefixed = process(response, type, path)
|
45
49
|
|
46
50
|
if prefixed.is_a?(String)
|
47
51
|
headers['Content-Length'] = ::Rack::Utils.bytesize(prefixed).to_s
|
@@ -53,10 +57,10 @@ module Middleman
|
|
53
57
|
|
54
58
|
private
|
55
59
|
|
56
|
-
def process(response, path)
|
57
|
-
if standalone_css_content?(path)
|
60
|
+
def process(response, type, path)
|
61
|
+
if standalone_css_content?(type, path)
|
58
62
|
prefix(extract_styles(response))
|
59
|
-
elsif inline_html_content?(path)
|
63
|
+
elsif inline_html_content?(type, path)
|
60
64
|
prefix_inline_styles(extract_styles(response))
|
61
65
|
else
|
62
66
|
nil
|
@@ -81,12 +85,12 @@ module Middleman
|
|
81
85
|
::Middleman::Util.extract_response_text(response)
|
82
86
|
end
|
83
87
|
|
84
|
-
def inline_html_content?(path)
|
85
|
-
|
88
|
+
def inline_html_content?(type, path)
|
89
|
+
type == 'text/html' && @inline
|
86
90
|
end
|
87
91
|
|
88
|
-
def standalone_css_content?(path)
|
89
|
-
|
92
|
+
def standalone_css_content?(type, path)
|
93
|
+
type == 'text/css' && @ignore.none? { |ignore| ::Middleman::Util.path_match(ignore, path) }
|
90
94
|
end
|
91
95
|
end
|
92
96
|
end
|
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.4.
|
4
|
+
version: 2.4.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: 2015-01-
|
12
|
+
date: 2015-01-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: middleman-core
|
@@ -160,6 +160,9 @@ files:
|
|
160
160
|
- fixtures/ignore-app/source/stylesheets/yep.scss
|
161
161
|
- fixtures/inline-app/config.rb
|
162
162
|
- fixtures/inline-app/source/index.html
|
163
|
+
- fixtures/proxy-app/config.rb
|
164
|
+
- fixtures/proxy-app/source/index.html
|
165
|
+
- fixtures/proxy-app/source/stylesheets/page.scss
|
163
166
|
- lib/middleman-autoprefixer.rb
|
164
167
|
- lib/middleman-autoprefixer/extension.rb
|
165
168
|
- lib/middleman-autoprefixer/version.rb
|
@@ -213,3 +216,6 @@ test_files:
|
|
213
216
|
- fixtures/ignore-app/source/stylesheets/yep.scss
|
214
217
|
- fixtures/inline-app/config.rb
|
215
218
|
- fixtures/inline-app/source/index.html
|
219
|
+
- fixtures/proxy-app/config.rb
|
220
|
+
- fixtures/proxy-app/source/index.html
|
221
|
+
- fixtures/proxy-app/source/stylesheets/page.scss
|