html_mockup-autoprefixer 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/html_mockup-autoprefixer.gemspec +1 -1
- data/lib/html_mockup-autoprefixer/middleware.rb +9 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
M2QzNWMxM2NhMzM1ZjUzMzRiYTRkNzdjNTU2ZmYzMmIwMjY5ZjdlZA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MjVhMTdiNzRmNzc1MmU2N2E1OTNkMjgyMDY2OGZkZDYwYTk2YWM5OA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZWQ2ZjkyZjFmMTI0MWM2Y2JjOWQzOTljYWM1MjQ3N2RkZjJkZDEwZDE4ODU4
|
10
|
+
YWNmMzM1ZjhiNTRkMGIwNzhkNGY0NDI0NTg1ZjVkZTBlNzc0YzRkNjM5MTky
|
11
|
+
MmM4ZjAxNWYxMzgyYTk3MGFiNzIxN2U2OGNiODg1NzZkNWY5ODQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MmZhNjdmZDJkYTBlODE0MmIxOThkMTVjNGI0ODJiZDI1OTk5OTkxNzE2YmZl
|
14
|
+
ZjBlNjk5ZTI4M2M0YTdhM2YxYjBhN2Y4NzI0YjQ1MTZkN2M2ZWY1OTYzNTlh
|
15
|
+
Yjg4MDQ0YzlhYzRkMzRlMjNlYjU2NDU4MTE4YjY2YTQ4OTVkZGQ=
|
@@ -1,15 +1,22 @@
|
|
1
1
|
module HtmlMockupAutoprefixer
|
2
2
|
class Middleware
|
3
|
-
def initialize(app)
|
3
|
+
def initialize(app, options={})
|
4
4
|
@app = app
|
5
|
+
@options = {
|
6
|
+
:skip => []
|
7
|
+
}.update(options)
|
5
8
|
end
|
6
9
|
|
7
10
|
def call(env)
|
8
11
|
status, headers, body = @app.call(env)
|
9
|
-
|
12
|
+
|
13
|
+
if status == 200 && headers["Content-Type"].to_s.include?("text/css") && !@options[:skip].detect{|r| r.match(env["PATH_INFO"]) }
|
10
14
|
body_str = []
|
11
15
|
body.each{|f| body_str << f }
|
12
16
|
body_str = body_str.join
|
17
|
+
|
18
|
+
# This is a dirty little hack to always enforce UTF8
|
19
|
+
body_str.force_encoding("UTF-8")
|
13
20
|
|
14
21
|
Rack::Response.new(AutoprefixerRails.compile(body_str), status, headers).finish
|
15
22
|
else
|