Skip to content

Commit 71b8142

Browse files
committed
Merge pull request github#210 from github/mail-gem
replace the tmail gem with the mail gem.
2 parents 05c7b05 + 3c9579b commit 71b8142

File tree

10 files changed

+227
-124
lines changed

10 files changed

+227
-124
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ gem "oauth", "0.4.4"
1010
gem "sinatra", "~> 1.2.6"
1111
gem "tilt", "~> 1.2.1"
1212
gem "tinder", "1.7.0"
13-
gem "tmail", "1.2.7.1"
13+
gem "mail", "~>2.3"
1414
gem "xml-simple", "1.0.11", :require => 'xmlsimple'
1515
gem "xmpp4r-simple", "0.8.8"
1616
#gem "yammer4r", "0.1.5"

Gemfile.lock

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,16 @@ GEM
3030
json (1.6.1)
3131
jwt (0.1.3)
3232
json (>= 1.2.4)
33+
mail (2.3.0)
34+
i18n (>= 0.4.0)
35+
mime-types (~> 1.16)
36+
treetop (~> 1.4.8)
3337
mash (0.1.1)
3438
mime-types (1.16)
3539
multi_json (1.0.3)
3640
multipart-post (1.1.3)
3741
oauth (0.4.4)
42+
polyglot (0.3.3)
3843
rack (1.3.0)
3944
rake (0.8.7)
4045
ruby-hmac (0.4.0)
@@ -58,7 +63,9 @@ GEM
5863
multi_json (~> 1.0)
5964
multipart-post (~> 1.1)
6065
twitter-stream (~> 0.1)
61-
tmail (1.2.7.1)
66+
treetop (1.4.10)
67+
polyglot
68+
polyglot (>= 0.3.1)
6269
twilio-ruby (3.4.2)
6370
builder (>= 2.1.2)
6471
jwt (>= 0.1.2)
@@ -81,6 +88,7 @@ DEPENDENCIES
8188
amqp (= 0.6.7)
8289
faraday (= 0.7.5.pre)
8390
httparty (= 0.7.4)
91+
mail (~> 2.3)
8492
mash (~> 0.1.1)
8593
mime-types (~> 1.15)
8694
oauth (= 0.4.4)
@@ -91,7 +99,6 @@ DEPENDENCIES
9199
thin (= 1.2.2)
92100
tilt (~> 1.2.1)
93101
tinder (= 1.7.0)
94-
tmail (= 1.2.7.1)
95102
twilio-ruby (= 3.4.2)
96103
xml-simple (= 1.0.11)
97104
xmpp4r-simple (= 0.8.8)

config/load.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
require 'tinder'
9494
require 'yajl/json_gem'
9595
require 'basecamp'
96-
require 'tmail'
96+
require 'mail'
9797
require 'xmpp4r'
9898
require 'xmpp4r/jid.rb'
9999
require 'xmpp4r/presence.rb'

lib/app.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def self.service(svc)
3131
status 400
3232
"Service Timeout"
3333
rescue Object => boom
34-
report_exception svc, data, boom
34+
report_exception svc, data, boom, params[:event], payload
3535
status 500
3636
"ERROR"
3737
end
@@ -56,7 +56,7 @@ def parse_payload(json)
5656
# exception - An Exception instance.
5757
#
5858
# Returns nothing.
59-
def report_exception(service_class, service_data, exception)
59+
def report_exception(service_class, service_data, exception, event, payload)
6060
backtrace = Array(exception.backtrace)[0..500]
6161

6262
data = {
@@ -67,8 +67,10 @@ def report_exception(service_class, service_data, exception)
6767
'message' => exception.message[0..254],
6868
'backtrace' => backtrace.join("\n"),
6969
'rollup' => Digest::MD5.hexdigest(exception.class.to_s + backtrace[0]),
70-
'service' => service_class.to_s
70+
'service' => service_class.to_s,
7171
}
72+
data['event'] = event if event
73+
data['payload'] = payload.inspect if payload
7274

7375
if exception.kind_of?(Service::Error)
7476
if exception.original_exception

0 commit comments

Comments
 (0)