2011-11-21 06:14:03 -05:00
|
|
|
module Kaminari
|
2012-05-21 07:02:37 -04:00
|
|
|
end
|
2011-11-21 06:14:03 -05:00
|
|
|
|
2012-05-21 07:02:37 -04:00
|
|
|
# load Rails/Railtie
|
|
|
|
begin
|
|
|
|
require 'rails'
|
|
|
|
rescue LoadError
|
|
|
|
#do nothing
|
|
|
|
end
|
2011-11-21 06:14:03 -05:00
|
|
|
|
2016-06-07 01:07:08 -04:00
|
|
|
$stderr.puts <<-EOC if !defined?(::Rails::Railtie) && !defined?(Sinatra) && !defined?(Grape)
|
2011-12-17 02:32:32 -05:00
|
|
|
warning: no framework detected.
|
2012-09-22 15:33:40 -04:00
|
|
|
|
|
|
|
Your Gemfile might not be configured properly.
|
2011-12-10 23:07:08 -05:00
|
|
|
---- e.g. ----
|
2012-09-22 15:33:40 -04:00
|
|
|
Rails:
|
2011-12-10 23:07:08 -05:00
|
|
|
gem 'kaminari'
|
|
|
|
|
2012-09-22 15:33:40 -04:00
|
|
|
Sinatra/Padrino:
|
2011-12-10 23:07:08 -05:00
|
|
|
gem 'kaminari', :require => 'kaminari/sinatra'
|
|
|
|
|
2012-09-22 15:33:40 -04:00
|
|
|
Grape:
|
2012-03-13 17:58:55 -04:00
|
|
|
gem 'kaminari', :require => 'kaminari/grape'
|
|
|
|
|
2012-05-21 07:02:37 -04:00
|
|
|
EOC
|
2011-11-21 06:14:03 -05:00
|
|
|
|
2012-05-21 07:02:37 -04:00
|
|
|
# load Kaminari components
|
|
|
|
require 'kaminari/config'
|
2013-08-29 06:53:16 -04:00
|
|
|
require 'kaminari/helpers/action_view_extension'
|
2012-05-21 07:02:37 -04:00
|
|
|
require 'kaminari/helpers/paginator'
|
|
|
|
require 'kaminari/models/page_scope_methods'
|
|
|
|
require 'kaminari/models/configuration_methods'
|
|
|
|
require 'kaminari/hooks'
|
2011-11-21 06:14:03 -05:00
|
|
|
|
2012-05-21 07:04:27 -04:00
|
|
|
# if not using Railtie, call `Kaminari::Hooks.init` directly
|
2016-06-07 01:07:08 -04:00
|
|
|
if defined? ::Rails::Railtie
|
2012-05-21 07:02:37 -04:00
|
|
|
require 'kaminari/railtie'
|
|
|
|
require 'kaminari/engine'
|
2011-11-21 06:14:03 -05:00
|
|
|
end
|