-
-
Save thermistor/a4c6c484bd59ad8bb3fb74025fa28d27 to your computer and use it in GitHub Desktop.
Dead code helper
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 DeadCode | |
NotDeadCodeError = Class.new(StandardError) | |
def dead_code! | |
error = NotDeadCodeError.new("NOT dead code: #{caller.first.inspect}") | |
if Rails.env.development? | |
raise error | |
else | |
Rollbar.warning(error) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment