Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Safely is a project extracted from the daemon-kit project that allows you to run dangerous code inside a loving embrace. All exceptions will be reported using one of the configured strategies and your Ruby process will be kept alive in the future.
Safely itself has no dependencies, you simply install the 'safely' gem or add it to your Gemfile. Each strategy you choose to use for reporting exceptions might require their own dependencies.
Once the gem has been required, and the strategies configured, you simply make use of it as follows:
safely do perform_dangerous_operation end
The safely method is available in any Ruby context.
Since 0.3, Safely supports logging all exceptions to a file when a Ruby program terminates abnormally. This is extremely useful when your program suddenly falls over and you have no idea why. For more information see the Backtrace page.