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