module WillPaginate::Deprecation
Public Class Methods
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
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
Source
# File lib/will_paginate/deprecation.rb, line 12 def rails_logger defined?(Rails.logger) && Rails.logger end