Class: Rack::Track
- Inherits:
-
Object
- Object
- Rack::Track
- Defined in:
- lib/rack/track.rb
Defined Under Namespace
Classes: PixelSet
Instance Method Summary collapse
- #call(env) ⇒ Object
- #each(&block) ⇒ Object
-
#initialize(app, &block) ⇒ Track
constructor
A new instance of Track.
Constructor Details
Instance Method Details
#call(env) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/rack/track.rb', line 8 def call(env) request = Rack::Request.new(env) status, headers, response = @app.call(env) if /^text\/html/ =~ headers["Content-Type"] response_body = "" response.each { |p| response_body += p } response = [@rules.apply(request, response_body)] if response_body.include? "</body>" headers["Content-Length"] = get_length(response) end [status, headers, response] end |
#each(&block) ⇒ Object
21 22 |
# File 'lib/rack/track.rb', line 21 def each(&block) end |