just_paginate 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/just_paginate.rb +7 -1
  2. metadata +8 -8
data/lib/just_paginate.rb CHANGED
@@ -1,8 +1,9 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  module JustPaginate
3
3
 
4
- VERSION = "0.0.9"
4
+ VERSION = "0.0.10"
5
5
 
6
+ # TODO make sure negative numbers, non-integers etc are just converted to page 1.
6
7
  def self.page_value(page)
7
8
  if page.nil?
8
9
  1
@@ -100,4 +101,9 @@ module JustPaginate
100
101
  return labels
101
102
  end
102
103
 
104
+ module Rails
105
+ def self.warn_on_oob(requested_page, per_page, total_element_count)
106
+ flash[:error] = "Page #{@page} out of bounds." if JustPaginate.beyond_page_range?(requested_page, per_page, total_element_count)
107
+ end
108
+ end
103
109
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: just_paginate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-08 00:00:00.000000000Z
12
+ date: 2012-11-09 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest
16
- requirement: &13027740 !ruby/object:Gem::Requirement
16
+ requirement: &6792980 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *13027740
24
+ version_requirements: *6792980
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: shoulda
27
- requirement: &13027240 !ruby/object:Gem::Requirement
27
+ requirement: &6792300 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *13027240
35
+ version_requirements: *6792300
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: shoulda-context
38
- requirement: &13026700 !ruby/object:Gem::Requirement
38
+ requirement: &6791400 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *13026700
46
+ version_requirements: *6791400
47
47
  description: Framework-agnostic support for paginating collections of things, and
48
48
  linking to paginated things in your webpage
49
49
  email: