page_up 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -2
- data/lib/page_up/fragment.rb +4 -0
- data/lib/page_up/version.rb +1 -1
- data/page_up.gemspec +2 -2
- data/spec/page_up/fragment_spec.rb +9 -0
- metadata +9 -30
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5c271fd062de9397f81bb1225dd72b0b2f22cc2
|
4
|
+
data.tar.gz: b0d85101ceea1da3d58139ce2416c09d2d27b68b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b77e0ac8a38017a6ffbdbe2293d1beea0a9d65445403ac925914607dd3e334a77ba4fb3fcf025b29af1cea3361c85f4594afb0d697c8c12de1b0b4a88687ba44
|
7
|
+
data.tar.gz: 9249c94dfb6a51d8a5f31ce599283d8d998c1547835589a93220273f68659310281edc6a2cb16d7438ea8f284308822d9b9ba2a3b3d2fd75ed56c74c3507e1a0
|
data/.travis.yml
CHANGED
data/lib/page_up/fragment.rb
CHANGED
data/lib/page_up/version.rb
CHANGED
data/page_up.gemspec
CHANGED
@@ -20,6 +20,6 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
22
|
spec.add_development_dependency "rake"
|
23
|
-
spec.add_development_dependency "bundler"
|
24
|
-
spec.add_development_dependency "rspec", "~>
|
23
|
+
spec.add_development_dependency "bundler"
|
24
|
+
spec.add_development_dependency "rspec", "~> 3.0.0"
|
25
25
|
end
|
@@ -20,6 +20,7 @@ describe 'fragmented pages' do
|
|
20
20
|
|
21
21
|
context 'when the range is outside the fragment' do
|
22
22
|
let(:pages_requested) { [] }
|
23
|
+
let(:pages) { PageUp::Fragment.new fragment, 2, 20, source.size }
|
23
24
|
|
24
25
|
before do
|
25
26
|
pages.use do |page, per_page|
|
@@ -38,6 +39,10 @@ describe 'fragmented pages' do
|
|
38
39
|
expect(pages_requested).to eq [[4,20]]
|
39
40
|
end
|
40
41
|
|
42
|
+
it 'will retrieve earlier results if it has to' do
|
43
|
+
expect(pages[0...20]).to eq (1..20).to_a
|
44
|
+
end
|
45
|
+
|
41
46
|
it 'will call the block multiple times if required' do
|
42
47
|
pages[70...90]
|
43
48
|
expect(pages_requested).to eq [[4,20],[5,20]]
|
@@ -47,6 +52,10 @@ describe 'fragmented pages' do
|
|
47
52
|
expect(pages[70...90]).to eq (71..90).to_a
|
48
53
|
end
|
49
54
|
|
55
|
+
it 'will collect all results if necessary' do
|
56
|
+
expect(pages.to_a).to eq source
|
57
|
+
end
|
58
|
+
|
50
59
|
it 'protects against ranges that exceed the existing data' do
|
51
60
|
Timeout.timeout(0.3) do
|
52
61
|
expect(pages[90...110]).to eq (91..100).to_a
|
metadata
CHANGED
@@ -1,35 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: page_up
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Rowe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
|
-
cert_chain:
|
11
|
-
-
|
12
|
-
-----BEGIN CERTIFICATE-----
|
13
|
-
MIIDVjCCAj6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBRMQ4wDAYDVQQDDAVoZWxs
|
14
|
-
bzEXMBUGCgmSJomT8ixkARkWB2pvbnJvd2UxEjAQBgoJkiaJk/IsZAEZFgJjbzES
|
15
|
-
MBAGCgmSJomT8ixkARkWAnVrMB4XDTE0MDIwNjEwMjcxN1oXDTE1MDIwNjEwMjcx
|
16
|
-
N1owUTEOMAwGA1UEAwwFaGVsbG8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FICATE-----
|
32
|
-
date: 2014-03-03 00:00:00.000000000 Z
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-08-18 00:00:00.000000000 Z
|
33
12
|
dependencies:
|
34
13
|
- !ruby/object:Gem::Dependency
|
35
14
|
name: rake
|
@@ -49,30 +28,30 @@ dependencies:
|
|
49
28
|
name: bundler
|
50
29
|
requirement: !ruby/object:Gem::Requirement
|
51
30
|
requirements:
|
52
|
-
- - "
|
31
|
+
- - ">="
|
53
32
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
33
|
+
version: '0'
|
55
34
|
type: :development
|
56
35
|
prerelease: false
|
57
36
|
version_requirements: !ruby/object:Gem::Requirement
|
58
37
|
requirements:
|
59
|
-
- - "
|
38
|
+
- - ">="
|
60
39
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
40
|
+
version: '0'
|
62
41
|
- !ruby/object:Gem::Dependency
|
63
42
|
name: rspec
|
64
43
|
requirement: !ruby/object:Gem::Requirement
|
65
44
|
requirements:
|
66
45
|
- - "~>"
|
67
46
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
47
|
+
version: 3.0.0
|
69
48
|
type: :development
|
70
49
|
prerelease: false
|
71
50
|
version_requirements: !ruby/object:Gem::Requirement
|
72
51
|
requirements:
|
73
52
|
- - "~>"
|
74
53
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
54
|
+
version: 3.0.0
|
76
55
|
description: Simple paginator
|
77
56
|
email:
|
78
57
|
- hello@jonrowe.co.uk
|
checksums.yaml.gz.sig
DELETED
Binary file
|
data.tar.gz.sig
DELETED
Binary file
|
metadata.gz.sig
DELETED
Binary file
|