rack-exception_notifier 0.3.0 → 0.3.1

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: d74186879da5241fb7327492cb6374f6b5172360
4
- data.tar.gz: f2c670e0354515d0ed102d6c7c874ec4fd74194a
3
+ metadata.gz: 831f3eb0493ce8f92e0b543bfeed9da8d0b40e8c
4
+ data.tar.gz: 68fc3df5db1d31239fe076a1d7377600c92b3032
5
5
  SHA512:
6
- metadata.gz: 9a5c62ac24cb6a9cf0d63472119caf7fdd847f9b001621aa3a9451e94ce4b2b5dc4421456d2bc5fff60923524e57a78c768743b40c2d16e0249ebcae94448d4e
7
- data.tar.gz: 6a4de62c65be5c9ce3a4c139209a00e8fff01dd552857d048c85e5e44852efa1546a61cda1c61035fd4cfdc32cf97859943a0b66c6477e792b6c6ddf88e4583e
6
+ metadata.gz: bc1729664da7caacec2a61d0c87a85cf4848f882adec34641d25443adb8018b8d0eb66fc736240aa8b82fea237bc2803caf215f669bb0331ed515c0b86aa66c2
7
+ data.tar.gz: 3a00d434a5bd64194bfea88f1c8c10b2c4bba5a5df32996e5a476685cd5b3603f99de2cfd875e931af380e4c1c138dcbf62cdaf756f966a293d1e2eacb8007f7
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  class ExceptionNotifier
3
- VERSION = '0.3.0'
3
+ VERSION = '0.3.1'
4
4
  end
5
5
  end
@@ -29,6 +29,7 @@ module Rack
29
29
  def _send_notification(exception, env)
30
30
  mail = Mail.new
31
31
  mail.to(@options[:to])
32
+ mail.reply_to(@options[:reply_to])
32
33
  mail.from(@options[:from])
33
34
  mail.subject(@options[:subject] % [exception.to_s])
34
35
  mail.body(@template.result(binding))
@@ -77,5 +77,25 @@ describe Rack::ExceptionNotifier do
77
77
  mail.body.raw_source.should include('somethingspecial')
78
78
  mail.body.raw_source.should include('somethingspecial')
79
79
  end
80
+
81
+ it 'includes reply-to if configured' do
82
+ notifier = Rack::ExceptionNotifier.new(bad_app, :to => 'bar@example.com', :from => 'noreply@example.com', :reply_to => 'replyto@example.com', :subject => 'testing - %s')
83
+ expect do
84
+ notifier.call(env_with_body)
85
+ end.to raise_error(TestError)
86
+
87
+ mail = Mail::TestMailer.deliveries.first
88
+ mail.reply_to.should == ['replyto@example.com']
89
+ end
90
+
91
+ it 'does not include reply-to if not configured' do
92
+ notifier = Rack::ExceptionNotifier.new(bad_app, :to => 'bar@example.com', :from => 'noreply@example.com', :subject => 'testing - %s')
93
+ expect do
94
+ notifier.call(env_with_body)
95
+ end.to raise_error(TestError)
96
+
97
+ mail = Mail::TestMailer.deliveries.first
98
+ mail.reply_to.should be_nil
99
+ end
80
100
  end
81
101
  end
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.0
4
+ version: 0.3.1
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-03-31 00:00:00.000000000 Z
11
+ date: 2013-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mail
@@ -98,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
98
98
  version: '0'
99
99
  requirements: []
100
100
  rubyforge_project:
101
- rubygems_version: 2.0.1
101
+ rubygems_version: 2.0.3
102
102
  signing_key:
103
103
  specification_version: 4
104
104
  summary: Rack middleware to send email when exceptions are raised