Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add user and url to the notifications

  • Loading branch information...
commit 59cfe48c5c27e9cbb964aa65221f78ce4f0cb166 1 parent 82f3614
@ssoroka authored
View
3  lib/bullet.rb
@@ -85,8 +85,9 @@ def gather_inline_notifications
responses.join( "\n" )
end
- def perform_out_of_channel_notifications
+ def perform_out_of_channel_notifications(env = {})
for_each_active_notifier_with_notification do |notification|
+ notification.url = [env['HTTP_HOST'], env['REQUEST_URI']].compact.join
notification.notify_out_of_channel
end
end
View
8 lib/bullet/notification/base.rb
@@ -1,7 +1,7 @@
module Bullet
module Notification
class Base
- attr_accessor :notifier
+ attr_accessor :notifier, :url
attr_reader :base_class, :associations, :path
def initialize( base_class, associations, path = nil )
@@ -15,6 +15,10 @@ def title
def body
end
+
+ def whoami
+ "user: " << `whoami`.chomp
+ end
def body_with_caller
body
@@ -25,7 +29,7 @@ def standard_notice
end
def full_notice
- @full_notice ||= title + "\n" + body_with_caller
+ [whoami, url, title, body_with_caller].compact.join("\n")
end
def notify_inline
View
2  lib/bullet/rack.rb
@@ -16,7 +16,7 @@ def call(env)
response_body = response.body << Bullet.gather_inline_notifications
headers['Content-Length'] = response_body.length.to_s
end
- Bullet.perform_out_of_channel_notifications
+ Bullet.perform_out_of_channel_notifications(env)
end
response_body ||= response.body
Bullet.end_request
Please sign in to comment.
Something went wrong with that request. Please try again.