module WillPaginate::Deprecation

Public Class Methods

warn(message, stack = caller) click to toggle source
# File lib/will_paginate/deprecation.rb, line 3
def warn(message, stack = caller)
  offending_line = origin_of_call(stack)
  full_message = "DEPRECATION WARNING: #{message} (called from #{offending_line})"
  logger = rails_logger || Kernel
  logger.warn full_message
end

Private Class Methods

origin_of_call(stack) click to toggle source
# File lib/will_paginate/deprecation.rb, line 16
def origin_of_call(stack)
  lib_root = File.expand_path('../../..', __FILE__)
  stack.find { |line| line.index(lib_root) != 0 } || stack.first
end
rails_logger() click to toggle source
# File lib/will_paginate/deprecation.rb, line 12
def rails_logger
  defined?(Rails.logger) && Rails.logger
end