Created
December 27, 2018 18:17
-
-
Save marzdgzmn/382217dc13aab3df2429d4fbf514eb66 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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