dm-pager 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/History.md +5 -0
- data/Manifest +1 -0
- data/dm-pager.gemspec +3 -3
- data/lib/dm-pager/pager.rb +3 -3
- data/lib/dm-pager/version.rb +1 -1
- data/spec/unit/pager_spec.rb +9 -0
- metadata +3 -3
data/History.md
CHANGED
data/Manifest
CHANGED
data/dm-pager.gemspec
CHANGED
@@ -2,15 +2,15 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{dm-pager}
|
5
|
-
s.version = "0.0.
|
5
|
+
s.version = "0.0.8"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["TJ Holowaychuk"]
|
9
|
-
s.date = %q{2009-10-
|
9
|
+
s.date = %q{2009-10-27}
|
10
10
|
s.description = %q{DataMapper Pagination}
|
11
11
|
s.email = %q{tj@vision-media.ca}
|
12
12
|
s.extra_rdoc_files = ["lib/dm-pager.rb", "lib/dm-pager/defaults.rb", "lib/dm-pager/helpers.rb", "lib/dm-pager/helpers/rails.rb", "lib/dm-pager/pager.rb", "lib/dm-pager/pagination.rb", "lib/dm-pager/version.rb", "tasks/docs.rake", "tasks/gemspec.rake", "tasks/spec.rake"]
|
13
|
-
s.files = ["History.md", "Manifest", "Rakefile", "Readme.md", "examples/pager.rb", "lib/dm-pager.rb", "lib/dm-pager/defaults.rb", "lib/dm-pager/helpers.rb", "lib/dm-pager/helpers/rails.rb", "lib/dm-pager/pager.rb", "lib/dm-pager/pagination.rb", "lib/dm-pager/version.rb", "spec/integration/rails_helper_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "spec/unit/pager_spec.rb", "spec/unit/pagination_spec.rb", "tasks/docs.rake", "tasks/gemspec.rake", "tasks/spec.rake"
|
13
|
+
s.files = ["History.md", "Manifest", "Rakefile", "Readme.md", "dm-pager.gemspec", "examples/pager.rb", "lib/dm-pager.rb", "lib/dm-pager/defaults.rb", "lib/dm-pager/helpers.rb", "lib/dm-pager/helpers/rails.rb", "lib/dm-pager/pager.rb", "lib/dm-pager/pagination.rb", "lib/dm-pager/version.rb", "spec/integration/rails_helper_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "spec/unit/pager_spec.rb", "spec/unit/pagination_spec.rb", "tasks/docs.rake", "tasks/gemspec.rake", "tasks/spec.rake"]
|
14
14
|
s.homepage = %q{http://github.com/visionmedia/dm-pagination}
|
15
15
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Dm-pager", "--main", "Readme.md"]
|
16
16
|
s.require_paths = ["lib"]
|
data/lib/dm-pager/pager.rb
CHANGED
@@ -183,9 +183,9 @@ module DataMapper
|
|
183
183
|
|
184
184
|
def uri_for page
|
185
185
|
case @uri
|
186
|
-
when
|
187
|
-
when /\?/
|
188
|
-
else
|
186
|
+
when /\bpage=/ ; @uri.gsub /\bpage=\d+/, "page=#{page}"
|
187
|
+
when /\?/ ; @uri += "&page=#{page}"
|
188
|
+
else ; @uri += "?page=#{page}"
|
189
189
|
end
|
190
190
|
end
|
191
191
|
|
data/lib/dm-pager/version.rb
CHANGED
data/spec/unit/pager_spec.rb
CHANGED
@@ -214,6 +214,15 @@ describe DataMapper::Pager do
|
|
214
214
|
markup.should include('items?foo=bar&page=1')
|
215
215
|
end
|
216
216
|
end
|
217
|
+
|
218
|
+
describe "when containing other keys with 'page'" do
|
219
|
+
it "should append a pair" do
|
220
|
+
markup = Item.page.pager.to_html 'items?per_page=5'
|
221
|
+
markup.should include('items?per_page=5&page=1')
|
222
|
+
markup = Item.page.pager.to_html 'items?page=4&per_page=3'
|
223
|
+
markup.should include('items?page=1&per_page=3')
|
224
|
+
end
|
225
|
+
end
|
217
226
|
end
|
218
227
|
|
219
228
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dm-pager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TJ Holowaychuk
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-10-
|
12
|
+
date: 2009-10-27 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -54,6 +54,7 @@ files:
|
|
54
54
|
- Manifest
|
55
55
|
- Rakefile
|
56
56
|
- Readme.md
|
57
|
+
- dm-pager.gemspec
|
57
58
|
- examples/pager.rb
|
58
59
|
- lib/dm-pager.rb
|
59
60
|
- lib/dm-pager/defaults.rb
|
@@ -70,7 +71,6 @@ files:
|
|
70
71
|
- tasks/docs.rake
|
71
72
|
- tasks/gemspec.rake
|
72
73
|
- tasks/spec.rake
|
73
|
-
- dm-pager.gemspec
|
74
74
|
has_rdoc: true
|
75
75
|
homepage: http://github.com/visionmedia/dm-pagination
|
76
76
|
licenses: []
|