module Bullet
Public Class Methods
bullet_logger=(active)
click to toggle source
# File lib/bullet-board/ext/bullet.rb, line 16 def bullet_logger= active raise BulletBoard::ConfigurationError if active end
current_connection_id()
click to toggle source
# File lib/bullet-board/ext/bullet.rb, line 37 def current_connection_id @_current_connection_id ||= Thread.current["ActiveRecord::RuntimeRegistry"].connection_id end
make_board_log()
click to toggle source
# File lib/bullet-board/ext/bullet.rb, line 47 def make_board_log app_root = (defined?(::Rails.root) ? Rails.root.to_s : Dir.pwd).to_s FileUtils.mkdir_p(app_root + '/log') filename = "#{app_root}/log/#{Time.new.utc.strftime("%Y%m%d%H%M%S")}_bullet_board.log" web_log_file = File.open(filename, 'a+') web_log_file.tap { |f| f.sync = true } end
new_request?(id)
click to toggle source
# File lib/bullet-board/ext/bullet.rb, line 29 def new_request? id !requests.include? id end
notify_with_new_request?()
click to toggle source
# File lib/bullet-board/ext/bullet.rb, line 41 def notify_with_new_request? web_logger_enabled? && new_request?(current_connection_id) && notification_collector.notifications_present? end
requests()
click to toggle source
# File lib/bullet-board/ext/bullet.rb, line 33 def requests @@requests end
web_logger=(active)
click to toggle source
# File lib/bullet-board/ext/bullet.rb, line 24 def web_logger= active active = (!!active == active) ? active : false @web_logger_enabled = active end
web_logger_enabled?()
click to toggle source
# File lib/bullet-board/ext/bullet.rb, line 20 def web_logger_enabled? enable? && !!@web_logger_enabled end