paginate-responder 1.4.1 → 1.4.2.beta0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -2
- data/Gemfile +3 -2
- data/gemfiles/Gemfile.rails-4-2 +8 -0
- data/lib/paginate-responder/adapter/kaminari_adapter.rb +5 -1
- data/lib/paginate-responder/adapter/paginate_adapter.rb +5 -1
- data/lib/paginate-responder/paginator.rb +11 -1
- data/lib/paginate-responder/version.rb +2 -2
- data/test/test_helper.rb +6 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: baf1e4bd33df9ae0d0b8dbb325e6b0be1c6387ef
|
4
|
+
data.tar.gz: 9b2a70c169863d0c43dcc702fb0221fb696b3d1a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e25542261b208b1242be991256235d24d781d0efbe0f7169434155e023c284fa1fb5a9a4f76018d3e7d103969bb163d8e67892710004b69866bb24662aa52a96
|
7
|
+
data.tar.gz: ad7251cb51db5e99a739a2b91ee73c52f889fb454aa6791dee73bb1db335545010ba4885e2fca6441e4b95348ebf39df989f095435d4a66bc2342ed9b8548ba7
|
data/.travis.yml
CHANGED
@@ -1,7 +1,8 @@
|
|
1
|
+
sudo: false
|
1
2
|
language: ruby
|
2
3
|
rvm:
|
3
|
-
- 2.1
|
4
|
-
- 2.0
|
4
|
+
- '2.1'
|
5
|
+
- '2.0'
|
5
6
|
- 1.9.3
|
6
7
|
- rbx
|
7
8
|
env:
|
@@ -11,6 +12,7 @@ gemfile:
|
|
11
12
|
- gemfiles/Gemfile.rails-3-2
|
12
13
|
- gemfiles/Gemfile.rails-4-0
|
13
14
|
- gemfiles/Gemfile.rails-4-1
|
15
|
+
- gemfiles/Gemfile.rails-4-2
|
14
16
|
- gemfiles/Gemfile.rails-head
|
15
17
|
matrix:
|
16
18
|
allow_failures:
|
data/Gemfile
CHANGED
@@ -4,6 +4,7 @@ source 'https://rubygems.org'
|
|
4
4
|
gemspec
|
5
5
|
|
6
6
|
group :development do
|
7
|
-
gem 'actionpack', :
|
8
|
-
gem 'activerecord', :
|
7
|
+
gem 'actionpack', require: false
|
8
|
+
gem 'activerecord', require: false
|
9
|
+
gem 'responders', '~> 2.0', require: false
|
9
10
|
end
|
@@ -5,7 +5,7 @@ module PaginateResponder::Adapter
|
|
5
5
|
class KaminariAdapter < Base
|
6
6
|
|
7
7
|
def suitable?
|
8
|
-
|
8
|
+
resource.respond_to?(:page) and not resource.respond_to?(:paginate)
|
9
9
|
end
|
10
10
|
|
11
11
|
def paginate(opts)
|
@@ -27,4 +27,8 @@ module PaginateResponder::Adapter
|
|
27
27
|
resource.total_count if resource.respond_to? :total_count
|
28
28
|
end
|
29
29
|
end
|
30
|
+
|
31
|
+
if defined?(:Kaminari)
|
32
|
+
::PaginateResponder::Paginator.register KaminariAdapter
|
33
|
+
end
|
30
34
|
end
|
@@ -5,7 +5,7 @@ module PaginateResponder::Adapter
|
|
5
5
|
class PaginateAdapter < Base
|
6
6
|
|
7
7
|
def suitable?
|
8
|
-
|
8
|
+
resource.respond_to?(:paginate)
|
9
9
|
end
|
10
10
|
|
11
11
|
def paginate(opts)
|
@@ -24,4 +24,8 @@ module PaginateResponder::Adapter
|
|
24
24
|
resource.total_entries if resource.respond_to? :total_entries
|
25
25
|
end
|
26
26
|
end
|
27
|
+
|
28
|
+
if defined?(:WillPaginate)
|
29
|
+
::PaginateResponder::Paginator.register PaginateAdapter
|
30
|
+
end
|
27
31
|
end
|
@@ -11,7 +11,7 @@ module PaginateResponder
|
|
11
11
|
def find_adapter
|
12
12
|
return controller.pagination_adapter(resource) if controller.respond_to? :pagination_adapter
|
13
13
|
|
14
|
-
|
14
|
+
self.class.adapters.each do |adapter_class|
|
15
15
|
begin
|
16
16
|
adapter_class.new(resource).tap do |adapter|
|
17
17
|
return adapter if adapter.suitable?
|
@@ -82,5 +82,15 @@ module PaginateResponder
|
|
82
82
|
def total_count
|
83
83
|
@adapter.total_count
|
84
84
|
end
|
85
|
+
|
86
|
+
class << self
|
87
|
+
def adapters
|
88
|
+
@adapters ||= []
|
89
|
+
end
|
90
|
+
|
91
|
+
def register(adapter)
|
92
|
+
adapters << adapter
|
93
|
+
end
|
94
|
+
end
|
85
95
|
end
|
86
96
|
end
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paginate-responder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.2.beta0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Graichen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack-link_headers
|
@@ -152,6 +152,7 @@ files:
|
|
152
152
|
- gemfiles/Gemfile.rails-3-2
|
153
153
|
- gemfiles/Gemfile.rails-4-0
|
154
154
|
- gemfiles/Gemfile.rails-4-1
|
155
|
+
- gemfiles/Gemfile.rails-4-2
|
155
156
|
- gemfiles/Gemfile.rails-head
|
156
157
|
- lib/paginate-responder.rb
|
157
158
|
- lib/paginate-responder/adapter/base.rb
|
@@ -178,16 +179,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
178
179
|
version: '0'
|
179
180
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
180
181
|
requirements:
|
181
|
-
- - "
|
182
|
+
- - ">"
|
182
183
|
- !ruby/object:Gem::Version
|
183
|
-
version:
|
184
|
+
version: 1.3.1
|
184
185
|
requirements: []
|
185
186
|
rubyforge_project:
|
186
|
-
rubygems_version: 2.
|
187
|
+
rubygems_version: 2.4.8
|
187
188
|
signing_key:
|
188
189
|
specification_version: 4
|
189
190
|
summary: A Rails pagination responder with link header support.
|
190
191
|
test_files:
|
191
192
|
- test/paginate_responder_test.rb
|
192
193
|
- test/test_helper.rb
|
193
|
-
has_rdoc:
|