kaminari 0.11.0 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of kaminari might be problematic. Click here for more details.
- data/.gitignore +7 -0
- data/CHANGELOG +21 -0
- data/Gemfile +3 -0
- data/README.rdoc +33 -11
- data/Rakefile +3 -47
- data/kaminari.gemspec +27 -174
- data/lib/generators/kaminari/config_generator.rb +16 -0
- data/lib/generators/kaminari/templates/kaminari_config.rb +7 -0
- data/lib/kaminari.rb +0 -1
- data/lib/kaminari/config.rb +35 -0
- data/lib/kaminari/helpers/paginator.rb +6 -4
- data/lib/kaminari/helpers/tags.rb +1 -1
- data/lib/kaminari/models/active_record_relation_methods.rb +3 -1
- data/lib/kaminari/models/array_extension.rb +42 -0
- data/lib/kaminari/models/configuration_methods.rb +4 -4
- data/lib/kaminari/railtie.rb +2 -1
- data/lib/kaminari/version.rb +1 -1
- data/spec/config/config_spec.rb +43 -0
- data/spec/models/array_spec.rb +105 -0
- metadata +53 -259
- data/Gemfile.lock +0 -147
- data/VERSION +0 -1
@@ -6,10 +6,12 @@ module Kaminari
|
|
6
6
|
class Paginator < Tag
|
7
7
|
def initialize(template, options) #:nodoc:
|
8
8
|
@window_options = {}.tap do |h|
|
9
|
-
h[:window] = options.delete(:window) || options.delete(:inner_window) ||
|
10
|
-
outer_window = options.delete(:outer_window)
|
11
|
-
h[:left] = options.delete(:left) ||
|
12
|
-
h[:
|
9
|
+
h[:window] = options.delete(:window) || options.delete(:inner_window) || Kaminari.config.window
|
10
|
+
outer_window = options.delete(:outer_window) || Kaminari.config.outer_window
|
11
|
+
h[:left] = options.delete(:left) || Kaminari.config.left
|
12
|
+
h[:left] = outer_window if h[:left] == 0
|
13
|
+
h[:right] = options.delete(:right) || Kaminari.config.right
|
14
|
+
h[:right] = outer_window if h[:right] == 0
|
13
15
|
end
|
14
16
|
@template, @options = template, options
|
15
17
|
@options[:current_page] = PageProxy.new @window_options.merge(@options), @options[:current_page], nil
|
@@ -2,9 +2,11 @@ module Kaminari
|
|
2
2
|
module ActiveRecordRelationMethods
|
3
3
|
extend ActiveSupport::Concern
|
4
4
|
module InstanceMethods
|
5
|
+
# a workaround for AR 3.0.x that returns 0 for #count when page > 1
|
6
|
+
# if +limit_value+ is specified, load all the records and count them
|
5
7
|
if Rails.version < '3.1'
|
6
8
|
def count #:nodoc:
|
7
|
-
limit_value
|
9
|
+
limit_value ? length : super
|
8
10
|
end
|
9
11
|
end
|
10
12
|
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module Kaminari
|
2
|
+
# Kind of Array that can paginate
|
3
|
+
class PaginatableArray < Array
|
4
|
+
include Kaminari::ConfigurationMethods::ClassMethods
|
5
|
+
|
6
|
+
attr_internal_accessor :limit_value, :offset_value
|
7
|
+
|
8
|
+
def initialize(original_array, limit_val = default_per_page, offset_val = 0) #:nodoc:
|
9
|
+
@_original_array, @_limit_value, @_offset_value = original_array, limit_val, offset_val
|
10
|
+
super (original_array[offset_val, limit_val] || [])
|
11
|
+
end
|
12
|
+
|
13
|
+
# items at the specified "page"
|
14
|
+
def page(num = 1)
|
15
|
+
offset(limit_value * ([num.to_i, 1].max - 1))
|
16
|
+
end
|
17
|
+
|
18
|
+
# returns another chunk of the original array
|
19
|
+
def limit(num)
|
20
|
+
self.class.new @_original_array, num, offset_value
|
21
|
+
end
|
22
|
+
|
23
|
+
# total item numbers of the original array
|
24
|
+
def total_count
|
25
|
+
@_original_array.count
|
26
|
+
end
|
27
|
+
|
28
|
+
# returns another chunk of the original array
|
29
|
+
def offset(num)
|
30
|
+
arr = self.class.new @_original_array, limit_value, num
|
31
|
+
class << arr
|
32
|
+
include Kaminari::PageScopeMethods
|
33
|
+
end
|
34
|
+
arr
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
# Wrap an Array object to make it paginatable
|
39
|
+
def self.paginate_array(array)
|
40
|
+
PaginatableArray.new array
|
41
|
+
end
|
42
|
+
end
|
@@ -2,7 +2,7 @@ module Kaminari
|
|
2
2
|
module ConfigurationMethods
|
3
3
|
extend ActiveSupport::Concern
|
4
4
|
module ClassMethods
|
5
|
-
# Overrides the default per_page value per model
|
5
|
+
# Overrides the default +per_page+ value per model
|
6
6
|
# class Article < ActiveRecord::Base
|
7
7
|
# paginates_per 10
|
8
8
|
# end
|
@@ -10,10 +10,10 @@ module Kaminari
|
|
10
10
|
@_default_per_page = val
|
11
11
|
end
|
12
12
|
|
13
|
-
# This model's default per_page value
|
14
|
-
# returns
|
13
|
+
# This model's default +per_page+ value
|
14
|
+
# returns +default_per_page+ value unless explicitly overridden via <tt>paginates_per</tt>
|
15
15
|
def default_per_page
|
16
|
-
@_default_per_page || Kaminari
|
16
|
+
@_default_per_page || Kaminari.config.default_per_page
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
data/lib/kaminari/railtie.rb
CHANGED
@@ -2,13 +2,13 @@ require 'rails'
|
|
2
2
|
# ensure ORMs are loaded *before* initializing Kaminari
|
3
3
|
begin; require 'mongoid'; rescue LoadError; end
|
4
4
|
|
5
|
+
require File.join(File.dirname(__FILE__), 'config')
|
5
6
|
require File.join(File.dirname(__FILE__), 'helpers/action_view_extension')
|
6
7
|
require File.join(File.dirname(__FILE__), 'helpers/paginator')
|
7
8
|
require File.join(File.dirname(__FILE__), 'models/page_scope_methods')
|
8
9
|
require File.join(File.dirname(__FILE__), 'models/configuration_methods')
|
9
10
|
|
10
11
|
module Kaminari
|
11
|
-
DEFAULT_PER_PAGE = 25 unless defined? ::Kaminari::DEFAULT_PER_PAGE
|
12
12
|
class Railtie < ::Rails::Railtie #:nodoc:
|
13
13
|
initializer 'kaminari' do |app|
|
14
14
|
ActiveSupport.on_load(:active_record) do
|
@@ -20,6 +20,7 @@ module Kaminari
|
|
20
20
|
::Mongoid::Document.send :include, Kaminari::MongoidExtension::Document
|
21
21
|
::Mongoid::Criteria.send :include, Kaminari::MongoidExtension::Criteria
|
22
22
|
end
|
23
|
+
require File.join(File.dirname(__FILE__), 'models/array_extension')
|
23
24
|
ActiveSupport.on_load(:action_view) do
|
24
25
|
::ActionView::Base.send :include, Kaminari::ActionViewExtension
|
25
26
|
end
|
data/lib/kaminari/version.rb
CHANGED
@@ -0,0 +1,43 @@
|
|
1
|
+
require File.expand_path('../spec_helper', File.dirname(__FILE__))
|
2
|
+
|
3
|
+
describe Kaminari::Configuration do
|
4
|
+
subject { Kaminari.config }
|
5
|
+
describe 'default_per_page' do
|
6
|
+
context 'by default' do
|
7
|
+
its(:default_per_page) { should == 25 }
|
8
|
+
end
|
9
|
+
context 'configured via config block' do
|
10
|
+
before do
|
11
|
+
Kaminari.configure {|c| c.default_per_page = 17}
|
12
|
+
end
|
13
|
+
its(:default_per_page) { should == 17 }
|
14
|
+
after do
|
15
|
+
Kaminari.configure {|c| c.default_per_page = 25}
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
describe 'window' do
|
21
|
+
context 'by default' do
|
22
|
+
its(:window) { should == 4 }
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
describe 'outer_window' do
|
27
|
+
context 'by default' do
|
28
|
+
its(:outer_window) { should == 0 }
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
describe 'left' do
|
33
|
+
context 'by default' do
|
34
|
+
its(:left) { should == 0 }
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
describe 'right' do
|
39
|
+
context 'by default' do
|
40
|
+
its(:right) { should == 0 }
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,105 @@
|
|
1
|
+
require File.expand_path('../spec_helper', File.dirname(__FILE__))
|
2
|
+
|
3
|
+
describe Kaminari::PaginatableArray do
|
4
|
+
let(:array) { Kaminari::PaginatableArray.new((1..100).to_a) }
|
5
|
+
describe '#page' do
|
6
|
+
shared_examples_for 'the first page of array' do
|
7
|
+
it { should have(25).users }
|
8
|
+
its(:first) { should == 1 }
|
9
|
+
end
|
10
|
+
|
11
|
+
shared_examples_for 'blank array page' do
|
12
|
+
it { should have(0).items }
|
13
|
+
end
|
14
|
+
|
15
|
+
context 'page 1' do
|
16
|
+
subject { array.page 1 }
|
17
|
+
it_should_behave_like 'the first page of array'
|
18
|
+
end
|
19
|
+
|
20
|
+
context 'page 2' do
|
21
|
+
subject { array.page 2 }
|
22
|
+
it { should have(25).users }
|
23
|
+
its(:first) { should == 26 }
|
24
|
+
end
|
25
|
+
|
26
|
+
context 'page without an argument' do
|
27
|
+
subject { array.page }
|
28
|
+
it_should_behave_like 'the first page of array'
|
29
|
+
end
|
30
|
+
|
31
|
+
context 'page < 1' do
|
32
|
+
subject { array.page 0 }
|
33
|
+
it_should_behave_like 'the first page of array'
|
34
|
+
end
|
35
|
+
|
36
|
+
context 'page > max page' do
|
37
|
+
subject { array.page 5 }
|
38
|
+
it_should_behave_like 'blank array page'
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
describe '#per' do
|
43
|
+
context 'page 1 per 5' do
|
44
|
+
subject { array.page(1).per(5) }
|
45
|
+
it { should have(5).users }
|
46
|
+
its(:first) { should == 1 }
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
describe '#num_pages' do
|
51
|
+
context 'per 25 (default)' do
|
52
|
+
subject { array.page }
|
53
|
+
its(:num_pages) { should == 4 }
|
54
|
+
end
|
55
|
+
|
56
|
+
context 'per 7' do
|
57
|
+
subject { array.page(2).per(7) }
|
58
|
+
its(:num_pages) { should == 15 }
|
59
|
+
end
|
60
|
+
|
61
|
+
context 'per 65536' do
|
62
|
+
subject { array.page(50).per(65536) }
|
63
|
+
its(:num_pages) { should == 1 }
|
64
|
+
end
|
65
|
+
|
66
|
+
context 'per 0 (using default)' do
|
67
|
+
subject { array.page(50).per(0) }
|
68
|
+
its(:num_pages) { should == 4 }
|
69
|
+
end
|
70
|
+
|
71
|
+
context 'per -1 (using default)' do
|
72
|
+
subject { array.page(5).per(-1) }
|
73
|
+
its(:num_pages) { should == 4 }
|
74
|
+
end
|
75
|
+
|
76
|
+
context 'per "String value that can not be converted into Number" (using default)' do
|
77
|
+
subject { array.page(5).per('aho') }
|
78
|
+
its(:num_pages) { should == 4 }
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
describe '#current_page' do
|
83
|
+
context 'page 1' do
|
84
|
+
subject { array.page }
|
85
|
+
its(:current_page) { should == 1 }
|
86
|
+
end
|
87
|
+
|
88
|
+
context 'page 2' do
|
89
|
+
subject { array.page(2).per 3 }
|
90
|
+
its(:current_page) { should == 2 }
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
describe '#count' do
|
95
|
+
context 'page 1' do
|
96
|
+
subject { array.page }
|
97
|
+
its(:count) { should == 25 }
|
98
|
+
end
|
99
|
+
|
100
|
+
context 'page 2' do
|
101
|
+
subject { array.page 2 }
|
102
|
+
its(:count) { should == 25 }
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kaminari
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 47
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
8
|
+
- 12
|
9
9
|
- 0
|
10
|
-
version: 0.
|
10
|
+
version: 0.12.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Akira Matsuda
|
@@ -15,25 +15,12 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-04-
|
18
|
+
date: 2011-04-22 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
|
-
|
22
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
23
|
-
none: false
|
24
|
-
requirements:
|
25
|
-
- - ">="
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
hash: 3
|
28
|
-
segments:
|
29
|
-
- 0
|
30
|
-
version: "0"
|
31
|
-
version_requirements: *id001
|
32
|
-
name: kaminari
|
21
|
+
name: rails
|
33
22
|
prerelease: false
|
34
|
-
|
35
|
-
type: :development
|
36
|
-
requirement: &id002 !ruby/object:Gem::Requirement
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
37
24
|
none: false
|
38
25
|
requirements:
|
39
26
|
- - ">="
|
@@ -44,12 +31,12 @@ dependencies:
|
|
44
31
|
- 0
|
45
32
|
- 0
|
46
33
|
version: 3.0.0
|
47
|
-
|
48
|
-
|
49
|
-
prerelease: false
|
34
|
+
type: :runtime
|
35
|
+
version_requirements: *id001
|
50
36
|
- !ruby/object:Gem::Dependency
|
51
|
-
|
52
|
-
|
37
|
+
name: bundler
|
38
|
+
prerelease: false
|
39
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
53
40
|
none: false
|
54
41
|
requirements:
|
55
42
|
- - ">="
|
@@ -60,12 +47,12 @@ dependencies:
|
|
60
47
|
- 0
|
61
48
|
- 0
|
62
49
|
version: 1.0.0
|
63
|
-
version_requirements: *id003
|
64
|
-
name: bundler
|
65
|
-
prerelease: false
|
66
|
-
- !ruby/object:Gem::Dependency
|
67
50
|
type: :development
|
68
|
-
|
51
|
+
version_requirements: *id002
|
52
|
+
- !ruby/object:Gem::Dependency
|
53
|
+
name: sqlite3
|
54
|
+
prerelease: false
|
55
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
69
56
|
none: false
|
70
57
|
requirements:
|
71
58
|
- - ">="
|
@@ -74,12 +61,12 @@ dependencies:
|
|
74
61
|
segments:
|
75
62
|
- 0
|
76
63
|
version: "0"
|
77
|
-
version_requirements: *id004
|
78
|
-
name: sqlite3
|
79
|
-
prerelease: false
|
80
|
-
- !ruby/object:Gem::Dependency
|
81
64
|
type: :development
|
82
|
-
|
65
|
+
version_requirements: *id003
|
66
|
+
- !ruby/object:Gem::Dependency
|
67
|
+
name: mongoid
|
68
|
+
prerelease: false
|
69
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
83
70
|
none: false
|
84
71
|
requirements:
|
85
72
|
- - ">="
|
@@ -88,26 +75,12 @@ dependencies:
|
|
88
75
|
segments:
|
89
76
|
- 2
|
90
77
|
version: "2"
|
91
|
-
version_requirements: *id005
|
92
|
-
name: mongoid
|
93
|
-
prerelease: false
|
94
|
-
- !ruby/object:Gem::Dependency
|
95
78
|
type: :development
|
96
|
-
|
97
|
-
|
98
|
-
requirements:
|
99
|
-
- - ">="
|
100
|
-
- !ruby/object:Gem::Version
|
101
|
-
hash: 3
|
102
|
-
segments:
|
103
|
-
- 0
|
104
|
-
version: "0"
|
105
|
-
version_requirements: *id006
|
79
|
+
version_requirements: *id004
|
80
|
+
- !ruby/object:Gem::Dependency
|
106
81
|
name: rspec
|
107
82
|
prerelease: false
|
108
|
-
|
109
|
-
type: :development
|
110
|
-
requirement: &id007 !ruby/object:Gem::Requirement
|
83
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
111
84
|
none: false
|
112
85
|
requirements:
|
113
86
|
- - ">="
|
@@ -116,40 +89,12 @@ dependencies:
|
|
116
89
|
segments:
|
117
90
|
- 0
|
118
91
|
version: "0"
|
119
|
-
version_requirements: *id007
|
120
|
-
name: rspec-rails
|
121
|
-
prerelease: false
|
122
|
-
- !ruby/object:Gem::Dependency
|
123
92
|
type: :development
|
124
|
-
|
125
|
-
none: false
|
126
|
-
requirements:
|
127
|
-
- - ">="
|
128
|
-
- !ruby/object:Gem::Version
|
129
|
-
hash: 3
|
130
|
-
segments:
|
131
|
-
- 0
|
132
|
-
version: "0"
|
133
|
-
version_requirements: *id008
|
134
|
-
name: rr
|
135
|
-
prerelease: false
|
93
|
+
version_requirements: *id005
|
136
94
|
- !ruby/object:Gem::Dependency
|
137
|
-
|
138
|
-
requirement: &id009 !ruby/object:Gem::Requirement
|
139
|
-
none: false
|
140
|
-
requirements:
|
141
|
-
- - ">="
|
142
|
-
- !ruby/object:Gem::Version
|
143
|
-
hash: 3
|
144
|
-
segments:
|
145
|
-
- 0
|
146
|
-
version: "0"
|
147
|
-
version_requirements: *id009
|
148
|
-
name: steak
|
95
|
+
name: rspec-rails
|
149
96
|
prerelease: false
|
150
|
-
|
151
|
-
type: :development
|
152
|
-
requirement: &id010 !ruby/object:Gem::Requirement
|
97
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
153
98
|
none: false
|
154
99
|
requirements:
|
155
100
|
- - ">="
|
@@ -158,40 +103,12 @@ dependencies:
|
|
158
103
|
segments:
|
159
104
|
- 0
|
160
105
|
version: "0"
|
161
|
-
version_requirements: *id010
|
162
|
-
name: capybara
|
163
|
-
prerelease: false
|
164
|
-
- !ruby/object:Gem::Dependency
|
165
106
|
type: :development
|
166
|
-
|
167
|
-
none: false
|
168
|
-
requirements:
|
169
|
-
- - ">="
|
170
|
-
- !ruby/object:Gem::Version
|
171
|
-
hash: 3
|
172
|
-
segments:
|
173
|
-
- 0
|
174
|
-
version: "0"
|
175
|
-
version_requirements: *id011
|
176
|
-
name: database_cleaner
|
177
|
-
prerelease: false
|
107
|
+
version_requirements: *id006
|
178
108
|
- !ruby/object:Gem::Dependency
|
179
|
-
|
180
|
-
requirement: &id012 !ruby/object:Gem::Requirement
|
181
|
-
none: false
|
182
|
-
requirements:
|
183
|
-
- - ">="
|
184
|
-
- !ruby/object:Gem::Version
|
185
|
-
hash: 3
|
186
|
-
segments:
|
187
|
-
- 0
|
188
|
-
version: "0"
|
189
|
-
version_requirements: *id012
|
190
|
-
name: rcov
|
109
|
+
name: rr
|
191
110
|
prerelease: false
|
192
|
-
|
193
|
-
type: :development
|
194
|
-
requirement: &id013 !ruby/object:Gem::Requirement
|
111
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
195
112
|
none: false
|
196
113
|
requirements:
|
197
114
|
- - ">="
|
@@ -200,72 +117,12 @@ dependencies:
|
|
200
117
|
segments:
|
201
118
|
- 0
|
202
119
|
version: "0"
|
203
|
-
version_requirements: *id013
|
204
|
-
name: jeweler
|
205
|
-
prerelease: false
|
206
|
-
- !ruby/object:Gem::Dependency
|
207
|
-
type: :development
|
208
|
-
requirement: &id014 !ruby/object:Gem::Requirement
|
209
|
-
none: false
|
210
|
-
requirements:
|
211
|
-
- - ">="
|
212
|
-
- !ruby/object:Gem::Version
|
213
|
-
hash: 7
|
214
|
-
segments:
|
215
|
-
- 3
|
216
|
-
- 0
|
217
|
-
- 0
|
218
|
-
version: 3.0.0
|
219
|
-
version_requirements: *id014
|
220
|
-
name: rails
|
221
|
-
prerelease: false
|
222
|
-
- !ruby/object:Gem::Dependency
|
223
120
|
type: :development
|
224
|
-
|
225
|
-
none: false
|
226
|
-
requirements:
|
227
|
-
- - ">="
|
228
|
-
- !ruby/object:Gem::Version
|
229
|
-
hash: 23
|
230
|
-
segments:
|
231
|
-
- 1
|
232
|
-
- 0
|
233
|
-
- 0
|
234
|
-
version: 1.0.0
|
235
|
-
version_requirements: *id015
|
236
|
-
name: bundler
|
237
|
-
prerelease: false
|
238
|
-
- !ruby/object:Gem::Dependency
|
239
|
-
type: :development
|
240
|
-
requirement: &id016 !ruby/object:Gem::Requirement
|
241
|
-
none: false
|
242
|
-
requirements:
|
243
|
-
- - ">="
|
244
|
-
- !ruby/object:Gem::Version
|
245
|
-
hash: 3
|
246
|
-
segments:
|
247
|
-
- 0
|
248
|
-
version: "0"
|
249
|
-
version_requirements: *id016
|
250
|
-
name: sqlite3
|
251
|
-
prerelease: false
|
121
|
+
version_requirements: *id007
|
252
122
|
- !ruby/object:Gem::Dependency
|
253
|
-
|
254
|
-
requirement: &id017 !ruby/object:Gem::Requirement
|
255
|
-
none: false
|
256
|
-
requirements:
|
257
|
-
- - ">="
|
258
|
-
- !ruby/object:Gem::Version
|
259
|
-
hash: 7
|
260
|
-
segments:
|
261
|
-
- 2
|
262
|
-
version: "2"
|
263
|
-
version_requirements: *id017
|
264
|
-
name: mongoid
|
123
|
+
name: steak
|
265
124
|
prerelease: false
|
266
|
-
|
267
|
-
type: :development
|
268
|
-
requirement: &id018 !ruby/object:Gem::Requirement
|
125
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
269
126
|
none: false
|
270
127
|
requirements:
|
271
128
|
- - ">="
|
@@ -274,40 +131,12 @@ dependencies:
|
|
274
131
|
segments:
|
275
132
|
- 0
|
276
133
|
version: "0"
|
277
|
-
version_requirements: *id018
|
278
|
-
name: rspec
|
279
|
-
prerelease: false
|
280
|
-
- !ruby/object:Gem::Dependency
|
281
134
|
type: :development
|
282
|
-
|
283
|
-
none: false
|
284
|
-
requirements:
|
285
|
-
- - ">="
|
286
|
-
- !ruby/object:Gem::Version
|
287
|
-
hash: 3
|
288
|
-
segments:
|
289
|
-
- 0
|
290
|
-
version: "0"
|
291
|
-
version_requirements: *id019
|
292
|
-
name: rspec-rails
|
293
|
-
prerelease: false
|
135
|
+
version_requirements: *id008
|
294
136
|
- !ruby/object:Gem::Dependency
|
295
|
-
|
296
|
-
requirement: &id020 !ruby/object:Gem::Requirement
|
297
|
-
none: false
|
298
|
-
requirements:
|
299
|
-
- - ">="
|
300
|
-
- !ruby/object:Gem::Version
|
301
|
-
hash: 3
|
302
|
-
segments:
|
303
|
-
- 0
|
304
|
-
version: "0"
|
305
|
-
version_requirements: *id020
|
306
|
-
name: rr
|
137
|
+
name: capybara
|
307
138
|
prerelease: false
|
308
|
-
|
309
|
-
type: :development
|
310
|
-
requirement: &id021 !ruby/object:Gem::Requirement
|
139
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
311
140
|
none: false
|
312
141
|
requirements:
|
313
142
|
- - ">="
|
@@ -316,40 +145,12 @@ dependencies:
|
|
316
145
|
segments:
|
317
146
|
- 0
|
318
147
|
version: "0"
|
319
|
-
version_requirements: *id021
|
320
|
-
name: steak
|
321
|
-
prerelease: false
|
322
|
-
- !ruby/object:Gem::Dependency
|
323
148
|
type: :development
|
324
|
-
|
325
|
-
none: false
|
326
|
-
requirements:
|
327
|
-
- - ">="
|
328
|
-
- !ruby/object:Gem::Version
|
329
|
-
hash: 3
|
330
|
-
segments:
|
331
|
-
- 0
|
332
|
-
version: "0"
|
333
|
-
version_requirements: *id022
|
334
|
-
name: capybara
|
335
|
-
prerelease: false
|
149
|
+
version_requirements: *id009
|
336
150
|
- !ruby/object:Gem::Dependency
|
337
|
-
type: :development
|
338
|
-
requirement: &id023 !ruby/object:Gem::Requirement
|
339
|
-
none: false
|
340
|
-
requirements:
|
341
|
-
- - ">="
|
342
|
-
- !ruby/object:Gem::Version
|
343
|
-
hash: 3
|
344
|
-
segments:
|
345
|
-
- 0
|
346
|
-
version: "0"
|
347
|
-
version_requirements: *id023
|
348
151
|
name: database_cleaner
|
349
152
|
prerelease: false
|
350
|
-
|
351
|
-
type: :development
|
352
|
-
requirement: &id024 !ruby/object:Gem::Requirement
|
153
|
+
requirement: &id010 !ruby/object:Gem::Requirement
|
353
154
|
none: false
|
354
155
|
requirements:
|
355
156
|
- - ">="
|
@@ -358,43 +159,27 @@ dependencies:
|
|
358
159
|
segments:
|
359
160
|
- 0
|
360
161
|
version: "0"
|
361
|
-
version_requirements: *id024
|
362
|
-
name: rcov
|
363
|
-
prerelease: false
|
364
|
-
- !ruby/object:Gem::Dependency
|
365
162
|
type: :development
|
366
|
-
|
367
|
-
none: false
|
368
|
-
requirements:
|
369
|
-
- - ">="
|
370
|
-
- !ruby/object:Gem::Version
|
371
|
-
hash: 3
|
372
|
-
segments:
|
373
|
-
- 0
|
374
|
-
version: "0"
|
375
|
-
version_requirements: *id025
|
376
|
-
name: jeweler
|
377
|
-
prerelease: false
|
163
|
+
version_requirements: *id010
|
378
164
|
description: Kaminari is a Scope & Engine based, clean, powerful, customizable and sophisticated paginator for Rails 3
|
379
|
-
email:
|
165
|
+
email:
|
166
|
+
- ronnie@dio.jp
|
380
167
|
executables: []
|
381
168
|
|
382
169
|
extensions: []
|
383
170
|
|
384
171
|
extra_rdoc_files:
|
385
|
-
- LICENSE.txt
|
386
172
|
- README.rdoc
|
387
173
|
files:
|
388
174
|
- .document
|
389
175
|
- .gemtest
|
176
|
+
- .gitignore
|
390
177
|
- .rspec
|
391
178
|
- CHANGELOG
|
392
179
|
- Gemfile
|
393
|
-
- Gemfile.lock
|
394
180
|
- LICENSE.txt
|
395
181
|
- README.rdoc
|
396
182
|
- Rakefile
|
397
|
-
- VERSION
|
398
183
|
- app/views/kaminari/_first_page.html.erb
|
399
184
|
- app/views/kaminari/_first_page.html.haml
|
400
185
|
- app/views/kaminari/_gap.html.erb
|
@@ -411,14 +196,18 @@ files:
|
|
411
196
|
- app/views/kaminari/_prev_page.html.haml
|
412
197
|
- config/locales/kaminari.yml
|
413
198
|
- kaminari.gemspec
|
199
|
+
- lib/generators/kaminari/config_generator.rb
|
200
|
+
- lib/generators/kaminari/templates/kaminari_config.rb
|
414
201
|
- lib/generators/kaminari/views_generator.rb
|
415
202
|
- lib/kaminari.rb
|
203
|
+
- lib/kaminari/config.rb
|
416
204
|
- lib/kaminari/engine.rb
|
417
205
|
- lib/kaminari/helpers/action_view_extension.rb
|
418
206
|
- lib/kaminari/helpers/paginator.rb
|
419
207
|
- lib/kaminari/helpers/tags.rb
|
420
208
|
- lib/kaminari/models/active_record_extension.rb
|
421
209
|
- lib/kaminari/models/active_record_relation_methods.rb
|
210
|
+
- lib/kaminari/models/array_extension.rb
|
422
211
|
- lib/kaminari/models/configuration_methods.rb
|
423
212
|
- lib/kaminari/models/mongoid_criteria_methods.rb
|
424
213
|
- lib/kaminari/models/mongoid_extension.rb
|
@@ -429,17 +218,19 @@ files:
|
|
429
218
|
- spec/acceptance/support/helpers.rb
|
430
219
|
- spec/acceptance/support/paths.rb
|
431
220
|
- spec/acceptance/users_spec.rb
|
221
|
+
- spec/config/config_spec.rb
|
432
222
|
- spec/fake_app.rb
|
433
223
|
- spec/helpers/helpers_spec.rb
|
434
224
|
- spec/helpers/tags_spec.rb
|
435
225
|
- spec/models/active_record_relation_methods_spec.rb
|
226
|
+
- spec/models/array_spec.rb
|
436
227
|
- spec/models/default_per_page_spec.rb
|
437
228
|
- spec/models/mongoid_spec.rb
|
438
229
|
- spec/models/scopes_spec.rb
|
439
230
|
- spec/spec_helper.rb
|
440
231
|
- spec/support/database_cleaner.rb
|
441
232
|
- spec/support/matchers.rb
|
442
|
-
homepage:
|
233
|
+
homepage: https://github.com/amatsuda/kaminari
|
443
234
|
licenses:
|
444
235
|
- MIT
|
445
236
|
post_install_message:
|
@@ -467,7 +258,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
467
258
|
version: "0"
|
468
259
|
requirements: []
|
469
260
|
|
470
|
-
rubyforge_project:
|
261
|
+
rubyforge_project: kaminari
|
471
262
|
rubygems_version: 1.7.2
|
472
263
|
signing_key:
|
473
264
|
specification_version: 3
|
@@ -477,13 +268,16 @@ test_files:
|
|
477
268
|
- spec/acceptance/support/helpers.rb
|
478
269
|
- spec/acceptance/support/paths.rb
|
479
270
|
- spec/acceptance/users_spec.rb
|
271
|
+
- spec/config/config_spec.rb
|
480
272
|
- spec/fake_app.rb
|
481
273
|
- spec/helpers/helpers_spec.rb
|
482
274
|
- spec/helpers/tags_spec.rb
|
483
275
|
- spec/models/active_record_relation_methods_spec.rb
|
276
|
+
- spec/models/array_spec.rb
|
484
277
|
- spec/models/default_per_page_spec.rb
|
485
278
|
- spec/models/mongoid_spec.rb
|
486
279
|
- spec/models/scopes_spec.rb
|
487
280
|
- spec/spec_helper.rb
|
488
281
|
- spec/support/database_cleaner.rb
|
489
282
|
- spec/support/matchers.rb
|
283
|
+
has_rdoc:
|