paginate 3.0.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/.travis.yml +9 -7
- data/README.md +1 -1
- data/Rakefile +0 -9
- data/gemfiles/{rails3.gemfile → rails_3_2.gemfile} +1 -1
- data/gemfiles/rails_4_0.gemfile +4 -0
- data/gemfiles/rails_4_1.gemfile +4 -0
- data/gemfiles/rails_4_2.gemfile +4 -0
- data/lib/paginate.rb +1 -22
- data/lib/paginate/base.rb +1 -1
- data/lib/paginate/compat.rb +22 -0
- data/lib/paginate/configuration.rb +21 -0
- data/lib/paginate/helper.rb +5 -5
- data/lib/paginate/renderer.rb +1 -1
- data/lib/paginate/version.rb +1 -1
- data/paginate.gemspec +3 -5
- data/spec/paginate/action_view_spec.rb +1 -1
- data/spec/paginate/activerecord_spec.rb +1 -1
- data/spec/paginate/base_spec.rb +10 -10
- data/spec/paginate/{config_spec.rb → configuration_spec.rb} +7 -11
- data/spec/paginate/renderer/list_spec.rb +7 -7
- data/spec/paginate/renderer/more_spec.rb +1 -1
- data/spec/spec_helper.rb +6 -0
- metadata +49 -30
- data/Gemfile.lock +0 -127
- data/gemfiles/rails3.gemfile.lock +0 -132
- data/lib/paginate/config.rb +0 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03f37aff82921acd75293db5c6e31f55dfcf0fe8
|
4
|
+
data.tar.gz: edcaff0207bd59c413e2177ebcfd5b3a2068a8c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5fbd7ded2961a3333ad16ab5a65e05cb14b6c3c6c3cc9b10c9940fa699674c51348b7f3dafb0d0557ec239cd3bcc1fc72c1ac809588ec8a9803f27940aabd008
|
7
|
+
data.tar.gz: 5156b0824131b5f77f3a53a06feb288fe902a2080b60d7f94cd5950a021512337bf658edaf6540f20637df47b04e2e952cf0fb50babb4d9e64e3b00205bf1260
|
data/.gitignore
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
pkg
|
1
|
+
pkg
|
2
|
+
*.lock
|
data/.travis.yml
CHANGED
@@ -1,14 +1,16 @@
|
|
1
|
+
sudo: false
|
2
|
+
cache: bundler
|
1
3
|
language: ruby
|
2
4
|
rvm:
|
3
|
-
- 2.0
|
4
|
-
- 1
|
5
|
+
- '2.0'
|
6
|
+
- '2.1'
|
7
|
+
- '2.2'
|
5
8
|
|
6
9
|
gemfile:
|
7
|
-
- gemfiles/
|
10
|
+
- gemfiles/rails_3_2.gemfile
|
11
|
+
- gemfiles/rails_4_0.gemfile
|
12
|
+
- gemfiles/rails_4_1.gemfile
|
13
|
+
- gemfiles/rails_4_2.gemfile
|
8
14
|
- Gemfile
|
9
15
|
|
10
16
|
script: "bundle exec rspec"
|
11
|
-
|
12
|
-
notifications:
|
13
|
-
email:
|
14
|
-
- fnando.vieira@gmail.com
|
data/README.md
CHANGED
@@ -117,7 +117,7 @@ module Paginate
|
|
117
117
|
end
|
118
118
|
```
|
119
119
|
|
120
|
-
You can specify the default renderer by setting the `Pagination
|
120
|
+
You can specify the default renderer by setting the `Pagination.configuration.renderer` option.
|
121
121
|
|
122
122
|
```ruby
|
123
123
|
Paginate.configure do |config|
|
data/Rakefile
CHANGED
@@ -3,12 +3,3 @@ Bundler::GemHelper.install_tasks
|
|
3
3
|
|
4
4
|
require "rspec/core/rake_task"
|
5
5
|
RSpec::Core::RakeTask.new
|
6
|
-
|
7
|
-
desc "Run specs against all gemfiles"
|
8
|
-
task "spec:all" do
|
9
|
-
%w[Gemfile gemfiles/rails3.gemfile].each do |gemfile|
|
10
|
-
ENV["BUNDLE_GEMFILE"] = gemfile
|
11
|
-
Rake::Task["spec"].reenable
|
12
|
-
Rake::Task["spec"].invoke
|
13
|
-
end
|
14
|
-
end
|
data/lib/paginate.rb
CHANGED
@@ -1,23 +1,2 @@
|
|
1
|
-
require "
|
2
|
-
require "active_record"
|
3
|
-
require "paginate/base"
|
4
|
-
require "paginate/config"
|
5
|
-
require "paginate/helper"
|
6
|
-
require "paginate/renderer"
|
7
|
-
require "paginate/renderer/list"
|
8
|
-
require "paginate/renderer/more"
|
9
|
-
require "paginate/extension"
|
1
|
+
require "paginate/compat"
|
10
2
|
require "paginate/active_record"
|
11
|
-
require "paginate/action_controller"
|
12
|
-
|
13
|
-
module Paginate
|
14
|
-
def self.configure(&block)
|
15
|
-
yield Config
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
Paginate.configure do |config|
|
20
|
-
config.param_name = :page
|
21
|
-
config.size = 10
|
22
|
-
config.renderer = Paginate::Renderer::List
|
23
|
-
end
|
data/lib/paginate/base.rb
CHANGED
@@ -0,0 +1,22 @@
|
|
1
|
+
require "i18n"
|
2
|
+
require "active_record"
|
3
|
+
require "paginate/base"
|
4
|
+
require "paginate/configuration"
|
5
|
+
require "paginate/helper"
|
6
|
+
require "paginate/renderer"
|
7
|
+
require "paginate/renderer/list"
|
8
|
+
require "paginate/renderer/more"
|
9
|
+
require "paginate/extension"
|
10
|
+
require "paginate/action_controller"
|
11
|
+
|
12
|
+
module Paginate
|
13
|
+
class << self
|
14
|
+
attr_accessor :configuration
|
15
|
+
end
|
16
|
+
|
17
|
+
self.configuration = Configuration.new
|
18
|
+
|
19
|
+
def self.configure(&block)
|
20
|
+
yield configuration
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Paginate
|
2
|
+
class Configuration
|
3
|
+
attr_accessor :size
|
4
|
+
attr_accessor :param_name
|
5
|
+
attr_accessor :renderer
|
6
|
+
|
7
|
+
def initialize
|
8
|
+
@param_name = :page
|
9
|
+
@size = 10
|
10
|
+
@renderer = Renderer::List
|
11
|
+
end
|
12
|
+
|
13
|
+
def to_hash
|
14
|
+
{
|
15
|
+
size: size,
|
16
|
+
param_name: param_name,
|
17
|
+
renderer: renderer
|
18
|
+
}
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/lib/paginate/helper.rb
CHANGED
@@ -10,8 +10,8 @@ module Paginate
|
|
10
10
|
#
|
11
11
|
# * <tt>:url</tt>: the URL which page numbers will be appended to. Can be proc or string.
|
12
12
|
# * <tt>:id</tt>: the HTML id that will identify the pagination block.
|
13
|
-
# * <tt>:size</tt>: the page size. When not specified will default to <tt>Paginate
|
14
|
-
# * <tt>:param_name</tt>: the page param name. When not specified will default to <tt>Paginate
|
13
|
+
# * <tt>:size</tt>: the page size. When not specified will default to <tt>Paginate.configuration.size</tt>.
|
14
|
+
# * <tt>:param_name</tt>: the page param name. When not specified will default to <tt>Paginate.configuration.param_name</tt>.
|
15
15
|
# * <tt>:renderer</tt>: A class that will be used to render the pagination. When not specified will default to <tt>Paginate::Renderer::List</tt>.
|
16
16
|
#
|
17
17
|
# <%= paginate @posts, proc {|page| posts_path(page) }
|
@@ -24,13 +24,13 @@ module Paginate
|
|
24
24
|
|
25
25
|
param_name = [
|
26
26
|
options[:param_name],
|
27
|
-
Paginate
|
27
|
+
Paginate.configuration.param_name,
|
28
28
|
:page
|
29
29
|
].compact.first
|
30
30
|
|
31
31
|
renderer = [
|
32
32
|
options[:renderer],
|
33
|
-
Paginate
|
33
|
+
Paginate.configuration.renderer,
|
34
34
|
Paginate::Renderer::List
|
35
35
|
].compact.first
|
36
36
|
|
@@ -59,7 +59,7 @@ module Paginate
|
|
59
59
|
def render(*args, &block)
|
60
60
|
options = args.extract_options!
|
61
61
|
paginated = options.delete(:paginate)
|
62
|
-
size = options.delete(:size) { Paginate
|
62
|
+
size = options.delete(:size) { Paginate.configuration.size }
|
63
63
|
|
64
64
|
return super(*[*args, options], &block) unless paginated
|
65
65
|
collection = options.delete(:collection) { args.shift }
|
data/lib/paginate/renderer.rb
CHANGED
@@ -14,7 +14,7 @@ module Paginate
|
|
14
14
|
|
15
15
|
def initialize(view_context, options)
|
16
16
|
@view_context = view_context
|
17
|
-
@options = options.reverse_merge(Paginate
|
17
|
+
@options = options.reverse_merge(Paginate.configuration.to_hash)
|
18
18
|
@processor = Paginate::Base.new(nil, options)
|
19
19
|
end
|
20
20
|
|
data/lib/paginate/version.rb
CHANGED
data/paginate.gemspec
CHANGED
@@ -1,6 +1,4 @@
|
|
1
|
-
|
2
|
-
$:.push File.expand_path("../lib", __FILE__)
|
3
|
-
require "paginate/version"
|
1
|
+
require "./lib/paginate/version"
|
4
2
|
|
5
3
|
Gem::Specification.new do |s|
|
6
4
|
s.name = "paginate"
|
@@ -20,7 +18,7 @@ Gem::Specification.new do |s|
|
|
20
18
|
s.add_development_dependency "nokogiri"
|
21
19
|
s.add_development_dependency "test_notifier"
|
22
20
|
s.add_development_dependency "sqlite3-ruby"
|
23
|
-
s.add_development_dependency "rails"
|
24
|
-
s.add_development_dependency "rspec"
|
21
|
+
s.add_development_dependency "rails"
|
22
|
+
s.add_development_dependency "rspec"
|
25
23
|
s.add_development_dependency "pry-meta"
|
26
24
|
end
|
@@ -15,7 +15,7 @@ describe "ActionView support" do
|
|
15
15
|
@view.lookup_context.prefixes << "application"
|
16
16
|
@view.controller = @controller
|
17
17
|
@view.extend(Paginate::Helper)
|
18
|
-
@view.
|
18
|
+
allow(@view).to receive_messages request: @request
|
19
19
|
|
20
20
|
@helper = Object.new
|
21
21
|
@helper.extend(Paginate::Helper)
|
data/spec/paginate/base_spec.rb
CHANGED
@@ -20,22 +20,22 @@ describe Paginate::Base do
|
|
20
20
|
end
|
21
21
|
|
22
22
|
it "returns limit from configuration" do
|
23
|
-
Paginate
|
23
|
+
Paginate.configuration.size = 25
|
24
24
|
expect(Paginate::Base.new(scope).limit).to eql(26)
|
25
25
|
end
|
26
26
|
|
27
27
|
it "returns limit from options" do
|
28
|
-
Paginate
|
28
|
+
Paginate.configuration.size = 25
|
29
29
|
expect(Paginate::Base.new(scope, size: 13).limit).to eql(14)
|
30
30
|
end
|
31
31
|
|
32
32
|
it "returns default limit" do
|
33
|
-
Paginate
|
33
|
+
Paginate.configuration.size = nil
|
34
34
|
expect(Paginate::Base.new(scope).limit).to eql(11)
|
35
35
|
end
|
36
36
|
|
37
37
|
it "returns offset from configuration" do
|
38
|
-
Paginate
|
38
|
+
Paginate.configuration.size = 15
|
39
39
|
expect(Paginate::Base.new(scope, page: 2).offset).to eql(15)
|
40
40
|
end
|
41
41
|
|
@@ -51,20 +51,20 @@ describe Paginate::Base do
|
|
51
51
|
end
|
52
52
|
|
53
53
|
specify {
|
54
|
-
Paginate::Base.new(scope, page: 1, size: 5, collection: Array.new(6))
|
55
|
-
.
|
54
|
+
expect(Paginate::Base.new(scope, page: 1, size: 5, collection: Array.new(6)))
|
55
|
+
.to have_next_page
|
56
56
|
}
|
57
57
|
|
58
58
|
specify {
|
59
|
-
Paginate::Base.new(scope, page: 1, size: 5, collection: Array.new(5))
|
60
|
-
.
|
59
|
+
expect(Paginate::Base.new(scope, page: 1, size: 5, collection: Array.new(5)))
|
60
|
+
.not_to have_next_page
|
61
61
|
}
|
62
62
|
|
63
63
|
specify {
|
64
|
-
Paginate::Base.new(scope, page: 2).
|
64
|
+
expect(Paginate::Base.new(scope, page: 2)).to have_previous_page
|
65
65
|
}
|
66
66
|
|
67
67
|
specify {
|
68
|
-
Paginate::Base.new(scope, page: 1).
|
68
|
+
expect(Paginate::Base.new(scope, page: 1)).not_to have_previous_page
|
69
69
|
}
|
70
70
|
end
|
@@ -1,14 +1,10 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
|
-
describe Paginate::
|
3
|
+
describe Paginate::Configuration do
|
4
4
|
context "sets default configuration" do
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
it { expect(Paginate::Config.param_name).to eql(:page) }
|
10
|
-
it { expect(Paginate::Config.renderer).to eql(Paginate::Renderer::List) }
|
11
|
-
it { expect(Paginate::Config.size).to eql(10) }
|
5
|
+
it { expect(Paginate.configuration.param_name).to eql(:page) }
|
6
|
+
it { expect(Paginate.configuration.renderer).to eql(Paginate::Renderer::List) }
|
7
|
+
it { expect(Paginate.configuration.size).to eql(10) }
|
12
8
|
end
|
13
9
|
|
14
10
|
it "yields configuration class" do
|
@@ -17,8 +13,8 @@ describe Paginate::Config do
|
|
17
13
|
config.size = 50
|
18
14
|
end
|
19
15
|
|
20
|
-
expect(Paginate
|
21
|
-
expect(Paginate
|
16
|
+
expect(Paginate.configuration.param_name).to eql(:p)
|
17
|
+
expect(Paginate.configuration.size).to eql(50)
|
22
18
|
end
|
23
19
|
|
24
20
|
it "returns configuration as hash" do
|
@@ -34,6 +30,6 @@ describe Paginate::Config do
|
|
34
30
|
renderer: Paginate::Renderer::List
|
35
31
|
}
|
36
32
|
|
37
|
-
expect(Paginate
|
33
|
+
expect(Paginate.configuration.to_hash).to eql(options)
|
38
34
|
end
|
39
35
|
end
|
@@ -23,7 +23,7 @@ describe Paginate::Renderer::List do
|
|
23
23
|
it { expect(@renderer.page_label).to eql(I18n.t("paginate.page", page: 1)) }
|
24
24
|
|
25
25
|
it "displays current page" do
|
26
|
-
@renderer.processor.
|
26
|
+
allow(@renderer.processor).to receive_messages page: 1234
|
27
27
|
|
28
28
|
html = Nokogiri::HTML(@renderer.render)
|
29
29
|
span = html.css("li.page > span").first
|
@@ -34,7 +34,7 @@ describe Paginate::Renderer::List do
|
|
34
34
|
|
35
35
|
it "translates strings" do
|
36
36
|
I18n.locale = "pt-BR"
|
37
|
-
@renderer.processor.
|
37
|
+
allow(@renderer.processor).to receive_messages page: 10
|
38
38
|
|
39
39
|
html = Nokogiri::HTML(@renderer.render)
|
40
40
|
|
@@ -44,7 +44,7 @@ describe Paginate::Renderer::List do
|
|
44
44
|
end
|
45
45
|
|
46
46
|
it "displays previous page link" do
|
47
|
-
@renderer.processor.
|
47
|
+
allow(@renderer.processor).to receive_messages page: 2
|
48
48
|
|
49
49
|
html = Nokogiri::HTML(@renderer.render)
|
50
50
|
link = html.css("li.previous-page > a").first
|
@@ -55,7 +55,7 @@ describe Paginate::Renderer::List do
|
|
55
55
|
end
|
56
56
|
|
57
57
|
it "displays next page link" do
|
58
|
-
@renderer.processor.
|
58
|
+
allow(@renderer.processor).to receive_messages page: 1
|
59
59
|
|
60
60
|
html = Nokogiri::HTML(@renderer.render)
|
61
61
|
link = html.css("li.next-page > a").first
|
@@ -74,7 +74,7 @@ describe Paginate::Renderer::List do
|
|
74
74
|
|
75
75
|
context "when have no items" do
|
76
76
|
it "adds .disabled class to the list" do
|
77
|
-
@renderer.processor.
|
77
|
+
allow(@renderer.processor).to receive_messages next_page?: false, previous_page?: false
|
78
78
|
|
79
79
|
html = Nokogiri::HTML(@renderer.render)
|
80
80
|
expect(html.css("ul.paginate.disabled").first).to be
|
@@ -83,7 +83,7 @@ describe Paginate::Renderer::List do
|
|
83
83
|
|
84
84
|
context "when have no next page" do
|
85
85
|
it "disables the element" do
|
86
|
-
@renderer.processor.
|
86
|
+
allow(@renderer.processor).to receive :next_page?
|
87
87
|
|
88
88
|
html = Nokogiri::HTML(@renderer.render)
|
89
89
|
link = html.css("li.next-page > a").first
|
@@ -97,7 +97,7 @@ describe Paginate::Renderer::List do
|
|
97
97
|
|
98
98
|
context "when no previous page" do
|
99
99
|
it "disables the element" do
|
100
|
-
@renderer.processor.
|
100
|
+
allow(@renderer.processor).to receive :previous_page?
|
101
101
|
|
102
102
|
html = Nokogiri::HTML(@renderer.render)
|
103
103
|
link = html.css("li.previous-page > a").first
|
data/spec/spec_helper.rb
CHANGED
@@ -24,3 +24,9 @@ load "spec/schema.rb"
|
|
24
24
|
|
25
25
|
Dir[File.dirname(__FILE__) + "/support/**/*.rb"].each {|file| require file}
|
26
26
|
I18n.load_path << File.dirname(__FILE__) + "/support/translations.yml"
|
27
|
+
|
28
|
+
RSpec.configure do |config|
|
29
|
+
config.before(:each) do
|
30
|
+
Paginate.configuration = Paginate::Configuration.new
|
31
|
+
end
|
32
|
+
end
|
metadata
CHANGED
@@ -1,97 +1,97 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paginate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nando Vieira
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: test_notifier
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: sqlite3-ruby
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rails
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rspec
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: pry-meta
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
description: Paginate collections using SIZE+1 to determine if there is a next page.
|
@@ -102,20 +102,22 @@ executables: []
|
|
102
102
|
extensions: []
|
103
103
|
extra_rdoc_files: []
|
104
104
|
files:
|
105
|
-
- .gitignore
|
106
|
-
- .rspec
|
107
|
-
- .travis.yml
|
105
|
+
- ".gitignore"
|
106
|
+
- ".rspec"
|
107
|
+
- ".travis.yml"
|
108
108
|
- Gemfile
|
109
|
-
- Gemfile.lock
|
110
109
|
- README.md
|
111
110
|
- Rakefile
|
112
|
-
- gemfiles/
|
113
|
-
- gemfiles/
|
111
|
+
- gemfiles/rails_3_2.gemfile
|
112
|
+
- gemfiles/rails_4_0.gemfile
|
113
|
+
- gemfiles/rails_4_1.gemfile
|
114
|
+
- gemfiles/rails_4_2.gemfile
|
114
115
|
- lib/paginate.rb
|
115
116
|
- lib/paginate/action_controller.rb
|
116
117
|
- lib/paginate/active_record.rb
|
117
118
|
- lib/paginate/base.rb
|
118
|
-
- lib/paginate/
|
119
|
+
- lib/paginate/compat.rb
|
120
|
+
- lib/paginate/configuration.rb
|
119
121
|
- lib/paginate/extension.rb
|
120
122
|
- lib/paginate/helper.rb
|
121
123
|
- lib/paginate/renderer.rb
|
@@ -126,7 +128,7 @@ files:
|
|
126
128
|
- spec/paginate/action_view_spec.rb
|
127
129
|
- spec/paginate/activerecord_spec.rb
|
128
130
|
- spec/paginate/base_spec.rb
|
129
|
-
- spec/paginate/
|
131
|
+
- spec/paginate/configuration_spec.rb
|
130
132
|
- spec/paginate/renderer/base_spec.rb
|
131
133
|
- spec/paginate/renderer/list_spec.rb
|
132
134
|
- spec/paginate/renderer/more_spec.rb
|
@@ -149,19 +151,36 @@ require_paths:
|
|
149
151
|
- lib
|
150
152
|
required_ruby_version: !ruby/object:Gem::Requirement
|
151
153
|
requirements:
|
152
|
-
- -
|
154
|
+
- - ">="
|
153
155
|
- !ruby/object:Gem::Version
|
154
156
|
version: '0'
|
155
157
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
156
158
|
requirements:
|
157
|
-
- -
|
159
|
+
- - ">="
|
158
160
|
- !ruby/object:Gem::Version
|
159
161
|
version: '0'
|
160
162
|
requirements: []
|
161
163
|
rubyforge_project:
|
162
|
-
rubygems_version: 2.
|
164
|
+
rubygems_version: 2.4.5
|
163
165
|
signing_key:
|
164
166
|
specification_version: 4
|
165
167
|
summary: Paginate collections using SIZE+1 to determine if there is a next page. Includes
|
166
168
|
ActiveRecord and ActionView support.
|
167
|
-
test_files:
|
169
|
+
test_files:
|
170
|
+
- spec/paginate/action_view_spec.rb
|
171
|
+
- spec/paginate/activerecord_spec.rb
|
172
|
+
- spec/paginate/base_spec.rb
|
173
|
+
- spec/paginate/configuration_spec.rb
|
174
|
+
- spec/paginate/renderer/base_spec.rb
|
175
|
+
- spec/paginate/renderer/list_spec.rb
|
176
|
+
- spec/paginate/renderer/more_spec.rb
|
177
|
+
- spec/schema.rb
|
178
|
+
- spec/spec_helper.rb
|
179
|
+
- spec/support/controller.rb
|
180
|
+
- spec/support/matchers.rb
|
181
|
+
- spec/support/model.rb
|
182
|
+
- spec/support/translations.yml
|
183
|
+
- spec/support/views/application/_block_as_url.erb
|
184
|
+
- spec/support/views/application/_default.erb
|
185
|
+
- spec/support/views/application/_number.erb
|
186
|
+
- spec/support/views/application/_render.erb
|
data/Gemfile.lock
DELETED
@@ -1,127 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
paginate (3.0.0)
|
5
|
-
|
6
|
-
GEM
|
7
|
-
remote: http://rubygems.org/
|
8
|
-
specs:
|
9
|
-
actionmailer (4.0.0)
|
10
|
-
actionpack (= 4.0.0)
|
11
|
-
mail (~> 2.5.3)
|
12
|
-
actionpack (4.0.0)
|
13
|
-
activesupport (= 4.0.0)
|
14
|
-
builder (~> 3.1.0)
|
15
|
-
erubis (~> 2.7.0)
|
16
|
-
rack (~> 1.5.2)
|
17
|
-
rack-test (~> 0.6.2)
|
18
|
-
activemodel (4.0.0)
|
19
|
-
activesupport (= 4.0.0)
|
20
|
-
builder (~> 3.1.0)
|
21
|
-
activerecord (4.0.0)
|
22
|
-
activemodel (= 4.0.0)
|
23
|
-
activerecord-deprecated_finders (~> 1.0.2)
|
24
|
-
activesupport (= 4.0.0)
|
25
|
-
arel (~> 4.0.0)
|
26
|
-
activerecord-deprecated_finders (1.0.3)
|
27
|
-
activesupport (4.0.0)
|
28
|
-
i18n (~> 0.6, >= 0.6.4)
|
29
|
-
minitest (~> 4.2)
|
30
|
-
multi_json (~> 1.3)
|
31
|
-
thread_safe (~> 0.1)
|
32
|
-
tzinfo (~> 0.3.37)
|
33
|
-
arel (4.0.0)
|
34
|
-
atomic (1.1.10)
|
35
|
-
awesome_print (1.1.0)
|
36
|
-
builder (3.1.4)
|
37
|
-
coderay (1.0.9)
|
38
|
-
diff-lcs (1.2.4)
|
39
|
-
erubis (2.7.0)
|
40
|
-
hike (1.2.3)
|
41
|
-
i18n (0.6.4)
|
42
|
-
mail (2.5.4)
|
43
|
-
mime-types (~> 1.16)
|
44
|
-
treetop (~> 1.4.8)
|
45
|
-
method_source (0.8.1)
|
46
|
-
mime-types (1.23)
|
47
|
-
mini_portile (0.5.0)
|
48
|
-
minitest (4.7.5)
|
49
|
-
multi_json (1.7.7)
|
50
|
-
nokogiri (1.6.0)
|
51
|
-
mini_portile (~> 0.5.0)
|
52
|
-
notifier (0.4.1)
|
53
|
-
polyglot (0.3.3)
|
54
|
-
pry (0.9.12.2)
|
55
|
-
coderay (~> 1.0.5)
|
56
|
-
method_source (~> 0.8)
|
57
|
-
slop (~> 3.4)
|
58
|
-
pry-meta (0.0.5)
|
59
|
-
awesome_print
|
60
|
-
pry
|
61
|
-
pry-nav
|
62
|
-
pry-remote
|
63
|
-
pry-nav (0.2.3)
|
64
|
-
pry (~> 0.9.10)
|
65
|
-
pry-remote (0.1.7)
|
66
|
-
pry (~> 0.9)
|
67
|
-
slop (~> 3.0)
|
68
|
-
rack (1.5.2)
|
69
|
-
rack-test (0.6.2)
|
70
|
-
rack (>= 1.0)
|
71
|
-
rails (4.0.0)
|
72
|
-
actionmailer (= 4.0.0)
|
73
|
-
actionpack (= 4.0.0)
|
74
|
-
activerecord (= 4.0.0)
|
75
|
-
activesupport (= 4.0.0)
|
76
|
-
bundler (>= 1.3.0, < 2.0)
|
77
|
-
railties (= 4.0.0)
|
78
|
-
sprockets-rails (~> 2.0.0)
|
79
|
-
railties (4.0.0)
|
80
|
-
actionpack (= 4.0.0)
|
81
|
-
activesupport (= 4.0.0)
|
82
|
-
rake (>= 0.8.7)
|
83
|
-
thor (>= 0.18.1, < 2.0)
|
84
|
-
rake (10.1.0)
|
85
|
-
rspec (2.14.0.rc1)
|
86
|
-
rspec-core (= 2.14.0.rc1)
|
87
|
-
rspec-expectations (= 2.14.0.rc1)
|
88
|
-
rspec-mocks (= 2.14.0.rc1)
|
89
|
-
rspec-core (2.14.0.rc1)
|
90
|
-
rspec-expectations (2.14.0.rc1)
|
91
|
-
diff-lcs (>= 1.1.3, < 2.0)
|
92
|
-
rspec-mocks (2.14.0.rc1)
|
93
|
-
slop (3.4.5)
|
94
|
-
sprockets (2.10.0)
|
95
|
-
hike (~> 1.2)
|
96
|
-
multi_json (~> 1.0)
|
97
|
-
rack (~> 1.0)
|
98
|
-
tilt (~> 1.1, != 1.3.0)
|
99
|
-
sprockets-rails (2.0.0)
|
100
|
-
actionpack (>= 3.0)
|
101
|
-
activesupport (>= 3.0)
|
102
|
-
sprockets (~> 2.8)
|
103
|
-
sqlite3 (1.3.7)
|
104
|
-
sqlite3-ruby (1.3.3)
|
105
|
-
sqlite3 (>= 1.3.3)
|
106
|
-
test_notifier (1.0.1)
|
107
|
-
notifier
|
108
|
-
thor (0.18.1)
|
109
|
-
thread_safe (0.1.0)
|
110
|
-
atomic
|
111
|
-
tilt (1.4.1)
|
112
|
-
treetop (1.4.14)
|
113
|
-
polyglot
|
114
|
-
polyglot (>= 0.3.1)
|
115
|
-
tzinfo (0.3.37)
|
116
|
-
|
117
|
-
PLATFORMS
|
118
|
-
ruby
|
119
|
-
|
120
|
-
DEPENDENCIES
|
121
|
-
nokogiri
|
122
|
-
paginate!
|
123
|
-
pry-meta
|
124
|
-
rails (~> 4.0.0)
|
125
|
-
rspec (~> 2.14.0.rc1)
|
126
|
-
sqlite3-ruby
|
127
|
-
test_notifier
|
@@ -1,132 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: /mnt/hgfs/!%Projects/github/paginate
|
3
|
-
specs:
|
4
|
-
paginate (3.0.0)
|
5
|
-
|
6
|
-
GEM
|
7
|
-
remote: http://rubygems.org/
|
8
|
-
specs:
|
9
|
-
actionmailer (3.2.13)
|
10
|
-
actionpack (= 3.2.13)
|
11
|
-
mail (~> 2.5.3)
|
12
|
-
actionpack (3.2.13)
|
13
|
-
activemodel (= 3.2.13)
|
14
|
-
activesupport (= 3.2.13)
|
15
|
-
builder (~> 3.0.0)
|
16
|
-
erubis (~> 2.7.0)
|
17
|
-
journey (~> 1.0.4)
|
18
|
-
rack (~> 1.4.5)
|
19
|
-
rack-cache (~> 1.2)
|
20
|
-
rack-test (~> 0.6.1)
|
21
|
-
sprockets (~> 2.2.1)
|
22
|
-
activemodel (3.2.13)
|
23
|
-
activesupport (= 3.2.13)
|
24
|
-
builder (~> 3.0.0)
|
25
|
-
activerecord (3.2.13)
|
26
|
-
activemodel (= 3.2.13)
|
27
|
-
activesupport (= 3.2.13)
|
28
|
-
arel (~> 3.0.2)
|
29
|
-
tzinfo (~> 0.3.29)
|
30
|
-
activeresource (3.2.13)
|
31
|
-
activemodel (= 3.2.13)
|
32
|
-
activesupport (= 3.2.13)
|
33
|
-
activesupport (3.2.13)
|
34
|
-
i18n (= 0.6.1)
|
35
|
-
multi_json (~> 1.0)
|
36
|
-
arel (3.0.2)
|
37
|
-
awesome_print (1.1.0)
|
38
|
-
builder (3.0.4)
|
39
|
-
coderay (1.0.9)
|
40
|
-
diff-lcs (1.2.4)
|
41
|
-
erubis (2.7.0)
|
42
|
-
hike (1.2.3)
|
43
|
-
i18n (0.6.1)
|
44
|
-
journey (1.0.4)
|
45
|
-
json (1.8.0)
|
46
|
-
mail (2.5.4)
|
47
|
-
mime-types (~> 1.16)
|
48
|
-
treetop (~> 1.4.8)
|
49
|
-
method_source (0.8.1)
|
50
|
-
mime-types (1.23)
|
51
|
-
mini_portile (0.5.0)
|
52
|
-
multi_json (1.7.7)
|
53
|
-
nokogiri (1.6.0)
|
54
|
-
mini_portile (~> 0.5.0)
|
55
|
-
notifier (0.4.1)
|
56
|
-
polyglot (0.3.3)
|
57
|
-
pry (0.9.12.2)
|
58
|
-
coderay (~> 1.0.5)
|
59
|
-
method_source (~> 0.8)
|
60
|
-
slop (~> 3.4)
|
61
|
-
pry-meta (0.0.5)
|
62
|
-
awesome_print
|
63
|
-
pry
|
64
|
-
pry-nav
|
65
|
-
pry-remote
|
66
|
-
pry-nav (0.2.3)
|
67
|
-
pry (~> 0.9.10)
|
68
|
-
pry-remote (0.1.7)
|
69
|
-
pry (~> 0.9)
|
70
|
-
slop (~> 3.0)
|
71
|
-
rack (1.4.5)
|
72
|
-
rack-cache (1.2)
|
73
|
-
rack (>= 0.4)
|
74
|
-
rack-ssl (1.3.3)
|
75
|
-
rack
|
76
|
-
rack-test (0.6.2)
|
77
|
-
rack (>= 1.0)
|
78
|
-
rails (3.2.13)
|
79
|
-
actionmailer (= 3.2.13)
|
80
|
-
actionpack (= 3.2.13)
|
81
|
-
activerecord (= 3.2.13)
|
82
|
-
activeresource (= 3.2.13)
|
83
|
-
activesupport (= 3.2.13)
|
84
|
-
bundler (~> 1.0)
|
85
|
-
railties (= 3.2.13)
|
86
|
-
railties (3.2.13)
|
87
|
-
actionpack (= 3.2.13)
|
88
|
-
activesupport (= 3.2.13)
|
89
|
-
rack-ssl (~> 1.3.2)
|
90
|
-
rake (>= 0.8.7)
|
91
|
-
rdoc (~> 3.4)
|
92
|
-
thor (>= 0.14.6, < 2.0)
|
93
|
-
rake (10.1.0)
|
94
|
-
rdoc (3.12.2)
|
95
|
-
json (~> 1.4)
|
96
|
-
rspec (2.14.0.rc1)
|
97
|
-
rspec-core (= 2.14.0.rc1)
|
98
|
-
rspec-expectations (= 2.14.0.rc1)
|
99
|
-
rspec-mocks (= 2.14.0.rc1)
|
100
|
-
rspec-core (2.14.0.rc1)
|
101
|
-
rspec-expectations (2.14.0.rc1)
|
102
|
-
diff-lcs (>= 1.1.3, < 2.0)
|
103
|
-
rspec-mocks (2.14.0.rc1)
|
104
|
-
slop (3.4.5)
|
105
|
-
sprockets (2.2.2)
|
106
|
-
hike (~> 1.2)
|
107
|
-
multi_json (~> 1.0)
|
108
|
-
rack (~> 1.0)
|
109
|
-
tilt (~> 1.1, != 1.3.0)
|
110
|
-
sqlite3 (1.3.7)
|
111
|
-
sqlite3-ruby (1.3.3)
|
112
|
-
sqlite3 (>= 1.3.3)
|
113
|
-
test_notifier (1.0.1)
|
114
|
-
notifier
|
115
|
-
thor (0.18.1)
|
116
|
-
tilt (1.4.1)
|
117
|
-
treetop (1.4.14)
|
118
|
-
polyglot
|
119
|
-
polyglot (>= 0.3.1)
|
120
|
-
tzinfo (0.3.37)
|
121
|
-
|
122
|
-
PLATFORMS
|
123
|
-
ruby
|
124
|
-
|
125
|
-
DEPENDENCIES
|
126
|
-
nokogiri
|
127
|
-
paginate!
|
128
|
-
pry-meta
|
129
|
-
rails (~> 3.2.13)
|
130
|
-
rspec (~> 2.14.0.rc1)
|
131
|
-
sqlite3-ruby
|
132
|
-
test_notifier
|
data/lib/paginate/config.rb
DELETED