Sha256: f8f166ad87e69a6ec09a1fdc15c9b0373dc6adb8ab04169a4f0a17f4eddf5d93

Contents?: true

Size: 948 Bytes

Versions: 1

Compression:

Stored size: 948 Bytes

Contents

# frozen_string_literal: true

module Rollbar
  module Mode
    # Rollbar production minor-mode.
    class Production

      class << self

        # :reek:TooManyStatements
        def apply
          Rollbar.configure do |config|
            config.enabled = true
            config.access_token = access_token

            # Override the default values with better ones
            config.populate_empty_backtraces = true
            config.use_async = true

            # Set up the code-related metrics.
            config.code_version = code_version
            config.environment = environment
          end

          warn 'Rollbar: using online service at https://rollbar.com'
        end

        def code_version
          ENV['HEROKU_SLUG_COMMIT']
        end

        def environment
          ENV['HEROKU_APP_NAME']
        end

        def access_token
          ENV['ROLLBAR_ACCESS_TOKEN']
        end

      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rollbar-mode-0.0.1 lib/rollbar/mode/production.rb