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

40 lines
857 B
Ruby
Raw Permalink 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
$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
2012-05-21 07:02:37 -04:00
# load Kaminari components
require 'kaminari/config'
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'
2012-05-21 07:04:27 -04:00
# if not using Railtie, call `Kaminari::Hooks.init` directly
if defined? ::Rails::Railtie
2012-05-21 07:02:37 -04:00
require 'kaminari/railtie'
require 'kaminari/engine'
end