1
0
Fork 0
mirror of https://github.com/kaminari/kaminari.git synced 2022-11-09 13:44:37 -05:00
kaminari--kaminari/lib/kaminari.rb

39 lines
786 B
Ruby
Raw Normal View History

module Kaminari
2012-05-21 07:02:37 -04:00
end
2012-05-21 07:02:37 -04:00
# load Rails/Railtie
begin
require 'rails'
rescue LoadError
#do nothing
end
2012-05-21 07:02:37 -04:00
$stderr.puts <<-EOC if !defined?(Rails) && !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
2012-05-21 07:02:37 -04:00
# load Kaminari components
require 'kaminari/config'
require 'kaminari/helpers/paginator'
require 'kaminari/models/page_scope_methods'
require 'kaminari/models/configuration_methods'
require 'kaminari/hooks'
2012-05-21 07:04:27 -04:00
# if not using Railtie, call `Kaminari::Hooks.init` directly
2012-05-21 07:02:37 -04:00
if defined? Rails
require 'kaminari/railtie'
require 'kaminari/engine'
end