xray-rails 0.1.20 → 0.1.21

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8bd2c53be7dbfa2095d15f7eff4707a360168c35
4
- data.tar.gz: f90560698866e8604c6ff42253387967e0e82869
3
+ metadata.gz: f149a5a9fc13928e5000548a04914d62a4b65401
4
+ data.tar.gz: 63a8b1b1d992cd31a6edb95ee31e831bb59bd4c8
5
5
  SHA512:
6
- metadata.gz: e26c779029b13d02412a54d390c7adbbf97df30d3aa7c9c0922a0bbaf155aecc6217bc148f12805a504a8f9748e1b8d43649b96aeed18006253feb254d86d980
7
- data.tar.gz: 0ca8e5bf17949a26165de3b481e3ad534b6226ce11bf6ed2e23e99a02e6e72caa6ef475dbe1ac07d79006bb78a1a5e92f30a23c6b7b3179f4a6cf8613dfa72b7
6
+ metadata.gz: f4f872523204ac2e0ca6f950ceffe4cb364d7b17c5f354acee4492857b553466472eacab058a56d45befb849b42138071eb631bb24a1c6515bf47257672407b4
7
+ data.tar.gz: 4ed3f238f0bab14a3ec9b22075ee0594cc2f985e55713489110689d56db4a7c86c523657a01f52d41d4871354ed3e9ed33fae96e95807da4ae983ed477dfe804
@@ -59,7 +59,7 @@ module Xray
59
59
  # Modifying the original response obj maintains compatibility with other middlewares
60
60
  if ActionDispatch::Response === response
61
61
  response.body = [body]
62
- response.header['Content-Length'] = content_length unless response.try(:committed?)
62
+ response.header['Content-Length'] = content_length unless committed?(response)
63
63
  response.to_a
64
64
  else
65
65
  headers['Content-Length'] = content_length
@@ -73,6 +73,10 @@ module Xray
73
73
 
74
74
  private
75
75
 
76
+ def committed?(response)
77
+ response.respond_to?(:committed?) && response.committed?
78
+ end
79
+
76
80
  def inject_xray_bar!(html)
77
81
  html.sub!(/<body[^>]*>/) { "#{$~}\n#{render_xray_bar}" }
78
82
  end
@@ -1,3 +1,3 @@
1
1
  module Xray
2
- VERSION = "0.1.20".freeze
2
+ VERSION = "0.1.21".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xray-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.20
4
+ version: 0.1.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brent Dillingham
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-18 00:00:00.000000000 Z
11
+ date: 2016-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails