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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 23dde55e255453a7856dbe0328fa9d7eadf1b809
4
- data.tar.gz: 17b0bb3fa860e2c3c556f4d2e718fd9fdf857d45
3
+ metadata.gz: baf1e4bd33df9ae0d0b8dbb325e6b0be1c6387ef
4
+ data.tar.gz: 9b2a70c169863d0c43dcc702fb0221fb696b3d1a
5
5
  SHA512:
6
- metadata.gz: fa90c8c8394ed5e546148d19e7c930955298a9a6733507e62e767ccfbb0b80618d1881c9d9758f2c2378b3da19d7044398b9745bbc77228f289f86f0250d03df
7
- data.tar.gz: 3c17fa9b40e8e3a5ef52a724736fc61c4765d38f73e1925939f06b6199ba1efdedc7426672c59d8f2fc86c07ca7e0220bc99a37930bf92d1179af51f8b689c98
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', :require => false
8
- gem 'activerecord', :require => false
7
+ gem 'actionpack', require: false
8
+ gem 'activerecord', require: false
9
+ gem 'responders', '~> 2.0', require: false
9
10
  end
@@ -0,0 +1,8 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in acfs.gemspec
4
+ gemspec path: '../'
5
+
6
+ gem 'actionpack', '~> 4.2.0'
7
+ gem 'activerecord', '~> 4.2.0'
8
+ gem 'responders', '~> 2.0'
@@ -5,7 +5,7 @@ module PaginateResponder::Adapter
5
5
  class KaminariAdapter < Base
6
6
 
7
7
  def suitable?
8
- defined?(:Kaminari) and resource.respond_to?(:page) and not resource.respond_to?(:paginate)
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
- defined?(:WillPaginate) and resource.respond_to?(:paginate)
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
- Adapter::Base.subclasses.each do |adapter_class|
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
@@ -2,8 +2,8 @@ module PaginateResponder
2
2
  module VERSION
3
3
  MAJOR = 1
4
4
  MINOR = 4
5
- PATCH = 1
6
- STAGE = nil
5
+ PATCH = 2
6
+ STAGE = :beta0
7
7
 
8
8
  def self.to_s
9
9
  [MAJOR, MINOR, PATCH, STAGE].reject(&:nil?).join '.'
data/test/test_helper.rb CHANGED
@@ -9,6 +9,12 @@ ENV['RAILS_ENV'] = 'test'
9
9
  require 'active_support'
10
10
  require 'action_controller'
11
11
  require 'active_record'
12
+
13
+ begin
14
+ require 'responders'
15
+ rescue LoadError
16
+ end
17
+
12
18
  require 'minitest/reporters'
13
19
  MiniTest::Reporters.use!
14
20
 
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.1
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: 2014-04-30 00:00:00.000000000 Z
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: '0'
184
+ version: 1.3.1
184
185
  requirements: []
185
186
  rubyforge_project:
186
- rubygems_version: 2.2.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: