Skip to content

Instantly share code, notes, and snippets.

@shime
Created April 4, 2012 16:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shime/2303494 to your computer and use it in GitHub Desktop.
Save shime/2303494 to your computer and use it in GitHub Desktop.
[Airbrake] little hack to receive email on every occurrence of exception
Airbrake.configure do |config|
config.api_key = '092f2e6780f7c9117353d28dbe8486a3'
config.development_environments = []
end
module Airbrake
module Customization
def self.included(base) #:nodoc:
base.send(:alias_method_chain,:initialize,:customization)
end
def generate_hash
(0...50).map{ (('a'..'z').to_a + ('0'..'9').to_a).shuffle[rand(26)] }.join
end
def initialize_with_customization(args)
initialize_without_customization(args)
self.environment_name = "#{args[:environment_name]} - Custom Hash: #{generate_hash}"
end
end
end
Airbrake::Notice.send(:include,Airbrake::Customization)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment