heroku-request-id 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -29,19 +29,19 @@ module HerokuRequestId
29
29
  @start = Time.now
30
30
  @request_id = env['HTTP_HEROKU_REQUEST_ID']
31
31
  @status, @headers, @response = @app.call(env)
32
- @stop = Time.now
33
- @elapsed = @stop - @start
34
- if self.class.log_line
35
- $stdout.puts("heroku-request-id=#{env['HTTP_HEROKU_REQUEST_ID']} measure=\"rack-request\" elapsed=#{@elapsed}")
36
- end
37
32
  [@status, @headers, self]
38
33
  end
39
34
 
40
35
  def each(&block)
36
+ @response.each(&block)
37
+ @stop = Time.now
38
+ @elapsed = @stop - @start
41
39
  if self.class.html_comment && @headers["Content-Type"].include?("text/html")
42
40
  block.call("<!-- Heroku request id : #{@request_id} - Elapsed time : #{@elapsed} -->\n")
43
41
  end
44
- @response.each(&block)
42
+ if self.class.log_line
43
+ $stdout.puts("heroku-request-id=#{@request_id} measure=\"rack-request\" elapsed=#{@elapsed}")
44
+ end
45
45
  end
46
46
 
47
47
  end
@@ -1,3 +1,3 @@
1
1
  module HerokuRequestId
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heroku-request-id
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -112,7 +112,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
112
112
  version: '0'
113
113
  segments:
114
114
  - 0
115
- hash: 517563045889090347
115
+ hash: 307216651486339733
116
116
  required_rubygems_version: !ruby/object:Gem::Requirement
117
117
  none: false
118
118
  requirements:
@@ -121,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
121
  version: '0'
122
122
  segments:
123
123
  - 0
124
- hash: 517563045889090347
124
+ hash: 307216651486339733
125
125
  requirements: []
126
126
  rubyforge_project:
127
127
  rubygems_version: 1.8.24