kaminari 0.3.0 → 0.4.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/TODO.txt +0 -2
- data/VERSION +1 -1
- data/app/views/kaminari/_paginator.html.erb +3 -0
- data/kaminari.gemspec +3 -2
- data/lib/kaminari/helpers.rb +11 -9
- data/spec/helpers/helpers_spec.rb +2 -2
- metadata +5 -4
data/TODO.txt
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.4.0
|
data/kaminari.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{kaminari}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.4.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Akira Matsuda"]
|
12
|
-
s.date = %q{2011-02-
|
12
|
+
s.date = %q{2011-02-07}
|
13
13
|
s.description = %q{Kaminari is a Scope & Engine based clean and powerful and customizable and sophisticated paginator for Rails 3}
|
14
14
|
s.email = %q{ronnie@dio.jp}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -32,6 +32,7 @@ Gem::Specification.new do |s|
|
|
32
32
|
"app/views/kaminari/_next_link.html.erb",
|
33
33
|
"app/views/kaminari/_next_span.html.erb",
|
34
34
|
"app/views/kaminari/_page_link.html.erb",
|
35
|
+
"app/views/kaminari/_paginator.html.erb",
|
35
36
|
"app/views/kaminari/_prev_link.html.erb",
|
36
37
|
"app/views/kaminari/_prev_span.html.erb",
|
37
38
|
"app/views/kaminari/_truncated_span.html.erb",
|
data/lib/kaminari/helpers.rb
CHANGED
@@ -54,6 +54,9 @@ module Kaminari
|
|
54
54
|
class TruncatedSpan < Tag
|
55
55
|
end
|
56
56
|
|
57
|
+
class Paginator < Tag
|
58
|
+
end
|
59
|
+
|
57
60
|
class PaginationRenderer
|
58
61
|
attr_reader :options
|
59
62
|
|
@@ -62,15 +65,7 @@ module Kaminari
|
|
62
65
|
@left, @window, @right = (options[:left] || options[:outer_window] || 1), (options[:window] || options[:inner_window] || 4), (options[:right] || options[:outer_window] || 1)
|
63
66
|
end
|
64
67
|
|
65
|
-
def
|
66
|
-
suppress_logging_render_partial do
|
67
|
-
@template.content_tag :div, :class => 'pagination' do
|
68
|
-
tagify.join("\n").html_safe
|
69
|
-
end
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
|
-
def tagify
|
68
|
+
def tagify_links
|
74
69
|
num_pages, current_page, left, window, right = @options[:num_pages], @options[:current_page], @left, @window, @right
|
75
70
|
|
76
71
|
tags = []
|
@@ -94,6 +89,13 @@ module Kaminari
|
|
94
89
|
tags << (num_pages > current_page ? NextLink.new(self) : NextSpan.new(self))
|
95
90
|
end
|
96
91
|
|
92
|
+
def to_s
|
93
|
+
suppress_logging_render_partial do
|
94
|
+
@template.content_for :kaminari_paginator_tags, tagify_links.join("\n").html_safe
|
95
|
+
Paginator.new(self).to_s
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
97
99
|
private
|
98
100
|
def method_missing(meth, *args, &blk)
|
99
101
|
@template.send meth, *args, &blk
|
@@ -10,9 +10,9 @@ describe 'Kaminari::Helpers::PaginationRenderer' do
|
|
10
10
|
end
|
11
11
|
r
|
12
12
|
end
|
13
|
-
describe '#
|
13
|
+
describe '#tagify_links' do
|
14
14
|
def tags_with(options)
|
15
|
-
PaginationRenderer.new(renderer, options).
|
15
|
+
PaginationRenderer.new(renderer, options).tagify_links
|
16
16
|
end
|
17
17
|
|
18
18
|
context 'first page' do
|
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: 15
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
8
|
+
- 4
|
9
9
|
- 0
|
10
|
-
version: 0.
|
10
|
+
version: 0.4.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Akira Matsuda
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-02-
|
18
|
+
date: 2011-02-07 00:00:00 +09:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -223,6 +223,7 @@ files:
|
|
223
223
|
- app/views/kaminari/_next_link.html.erb
|
224
224
|
- app/views/kaminari/_next_span.html.erb
|
225
225
|
- app/views/kaminari/_page_link.html.erb
|
226
|
+
- app/views/kaminari/_paginator.html.erb
|
226
227
|
- app/views/kaminari/_prev_link.html.erb
|
227
228
|
- app/views/kaminari/_prev_span.html.erb
|
228
229
|
- app/views/kaminari/_truncated_span.html.erb
|