module Rookout::UserWarnings

Constants

TLS_KEY

Public Class Methods

notify_error(error) click to toggle source
# File lib/rookout/user_warnings.rb, line 20
def notify_error error
  aug = Thread.current[TLS_KEY]
  aug.notify_error error unless aug.nil?
end
notify_warning(error) click to toggle source
# File lib/rookout/user_warnings.rb, line 15
def notify_warning error
  aug = Thread.current[TLS_KEY]
  aug.notify_warning error unless aug.nil?
end
with(aug, &block) click to toggle source
# File lib/rookout/user_warnings.rb, line 5
def with aug, &block
  thread = Thread.current
  begin
    thread[TLS_KEY] = aug
    block.call
  ensure
    thread[:ROOKOUT_USER_WARNINGS] = nil
  end
end

Private Instance Methods

notify_error(error) click to toggle source
# File lib/rookout/user_warnings.rb, line 20
def notify_error error
  aug = Thread.current[TLS_KEY]
  aug.notify_error error unless aug.nil?
end
notify_warning(error) click to toggle source
# File lib/rookout/user_warnings.rb, line 15
def notify_warning error
  aug = Thread.current[TLS_KEY]
  aug.notify_warning error unless aug.nil?
end
with(aug, &block) click to toggle source
# File lib/rookout/user_warnings.rb, line 5
def with aug, &block
  thread = Thread.current
  begin
    thread[TLS_KEY] = aug
    block.call
  ensure
    thread[:ROOKOUT_USER_WARNINGS] = nil
  end
end