will_paginate 3.0.pre → 3.0.pre2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of will_paginate might be problematic. Click here for more details.
@@ -64,15 +64,7 @@ module WillPaginate
|
|
64
64
|
# blocks of pagination links sharing the same ID (which is invalid HTML).
|
65
65
|
def paginated_section(*args, &block)
|
66
66
|
pagination = will_paginate(*args).to_s
|
67
|
-
|
68
|
-
unless ::ActionView::Base.respond_to? :erb_variable
|
69
|
-
concat pagination
|
70
|
-
yield
|
71
|
-
concat pagination
|
72
|
-
else
|
73
|
-
content = pagination + capture(&block) + pagination
|
74
|
-
concat(content, block.binding)
|
75
|
-
end
|
67
|
+
pagination + capture(&block) + pagination
|
76
68
|
end
|
77
69
|
|
78
70
|
protected
|
@@ -31,7 +31,7 @@ class ActiverecordTestConnector
|
|
31
31
|
|
32
32
|
def self.add_load_path(path)
|
33
33
|
dep = defined?(ActiveSupport::Dependencies) ? ActiveSupport::Dependencies : ::Dependencies
|
34
|
-
dep.
|
34
|
+
dep.autoload_paths.unshift path
|
35
35
|
end
|
36
36
|
|
37
37
|
def self.setup_connection
|
data/spec/spec_helper.rb
CHANGED
@@ -5,14 +5,17 @@ require 'view_helpers/view_example_group'
|
|
5
5
|
require 'will_paginate/view_helpers/action_view'
|
6
6
|
require 'will_paginate/collection'
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
8
|
+
ActionView::Base.send(:include, WillPaginate::ViewHelpers::ActionView)
|
9
|
+
|
10
|
+
Routes = ActionDispatch::Routing::RouteSet.new
|
11
|
+
|
12
|
+
Routes.draw do
|
13
|
+
match 'dummy/page/:page' => 'dummy#index'
|
14
|
+
match 'dummy/dots/page.:page' => 'dummy#dots'
|
15
|
+
match 'ibocorp(/:page)' => 'ibocorp#index',
|
16
|
+
:constraints => { :page => /\d+/ }, :defaults => { :page => 1 }
|
17
|
+
|
18
|
+
match ':controller(/:action(/:id(.:format)))'
|
16
19
|
end
|
17
20
|
|
18
21
|
describe WillPaginate::ViewHelpers::ActionView do
|
@@ -28,6 +31,7 @@ describe WillPaginate::ViewHelpers::ActionView do
|
|
28
31
|
def render(locals)
|
29
32
|
@view = ActionView::Base.new([], @assigns, @controller)
|
30
33
|
@view.request = @request
|
34
|
+
@view.singleton_class.send(:include, @controller._routes.url_helpers)
|
31
35
|
@view.render(:inline => @template, :locals => locals)
|
32
36
|
end
|
33
37
|
|
@@ -165,7 +169,7 @@ describe WillPaginate::ViewHelpers::ActionView do
|
|
165
169
|
|
166
170
|
it "should render a paginated section" do
|
167
171
|
@template = <<-ERB
|
168
|
-
|
172
|
+
<%= paginated_section collection, options do %>
|
169
173
|
<%= content_tag :div, '', :id => "developers" %>
|
170
174
|
<% end %>
|
171
175
|
ERB
|
@@ -255,6 +259,8 @@ describe WillPaginate::ViewHelpers::ActionView do
|
|
255
259
|
assert_links_match %r{/ibocorp(?:/(\d+))?$}, links, [nil, nil, 3, 4, 5, 6, 3]
|
256
260
|
end
|
257
261
|
end
|
262
|
+
# Routes.recognize_path('/ibocorp/2').should == {:page=>'2', :action=>'index', :controller=>'ibocorp'}
|
263
|
+
# Routes.recognize_path('/ibocorp/foo').should == {:action=>'foo', :controller=>'ibocorp'}
|
258
264
|
end
|
259
265
|
|
260
266
|
## internal hardcore stuff ##
|
@@ -295,18 +301,19 @@ class DummyController
|
|
295
301
|
attr_reader :request
|
296
302
|
attr_accessor :controller_name
|
297
303
|
|
304
|
+
include ActionController::UrlFor
|
305
|
+
include Routes.url_helpers
|
306
|
+
|
298
307
|
def initialize
|
299
308
|
@request = DummyRequest.new
|
300
|
-
@url = ActionController::UrlRewriter.new(@request, @request.params)
|
301
309
|
end
|
302
310
|
|
303
311
|
def params
|
304
312
|
@request.params
|
305
313
|
end
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
end
|
314
|
+
end
|
315
|
+
|
316
|
+
class IbocorpController < DummyController
|
310
317
|
end
|
311
318
|
|
312
319
|
class DummyRequest
|
@@ -329,6 +336,10 @@ class DummyRequest
|
|
329
336
|
def relative_url_root
|
330
337
|
''
|
331
338
|
end
|
339
|
+
|
340
|
+
def script_name
|
341
|
+
''
|
342
|
+
end
|
332
343
|
|
333
344
|
def params(more = nil)
|
334
345
|
@params.update(more) if more
|
metadata
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: will_paginate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: -1876988247
|
5
|
+
prerelease: true
|
6
|
+
segments:
|
7
|
+
- 3
|
8
|
+
- 0
|
9
|
+
- pre2
|
10
|
+
version: 3.0.pre2
|
5
11
|
platform: ruby
|
6
12
|
authors:
|
7
13
|
- "Mislav Marohni\xC4\x87"
|
@@ -91,21 +97,29 @@ rdoc_options:
|
|
91
97
|
require_paths:
|
92
98
|
- lib
|
93
99
|
required_ruby_version: !ruby/object:Gem::Requirement
|
100
|
+
none: false
|
94
101
|
requirements:
|
95
102
|
- - ">="
|
96
103
|
- !ruby/object:Gem::Version
|
104
|
+
hash: 3
|
105
|
+
segments:
|
106
|
+
- 0
|
97
107
|
version: "0"
|
98
|
-
version:
|
99
108
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
109
|
+
none: false
|
100
110
|
requirements:
|
101
111
|
- - ">"
|
102
112
|
- !ruby/object:Gem::Version
|
113
|
+
hash: 25
|
114
|
+
segments:
|
115
|
+
- 1
|
116
|
+
- 3
|
117
|
+
- 1
|
103
118
|
version: 1.3.1
|
104
|
-
version:
|
105
119
|
requirements: []
|
106
120
|
|
107
121
|
rubyforge_project:
|
108
|
-
rubygems_version: 1.3.
|
122
|
+
rubygems_version: 1.3.7
|
109
123
|
signing_key:
|
110
124
|
specification_version: 3
|
111
125
|
summary: Adaptive pagination plugin for web frameworks and other applications
|