appengine-paginator 0.2.0.pre → 0.2.1.pre

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0.pre
1
+ 0.2.1.pre
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{appengine-paginator}
8
- s.version = "0.2.0.pre"
8
+ s.version = "0.2.1.pre"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Josh Moore"]
@@ -15,7 +15,11 @@ module Paginator
15
15
  #
16
16
  # * must be a base 64 encoded cursor
17
17
  def self.parse(cursor_string)
18
- Cursor.new Java::comGoogleAppengineApiDatastore::Cursor.from_web_safe_string(cursor_string)
18
+ if cursor_string.nil?
19
+ nil
20
+ else
21
+ Cursor.new Java::comGoogleAppengineApiDatastore::Cursor.from_web_safe_string(cursor_string)
22
+ end
19
23
  end
20
24
 
21
25
  # returns the actual Java cursor (instance of com.google.appengine.api.datastore.Cursor
data/spec/cursor_spec.rb CHANGED
@@ -18,6 +18,10 @@ describe Paginator::Cursor do
18
18
  it 'should return an object of class Cursor' do
19
19
  Paginator::Cursor.parse(@cursor_string).should be_instance_of Paginator::Cursor
20
20
  end
21
+
22
+ it 'should return nil if the string is nil' do
23
+ Paginator::Cursor.parse(nil).should be_nil
24
+ end
21
25
  end
22
26
 
23
27
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appengine-paginator
3
3
  version: !ruby/object:Gem::Version
4
- hash: 961915988
4
+ hash: 961915984
5
5
  prerelease: true
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 0
9
+ - 1
10
10
  - pre
11
- version: 0.2.0.pre
11
+ version: 0.2.1.pre
12
12
  platform: ruby
13
13
  authors:
14
14
  - Josh Moore