Sha256: a705d9d28786ed1f9d35a4ff67bee0f05554f8ee29bcf190c4591fb8d5f549bb

Contents?: true

Size: 670 Bytes

Versions: 7

Compression:

Stored size: 670 Bytes

Contents

module ExceptionNotifier
  class CampfireNotifier

    attr_accessor :subdomain
    attr_accessor :token
    attr_accessor :room

    def initialize(options)
      begin
        subdomain = options.delete(:subdomain)
        room_name = options.delete(:room_name)
        @campfire = Tinder::Campfire.new subdomain, options
        @room     = @campfire.find_room_by_name room_name
      rescue
        @campfire = @room = nil
      end
    end

    def call(exception, options={})
      @room.paste "A new exception occurred: '#{exception.message}' on '#{exception.backtrace.first}'" if active?
    end

    private

    def active?
      !@room.nil?
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
exception_notification-4.1.1 lib/exception_notifier/campfire_notifier.rb
exception_notification-4.1.0 lib/exception_notifier/campfire_notifier.rb
exception_notification-4.1.0.rc2 lib/exception_notifier/campfire_notifier.rb
exception_notification-4.1.0.rc1 lib/exception_notifier/campfire_notifier.rb
exception_notification-4.0.1 lib/exception_notifier/campfire_notifier.rb
exception_notification-4.0.0 lib/exception_notifier/campfire_notifier.rb
exception_notification-4.0.0.rc1 lib/exception_notifier/campfire_notifier.rb