Module: JT::Hack

Defined in:
lib/jt/hack.rb,
lib/jt/hack/version.rb

Constant Summary collapse

VERSION =
"0.0.2"

Class Method Summary collapse

Class Method Details

.do_something_badObject



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 ;)"
  extra_message = "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