Sha256: a236b6278983dbafa0288ae47db8537d402b048445f173de522b1d736881764b

Contents?: true

Size: 397 Bytes

Versions: 9

Compression:

Stored size: 397 Bytes

Contents

class Middleware
  def initialize(app)
    @app = app
  end

  def call(env)
    status, headers, response = @app.call(env)
    body = ''
    response.each { |part| body += part }
    if /css$/.match?(env['PATH_INFO'])
      body += "\n/* Added by Rack filter */"
      status, headers, response = Rack::Response.new(body, status, headers).finish
    end
    [status, headers, response]
  end
end

Version data entries

9 entries across 3 versions & 1 rubygems

Version Path
middleman-core-4.3.0.rc.4 fixtures/asset-hash-source-map/lib/middleware.rb
middleman-core-4.3.0.rc.4 fixtures/asset-hash-app/lib/middleware.rb
middleman-core-4.3.0.rc.4 fixtures/asset-hash-prefix/lib/middleware.rb
middleman-core-4.3.0.rc.3 fixtures/asset-hash-prefix/lib/middleware.rb
middleman-core-4.3.0.rc.3 fixtures/asset-hash-app/lib/middleware.rb
middleman-core-4.3.0.rc.3 fixtures/asset-hash-source-map/lib/middleware.rb
middleman-core-4.3.0.rc.2 fixtures/asset-hash-app/lib/middleware.rb
middleman-core-4.3.0.rc.2 fixtures/asset-hash-source-map/lib/middleware.rb
middleman-core-4.3.0.rc.2 fixtures/asset-hash-prefix/lib/middleware.rb