pager_api 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 67a2baad4c6f702c2513b3660a6a6dea15254eb0a45f04115a5575e18ea79c2f
4
- data.tar.gz: 3b29f1c7b4b9b523d06f5459e48fe526016166b0312d762aa21c5abf43fbcd55
3
+ metadata.gz: 59b7e16a70f5f9a9defe754c36e8107ee2dbe16f1ac048926b389067c92651f3
4
+ data.tar.gz: 192f9eaa768cfc4af32d6d7eeeaa7a2481e7fa90083ea4def249fd947670139e
5
5
  SHA512:
6
- metadata.gz: dd773a056972e831875221c96785f0011dbad53df9843036f344d95aab019e4b6647a7480f0fa1e62560c2f313d7aafe51cd611a378daa5a27b469bc3cd156a2
7
- data.tar.gz: 8ef3ff35c17a6524628c29a602f4673ce3ce4a66f631607dbc7b42b7cd91f7307a15d6e33136e4b7a980eab20c5fa1e2a8d37572b275ad05c1b98ad020e4dabb
6
+ metadata.gz: 6e1c7db162f8945b97b990a4967aad29ad2f48894df4f40700e8f69261c90066d190de82bae76214d6451afdeba4c4cee2d1cba5bc6f6c9cebc669f3d764a07e
7
+ data.tar.gz: 2ee6d7f5f40531062bcd7ed07ad4a2abfe2688f12359f8c9c85c025cf9744878e78f21bfa0018cc6d7877458d521c05aeca03290c0ad28fe52057263a68a7dd4
@@ -1,21 +1,23 @@
1
- begin; require "kaminari"; rescue LoadError; end
2
- begin; require "will_paginate"; rescue LoadError; end
3
- begin; require "pagy"; rescue LoadError; end
1
+ pagination_handler_name = PagerApi.pagination_handler.to_s
4
2
 
5
- # Dynamic pagination handler call
6
- require "pager_api/pagination/#{PagerApi.pagination_handler}"
7
-
8
- if defined?(ActionController::Base)
9
- ActionController::Base.send(:include, "PagerApi::Pagination::#{PagerApi.pagination_handler.to_s.classify}".constantize)
10
- else
11
- ActionController::API.send(:include, "PagerApi::Pagination::#{PagerApi.pagination_handler.to_s.classify}".constantize)
12
- end
13
-
14
- unless defined?(Kaminari) or defined?(WillPaginate) or defined?(Pagy)
3
+ begin
4
+ require pagination_handler_name
5
+ rescue LoadError
15
6
  Kernel.warn <<-WARNING.gsub(/^\s{4}/, "")
16
- Warning: pager-api needs Kaminari, Will Paginate or Pagy as a dependency.
7
+ Warning: pager-api needs #{pagination_handler_name} as a dependency.
17
8
  You need to add it to your Gemfile
18
9
 
19
- gem 'kaminari', gem 'will_paginate' or gem 'pagy'
10
+ gem '#{pagination_handler_name}'
11
+
12
+ Also you can change pagination_handler in pager_api initializer
20
13
  WARNING
21
14
  end
15
+
16
+ # Dynamic pagination handler call
17
+ require "pager_api/pagination/#{pagination_handler_name}"
18
+
19
+ if defined?(ActionController::Base)
20
+ ActionController::Base.send(:include, "PagerApi::Pagination::#{pagination_handler_name.classify}".constantize)
21
+ else
22
+ ActionController::API.send(:include, "PagerApi::Pagination::#{pagination_handler_name.classify}".constantize)
23
+ end
@@ -1,3 +1,3 @@
1
1
  module PagerApi
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pager_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Abraham Kuri
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-04-30 00:00:00.000000000 Z
11
+ date: 2019-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler