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

Move core code to kaminari-core gem

This commit is contained in:
Akira Matsuda 2016-10-04 21:11:43 +09:00
parent a0748cb68f
commit bb0226c075
37 changed files with 41 additions and 45 deletions

View file

@ -1,7 +1,42 @@
require "kaminari/core/version"
module Kaminari
module Core
# Your code goes here...
end
end
# load Rails/Railtie
begin
require 'rails'
rescue LoadError
#do nothing
end
$stderr.puts <<-EOC if !defined?(::Rails::Railtie) && !defined?(Sinatra) && !defined?(Grape)
warning: no framework detected.
Your Gemfile might not be configured properly.
---- e.g. ----
Rails:
gem 'kaminari'
Sinatra/Padrino:
gem 'kaminari-sinatra'
Grape:
gem 'kaminari-grape'
EOC
# load Kaminari components
require 'kaminari/config'
require 'kaminari/exceptions'
require 'kaminari/helpers/paginator'
require 'kaminari/models/page_scope_methods'
require 'kaminari/models/configuration_methods'
require 'kaminari/hooks'
require 'kaminari/actionview'
require 'kaminari/activerecord'
# if not using Railtie, call `Kaminari::Hooks.init` directly
if defined? ::Rails::Railtie
require 'kaminari/railtie'
require 'kaminari/engine'
end

View file

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