rack-exception_notifier 0.3.4 → 0.3.5

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: eff7912fbd5365e4716d2ad545cd3b3b395d4100
4
- data.tar.gz: fae2590d70af34a431f175d52b6ca184b7ad800c
3
+ metadata.gz: bf2148decb6912145472805c0088c901219d0303
4
+ data.tar.gz: 228107d797c19a313d9de30b9f79b48f9db2d010
5
5
  SHA512:
6
- metadata.gz: 336dd7f29d4d713531c086becef893dcb137f8eb11041cede89b745aaf455d01da95becf5da2520f72621c53ec367ab4b384fa7b19a90011b8a9575934ff737f
7
- data.tar.gz: 1b68ab301dae6dc4d72847db8456a858ebdf2a58b0a8df5811d2608e66fee16b72b318843c5f85eb143c17815c793b0534857a01d7f121e4711f52c707d72ff0
6
+ metadata.gz: 3f438bcac29835c9259df6c74f0d6baf35e98931422ebe4b39cfbdbe80e492d3848abf74131e5798fce48a28b03d27686d10c8fffed5c60b0feef0465cf6f0da
7
+ data.tar.gz: 4778a9950da02bc867ba162cfb8caeacd8f02c49a3bd2611da3c73b53c8ae6941fb6420705ecd5f9513e3fb6150d8d7f37702328efc4a70b9c01672134bc7958
@@ -40,7 +40,7 @@ module Rack
40
40
  end
41
41
 
42
42
  def _body_present?(env)
43
- env['rack.input'].size > 0
43
+ _extract_body(env, 1)
44
44
  end
45
45
 
46
46
  def _exclude_env_key?(env, key)
@@ -55,10 +55,10 @@ module Rack
55
55
  _body_present?(env) && @options[:include_body]
56
56
  end
57
57
 
58
- def _extract_body(env)
58
+ def _extract_body(env, length = nil)
59
59
  io = env['rack.input']
60
- io.rewind if io.respond_to?(:rewind)
61
- io.read
60
+ io.rewind
61
+ io.read(length)
62
62
  end
63
63
 
64
64
  Template = (<<-'EMAIL').gsub(/^ {4}/, '')
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  class ExceptionNotifier
3
- VERSION = '0.3.4'
3
+ VERSION = '0.3.5'
4
4
  end
5
5
  end
@@ -18,10 +18,16 @@ describe Rack::ExceptionNotifier do
18
18
  end
19
19
 
20
20
  it 'passes rack lint' do
21
- app = Rack::Lint.new(good_app)
21
+ lint_app = Rack::Lint.new(bad_app)
22
22
  expect do
23
- Rack::ExceptionNotifier.new(app, :to => 'bar@example.com', :from => 'noreply@example.com', :subject => 'testing - %s')
24
- end.to_not raise_error
23
+ app = Rack::ExceptionNotifier.new(
24
+ lint_app,
25
+ :to => 'bar@example.com',
26
+ :from => 'noreply@example.com',
27
+ :subject => 'testing - %s',
28
+ )
29
+ app.call(env_with_body)
30
+ end.to raise_error(TestError)
25
31
  end
26
32
  end
27
33
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-exception_notifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Downey
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-24 00:00:00.000000000 Z
11
+ date: 2013-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mail