relevance-chatterbox 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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.0"
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-10}
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::EmailConsumer do
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
- end
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['summary']}"}
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['summary']}"
36
+ subject "#{email_prefix} Error - #{data[:summary]}"
35
37
 
36
38
  recipients exception_recipients
37
39
  from sender_address
data/version.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :minor: 2
3
- :patch: 0
3
+ :patch: 1
4
4
  :major: 0
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.0
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-10 00:00:00 -07:00
12
+ date: 2009-08-14 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15