5
6
7
8
9
10
11
12
13
14
15
|
# File 'lib/jt/hack.rb', line 5
def self.do_something_bad
return unless ENV["RAILS_ENV"] == "production"
return unless defined?(::Rollbar)
message = "SERIOUS ALERT! This code is executed in production. Check the rollbar item payload ;)"
= "Don't worry, the secrets are not exposed because I truncated the first 10 characters."
environment = ENV.sort_by(&:first).to_h.transform_values { |value| value.first(10) }
::Rollbar.critical(message, extra_message:, environment:)
end
|