Sha256: ddb1b2ccc1d85d9ab8d9d3f99c16e9d57ec9349df10c38e3a6aea1804c3b9384

Contents?: true

Size: 888 Bytes

Versions: 12

Compression:

Stored size: 888 Bytes

Contents

require 'rollbar'

module RollbarTest # :nodoc:
  def self.run
    return unless confirmed_token?

    puts 'Test sending to Rollbar...'
    result = Rollbar.info('Test message from rollbar:test')

    if result == 'error'
      puts error_message
    else
      puts success_message
    end
  end

  def self.confirmed_token?
    return true if Rollbar.configuration.access_token

    puts token_error_message

    false
  end

  def self.token_error_message
    'Rollbar needs an access token configured. Check the README for instructions.'
  end

  def self.error_message
    'Test failed! You may have a configuration issue, or you could be using a ' \
    'gem that\'s blocking the test. Contact support@rollbar.com if you need ' \
    'help troubleshooting.'
  end

  def self.success_message
    'Testing rollbar with "rake rollbar:test". If you can see this, it works.'
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rollbar-3.6.1 lib/rollbar/rollbar_test.rb
rollbar-3.6.0 lib/rollbar/rollbar_test.rb
rollbar-3.5.2 lib/rollbar/rollbar_test.rb
rollbar-3.5.1 lib/rollbar/rollbar_test.rb
rollbar-3.5.0 lib/rollbar/rollbar_test.rb
rollbar-3.4.2 lib/rollbar/rollbar_test.rb
rollbar-3.4.1 lib/rollbar/rollbar_test.rb
rollbar-3.4.0 lib/rollbar/rollbar_test.rb
rollbar-3.3.3 lib/rollbar/rollbar_test.rb
rollbar-3.3.2 lib/rollbar/rollbar_test.rb
rollbar-3.3.1 lib/rollbar/rollbar_test.rb
rollbar-3.3.0 lib/rollbar/rollbar_test.rb