Skip to content

Instantly share code, notes, and snippets.

@thermistor
Created October 18, 2022 03:04
Show Gist options
  • Save thermistor/a4c6c484bd59ad8bb3fb74025fa28d27 to your computer and use it in GitHub Desktop.
Save thermistor/a4c6c484bd59ad8bb3fb74025fa28d27 to your computer and use it in GitHub Desktop.
Dead code helper
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