relevance-chatterbox 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
data/chatterbox.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{chatterbox}
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Rob Sanheim"]
|
12
|
-
s.date = %q{2009-08-
|
12
|
+
s.date = %q{2009-08-14}
|
13
13
|
s.email = %q{rsanheim@gmail.com}
|
14
14
|
s.extra_rdoc_files = [
|
15
15
|
"LICENSE",
|
@@ -1,8 +1,7 @@
|
|
1
1
|
require File.expand_path(File.join(File.dirname(__FILE__), *%w[.. .. .. example_helper]))
|
2
2
|
require 'chatterbox'
|
3
3
|
|
4
|
-
describe Chatterbox::
|
5
|
-
|
4
|
+
describe Chatterbox::Mailer do
|
6
5
|
|
7
6
|
it "displays environment vars sorted" do
|
8
7
|
data = {
|
@@ -21,4 +20,30 @@ EOL
|
|
21
20
|
mail.body.should include(expected.strip)
|
22
21
|
end
|
23
22
|
|
24
|
-
|
23
|
+
it "does not mutate the provided hash" do
|
24
|
+
input = {'foo' => 'bar', :environment => {}}
|
25
|
+
Chatterbox::Mailer.create_exception_notification(input)
|
26
|
+
input.should == {'foo' => 'bar', :environment => {}}
|
27
|
+
end
|
28
|
+
|
29
|
+
describe "subject" do
|
30
|
+
|
31
|
+
it "extracts the subject from the given data hash when the key is a symbol" do
|
32
|
+
mail = Chatterbox::Mailer.create_exception_notification(:environment => {}, :summary => 'foo')
|
33
|
+
mail.subject.should include('foo')
|
34
|
+
end
|
35
|
+
|
36
|
+
it "extracts the subject from the given data hash when the key is a string" do
|
37
|
+
mail = Chatterbox::Mailer.create_exception_notification(:environment => {}, 'summary' => 'foo')
|
38
|
+
mail.subject.should include('foo')
|
39
|
+
end
|
40
|
+
|
41
|
+
it "includes the given prefix" do
|
42
|
+
Chatterbox::Mailer.email_prefix = '[super important email]'
|
43
|
+
mail = Chatterbox::Mailer.create_exception_notification(:environment => {})
|
44
|
+
mail.subject.should match(/\[super important email\]/)
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
@@ -8,7 +8,7 @@ module Chatterbox
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def process
|
11
|
-
Chatterbox.logger.debug { "Mailing notification #{notice[
|
11
|
+
Chatterbox.logger.debug { "Mailing notification #{notice[:summary]}"}
|
12
12
|
Mailer.deliver_exception_notification(notice)
|
13
13
|
end
|
14
14
|
|
@@ -29,9 +29,11 @@ module Chatterbox
|
|
29
29
|
def self.reloadable?() false end
|
30
30
|
|
31
31
|
def exception_notification(data={})
|
32
|
+
data = data.symbolize_keys
|
33
|
+
|
32
34
|
content_type "text/plain"
|
33
35
|
|
34
|
-
subject "#{email_prefix} Error - #{data[
|
36
|
+
subject "#{email_prefix} Error - #{data[:summary]}"
|
35
37
|
|
36
38
|
recipients exception_recipients
|
37
39
|
from sender_address
|
data/version.yml
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relevance-chatterbox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rob Sanheim
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-08-
|
12
|
+
date: 2009-08-14 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|