will_paginate_renderers 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +3 -3
- data/lib/will_paginate_renderers.rb +2 -1
- data/lib/will_paginate_renderers/gmail.rb +2 -1
- data/lib/will_paginate_renderers/twitter.rb +2 -1
- data/lib/will_paginate_renderers/version.rb +1 -1
- data/spec/spec_helper.rb +6 -33
- data/spec/will_paginate_renderers/gmail_spec.rb +0 -5
- data/spec/will_paginate_renderers/twitter_spec.rb +0 -5
- data/will_paginate_renderers.gemspec +1 -1
- metadata +6 -6
data/Gemfile.lock
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
will_paginate_renderers (0.0.
|
5
|
-
will_paginate (
|
4
|
+
will_paginate_renderers (0.0.3)
|
5
|
+
will_paginate (~> 3.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: http://rubygems.org/
|
@@ -19,7 +19,7 @@ GEM
|
|
19
19
|
rspec-expectations (2.6.0)
|
20
20
|
diff-lcs (~> 1.1.2)
|
21
21
|
rspec-mocks (2.6.0)
|
22
|
-
will_paginate (3.0.
|
22
|
+
will_paginate (3.0.0)
|
23
23
|
yard (0.6.1)
|
24
24
|
|
25
25
|
PLATFORMS
|
@@ -30,7 +30,8 @@ module WillPaginateRenderers
|
|
30
30
|
# * +gmail_older_class+: "gmail_older"
|
31
31
|
# * +gmail_oldest_class+: "gmail_oldest"
|
32
32
|
# * +gmail:window_class+: "gmail_window"
|
33
|
-
class Gmail < ::WillPaginate::
|
33
|
+
class Gmail < ::WillPaginate::ActionView::LinkRenderer
|
34
|
+
|
34
35
|
def pagination
|
35
36
|
[:newest, :newer, :window, :older, :oldest]
|
36
37
|
end
|
@@ -16,7 +16,8 @@ module WillPaginateRenderers
|
|
16
16
|
#
|
17
17
|
# * +twitter_label+: "More"
|
18
18
|
# * +twitter_class+: +twitter_pagination+
|
19
|
-
class Twitter < ::WillPaginate::
|
19
|
+
class Twitter < ::WillPaginate::ActionView::LinkRenderer
|
20
|
+
|
20
21
|
def pagination
|
21
22
|
[:next_page]
|
22
23
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,9 +1,13 @@
|
|
1
1
|
$:.unshift(File.expand_path('../../lib', __FILE__))
|
2
2
|
|
3
|
-
|
3
|
+
# Fake ActionView so we can extend WillPaginate::ActionView::LinkRenderer
|
4
|
+
module ActionView
|
5
|
+
class Base
|
6
|
+
end
|
7
|
+
end
|
4
8
|
|
9
|
+
require 'will_paginate_renderers'
|
5
10
|
require 'will_paginate/collection'
|
6
|
-
require 'will_paginate/view_helpers/base'
|
7
11
|
|
8
12
|
# Copied from will_paginate's spec_helper
|
9
13
|
module MyExtras
|
@@ -16,41 +20,10 @@ module MyExtras
|
|
16
20
|
end
|
17
21
|
WillPaginate::Collection.new(params[:page] || 1, params[:per_page] || 30, params[:total_entries])
|
18
22
|
end
|
19
|
-
|
20
|
-
def have_deprecation
|
21
|
-
DeprecationMatcher.new
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
# Copied from will_paginate's spec_helper
|
26
|
-
class DeprecationMatcher
|
27
|
-
def initialize
|
28
|
-
@old_behavior = WillPaginate::Deprecation.behavior
|
29
|
-
@messages = []
|
30
|
-
WillPaginate::Deprecation.behavior = lambda { |message, callstack|
|
31
|
-
@messages << message
|
32
|
-
}
|
33
|
-
end
|
34
|
-
|
35
|
-
def matches?(block)
|
36
|
-
block.call
|
37
|
-
!@messages.empty?
|
38
|
-
ensure
|
39
|
-
WillPaginate::Deprecation.behavior = @old_behavior
|
40
|
-
end
|
41
|
-
|
42
|
-
def failure_message
|
43
|
-
"expected block to raise a deprecation warning"
|
44
|
-
end
|
45
|
-
|
46
|
-
def negative_failure_message
|
47
|
-
"expected block not to raise deprecation warnings, #{@messages.size} raised"
|
48
|
-
end
|
49
23
|
end
|
50
24
|
|
51
25
|
RSpec.configure do |c|
|
52
26
|
c.mock_with :mocha
|
53
27
|
|
54
|
-
c.include(WillPaginate::ViewHelpers::Base)
|
55
28
|
c.include(MyExtras)
|
56
29
|
end
|
@@ -17,11 +17,6 @@ module WillPaginateRenderers
|
|
17
17
|
@renderer.send(:param_name).should eql('mypage')
|
18
18
|
end
|
19
19
|
|
20
|
-
it "should have total_pages accessor" do
|
21
|
-
prepare :total_pages => 42
|
22
|
-
expect { @renderer.send(:total_pages).should eql(42) }.to_not have_deprecation
|
23
|
-
end
|
24
|
-
|
25
20
|
it "should have pagination definition" do
|
26
21
|
prepare({ :total_pages => 1 }, :page_links => true)
|
27
22
|
@renderer.pagination.should eql([:newest, :newer, :window, :older, :oldest])
|
@@ -16,11 +16,6 @@ module WillPaginateRenderers
|
|
16
16
|
@renderer.send(:param_name).should eql('mypage')
|
17
17
|
end
|
18
18
|
|
19
|
-
it "should have total_pages accessor" do
|
20
|
-
prepare :total_pages => 42
|
21
|
-
expect { @renderer.send(:total_pages).should eql(42) }.to_not have_deprecation
|
22
|
-
end
|
23
|
-
|
24
19
|
it "should have pagination definition" do
|
25
20
|
prepare({ :total_pages => 1 }, :page_links => true)
|
26
21
|
@renderer.pagination.should eql([:next_page])
|
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
20
20
|
s.require_paths = ["lib"]
|
21
21
|
|
22
|
-
s.add_dependency "will_paginate", "3.0
|
22
|
+
s.add_dependency "will_paginate", "~> 3.0"
|
23
23
|
s.add_development_dependency "mocha", "~> 0.9"
|
24
24
|
s.add_development_dependency "rspec", "~> 2.6"
|
25
25
|
s.add_development_dependency "yard"
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: will_paginate_renderers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.3
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Robert Speicher
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
13
|
+
date: 2011-08-09 00:00:00 -04:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -18,9 +18,9 @@ dependencies:
|
|
18
18
|
requirement: &id001 !ruby/object:Gem::Requirement
|
19
19
|
none: false
|
20
20
|
requirements:
|
21
|
-
- -
|
21
|
+
- - ~>
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: 3.0
|
23
|
+
version: "3.0"
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
26
|
version_requirements: *id001
|
@@ -96,7 +96,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
96
96
|
requirements:
|
97
97
|
- - ">="
|
98
98
|
- !ruby/object:Gem::Version
|
99
|
-
hash:
|
99
|
+
hash: 2723044152656583199
|
100
100
|
segments:
|
101
101
|
- 0
|
102
102
|
version: "0"
|
@@ -105,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
105
105
|
requirements:
|
106
106
|
- - ">="
|
107
107
|
- !ruby/object:Gem::Version
|
108
|
-
hash:
|
108
|
+
hash: 2723044152656583199
|
109
109
|
segments:
|
110
110
|
- 0
|
111
111
|
version: "0"
|