page_up 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/page_up/fragment.rb +3 -2
- data/lib/page_up/version.rb +1 -1
- data/spec/page_up/fragment_spec.rb +6 -0
- data.tar.gz.sig +2 -2
- metadata +1 -1
- 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: 520aa3608f8c93a7891b4610ecdef4d8c9c837a3
|
4
|
+
data.tar.gz: 18a9e35575f9e29a0d071389a4d399b5f0244319
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84bd728ef04a9684f96b2ecbe8ab22804f5cd4f40873918c3ef98bd942a45db0a8124a0418130a29b9afc2fc6ebff78216501a297c5f9762ed4cbf45dddb23bc
|
7
|
+
data.tar.gz: 8bd51972898e7bae3762a46cea8f84ec98c7989f4a792ff9e050094da80b4eac25572c99ef1e55dee5881a32a93056dbd53761ae5a2d196be9ebafc8157cbbc7
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/page_up/fragment.rb
CHANGED
@@ -14,11 +14,12 @@ module PageUp
|
|
14
14
|
until covers? range
|
15
15
|
next_page = page_for(range)
|
16
16
|
result = @callback.call next_page, @per_page
|
17
|
-
|
17
|
+
@per_page.times do |index|
|
18
|
+
value = result[index]
|
18
19
|
@fragment[index + offset(next_page)] = value
|
19
20
|
end
|
20
21
|
end
|
21
|
-
@fragment[range]
|
22
|
+
@fragment[range].compact
|
22
23
|
end
|
23
24
|
|
24
25
|
def use &block
|
data/lib/page_up/version.rb
CHANGED
@@ -46,6 +46,12 @@ describe 'fragmented pages' do
|
|
46
46
|
it 'will return the desired fragment' do
|
47
47
|
expect(pages[70...90]).to eq (71..90).to_a
|
48
48
|
end
|
49
|
+
|
50
|
+
it 'protects against ranges that exceed the existing data' do
|
51
|
+
Timeout.timeout(0.3) do
|
52
|
+
expect(pages[90...110]).to eq (91..100).to_a
|
53
|
+
end
|
54
|
+
end
|
49
55
|
end
|
50
56
|
|
51
57
|
end
|
data.tar.gz.sig
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
�
|
2
|
-
|
1
|
+
?�+��;fTY��5�=�!�j�8��Yg@��i�e�1��'�̞yy��Z�g#���I�%��zW����.n�u`{���_E����^��"��M��g��8l,����z��B�=d2��ª�KY��rZ��x �?��p=�zv���.�� x�"^��2ϖ����@9�e���6[E<�W�H�0� ����bJ���-<�.`�c�X����5��B$�
|
2
|
+
�R�[����Bp���ct�j�XyU����p�^
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|