Skip to content

Instantly share code, notes, and snippets.

@marzdgzmn
Created December 27, 2018 18:17
Show Gist options
  • Save marzdgzmn/382217dc13aab3df2429d4fbf514eb66 to your computer and use it in GitHub Desktop.
Save marzdgzmn/382217dc13aab3df2429d4fbf514eb66 to your computer and use it in GitHub Desktop.
module A
module B
class Manager
include Module A::B::Notification
at_exit do
if $ERROR_INFO
error = {
timnestamp: Time.now,
message: $ERROR_INFO.message,
backtrace: $ERROR_INFO.backtrace,
gems: Gem.loaded_specs.inject({}) do |m, (n, s)|
m.merge(n => s.version)
end
}
send_mail YAML.dump(error)
end
end
end
end
end
module A
module B
module Notification
def send_mail
# send mail via pony
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment