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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bb72623cd212918c59d0228c9d7f54fafd87b61a
4
- data.tar.gz: 03e4c768b9e028ff57d614ed192a8db7e3616dde
3
+ metadata.gz: 2a796682ed038777cf1cdefba85c150595cf2f8d
4
+ data.tar.gz: 428018dee0965ecfe7eb03c9a15d712971a6c5ad
5
5
  SHA512:
6
- metadata.gz: 2f8ec7c1172f2744941425f024352c0f11cd9ded5c30e25d3a2704b5ec9315062451fd24c9afedac62397aabead8d55c301fe0d12cf907ff142af5b0142c0b15
7
- data.tar.gz: 8e94a277116ebcf11e0f2f6f85606c5639a54a3f95625edbed5bdcdd2e8390db0e3b9d7f389acf900d670b535377b72e8dfa08ce28be13f6af313f49ded0b4d4
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"
@@ -0,0 +1,4 @@
1
+ activate :autoprefixer, inline: true
2
+
3
+ proxy '/proxy', '/stylesheets/page.css', ignore: true
4
+ proxy '/proxy-inline', '/index.html', ignore: true
@@ -0,0 +1,12 @@
1
+ <html>
2
+ <head>
3
+ </head>
4
+ <body>
5
+ <style>
6
+ input {
7
+ -ms-border-radius: 5px;
8
+ border-radius: 5px;
9
+ }
10
+ </style>
11
+ </body>
12
+ </html>
@@ -0,0 +1,4 @@
1
+ input {
2
+ -ms-border-radius: 5px;
3
+ border-radius: 5px;
4
+ }
@@ -41,7 +41,11 @@ module Middleman
41
41
  # @return [Array]
42
42
  def call(env)
43
43
  status, headers, response = @app.call(env)
44
- prefixed = process(response, env['PATH_INFO'])
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
- (path.end_with?('.html') || path.end_with?('.php')) && @inline
88
+ def inline_html_content?(type, path)
89
+ type == 'text/html' && @inline
86
90
  end
87
91
 
88
- def standalone_css_content?(path)
89
- path.end_with?('.css') && @ignore.none? { |ignore| ::Middleman::Util.path_match(ignore, path) }
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
@@ -1,5 +1,5 @@
1
1
  module Middleman
2
2
  module Autoprefixer
3
- VERSION = '2.4.1'.freeze
3
+ VERSION = '2.4.2'.freeze
4
4
  end
5
5
  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.1
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-29 00:00:00.000000000 Z
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