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
Akira Matsuda 6cbd2d5645 Revert "An Engine can include app/helpers, so let's move the helpers there"
This reverts commit 2ed8adfe37.

reason: Because mounted engines on the app doesn't search the main_app's helpers, then throws "undefined method `paginate'" in the views
2013-11-10 02:58:22 +09:00

39 lines
835 B
Ruby

module Kaminari
end
# load Rails/Railtie
begin
require 'rails'
rescue LoadError
#do nothing
end
$stderr.puts <<-EOC if !defined?(Rails) && !defined?(Sinatra) && !defined?(Grape)
warning: no framework detected.
Your Gemfile might not be configured properly.
---- e.g. ----
Rails:
gem 'kaminari'
Sinatra/Padrino:
gem 'kaminari', :require => 'kaminari/sinatra'
Grape:
gem 'kaminari', :require => 'kaminari/grape'
EOC
# load Kaminari components
require 'kaminari/config'
require 'kaminari/helpers/action_view_extension'
require 'kaminari/helpers/paginator'
require 'kaminari/models/page_scope_methods'
require 'kaminari/models/configuration_methods'
require 'kaminari/hooks'
# if not using Railtie, call `Kaminari::Hooks.init` directly
if defined? Rails
require 'kaminari/railtie'
require 'kaminari/engine'
end