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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YWE5NGFhMmFmNzA5YWE0ZDIxYjM2ZjNhMmFjYjQ3ZjVlMTdhZGI0Zg==
4
+ M2QzNWMxM2NhMzM1ZjUzMzRiYTRkNzdjNTU2ZmYzMmIwMjY5ZjdlZA==
5
5
  data.tar.gz: !binary |-
6
- Nzg4ZjZmZDI5MjFiZTM3YTA0MmRkMjYwZjQ5MzQ0NWUzYTdlZmY3MQ==
6
+ MjVhMTdiNzRmNzc1MmU2N2E1OTNkMjgyMDY2OGZkZDYwYTk2YWM5OA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MzcyNmNhYmQ2M2ZlYjMxYmMwZmUzM2YwYzE3YjQ3OTQwZTkxMjBlNjFlZDE1
10
- MmQ4OTJmZjQyNDNhMDE3YTQzYjgwNjIwMDVkZGI2NGU1MDM3YWQzZThhOGUz
11
- MzRiNTQ4YWI0ZDEzMTFmM2VkODNhMGI5ODlhZjdlMWFjN2ViZWY=
9
+ ZWQ2ZjkyZjFmMTI0MWM2Y2JjOWQzOTljYWM1MjQ3N2RkZjJkZDEwZDE4ODU4
10
+ YWNmMzM1ZjhiNTRkMGIwNzhkNGY0NDI0NTg1ZjVkZTBlNzc0YzRkNjM5MTky
11
+ MmM4ZjAxNWYxMzgyYTk3MGFiNzIxN2U2OGNiODg1NzZkNWY5ODQ=
12
12
  data.tar.gz: !binary |-
13
- YjA2MmM0M2Q2OTA1YjgzN2U3NjE5NjY0ZThhZjcwZTc2ZTI2YWQxZDFmYWYw
14
- MzNkMDIzZGVjMzc1ZGZlODQyZDVjZGJhODZhYzUyMDI5NmVmMGRmMTQzMjA2
15
- ZDM2MWMwOWMxZmFhOWM1ZGJmMzViN2JmMGYxMTllMWViMjNlZjQ=
13
+ MmZhNjdmZDJkYTBlODE0MmIxOThkMTVjNGI0ODJiZDI1OTk5OTkxNzE2YmZl
14
+ ZjBlNjk5ZTI4M2M0YTdhM2YxYjBhN2Y4NzI0YjQ1MTZkN2M2ZWY1OTYzNTlh
15
+ Yjg4MDQ0YzlhYzRkMzRlMjNlYjU2NDU4MTE4YjY2YTQ4OTVkZGQ=
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "html_mockup-autoprefixer"
5
- s.version = "0.0.1"
5
+ s.version = "0.1.0"
6
6
 
7
7
  s.authors = ["Flurin Egger"]
8
8
  s.email = ["info@digitpaint.nl", "flurin@digitpaint.nl"]
@@ -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
- if status == 200 && headers["Content-Type"].to_s.include?("text/css")
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: html_mockup-autoprefixer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Flurin Egger