page_up 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 20c7439062000ee660ffbb29a6397979c0d91eb6
4
- data.tar.gz: 3e4cf5c800a2d1829a347fb12efa7ae53f8d8799
3
+ metadata.gz: 95b21376934e5e252221044108c530919bbfcbef
4
+ data.tar.gz: ef6029e14b2ae406fd1d588199c03c14c5e24487
5
5
  SHA512:
6
- metadata.gz: e88399fce698a9795283c3aebf6adab1d3decc1b3ecde3852ba6530238c8bb914ef20b501cda85d2531b4faf260eff302c9ef62ecc5b1dc355555ccd3b25db66
7
- data.tar.gz: 44558756fc80fa5f15e60d7776402823328b526dc1e01a57715ef09bc676df0309553bbb00a5d899f91e6201b00e6c3434ee51ec96f9ee5f7b6a8a68695edd7a
6
+ metadata.gz: 212a318ad7b6ff7b796146a655d8bae6811d48906771664116f7a62a59beaf78cadc0a23f97550ca7e62270f3039e84edf9bb21283d0256bacae7cb375c5b035
7
+ data.tar.gz: f23a2bac6fbaa2ebc8bc18727329f1fc35f13dc6b83d0a3df4c62df86080ec09b8a54c29067e85baef386a0a5ca46b5f6155b990fdba40afb4b776207602f851
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
@@ -1,2 +1,2 @@
1
- QIt{6\� ��`�Ң"Z�Ϯ��fi�2�<`���^y8*�=�m~�������Yha_3g��KaCSPK$ZZF%cY��l�ݵ`�=ө���
2
- �;�T��-�QSḛf+Bt&��l�v�x;�@D�.��I��� t\y���eԆ2�eqbT�����:i��|�*�2�N�ҳ9kv��C��A}f[=E/��
1
+ (`�?(�o��j=�\r��%r+y�K��GrT�,�:ұ����$�����{iK���L�Z��I�ܚPńWFccv&�p"�" �������^���O�Wd���^�<���)Г�N0�dq7b1v�W$�r����$Mۯ�ъ`�N%�������.�w�I��
2
+ �(p��}2mݯ����1$�*�X ��q)b4w��a�Ö�X;���Ń���R���� ��<��L��}��:
data/lib/page_up/pages.rb CHANGED
@@ -45,13 +45,8 @@ module PageUp
45
45
  end
46
46
 
47
47
  def slice_start
48
- if page - 2 <= 0
49
- 1
50
- elsif page + 2 > pages
51
- pages - 4
52
- else
53
- page - 2
54
- end
48
+ start = pages - ((page + 2 > pages) ? 4 : 2)
49
+ start > 0 ? start : 1
55
50
  end
56
51
 
57
52
  def slice_end
@@ -1,3 +1,3 @@
1
1
  module PageUp
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
@@ -53,6 +53,9 @@ describe "pagination" do
53
53
  specify { expect(PageUp[collection,10,1].current_slice).to eq 8..12 }
54
54
  specify { expect(PageUp[collection,11,1].current_slice).to eq 8..12 }
55
55
  specify { expect(PageUp[collection,12,1].current_slice).to eq 8..12 }
56
+ specify { expect(PageUp[collection,1,5].current_slice).to eq 1..3 }
57
+ specify { expect(PageUp[collection,2,5].current_slice).to eq 1..3 }
58
+ specify { expect(PageUp[collection,3,5].current_slice).to eq 1..3 }
56
59
  end
57
60
 
58
61
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: page_up
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Rowe
metadata.gz.sig CHANGED
Binary file