vj-sdk 0.5.3 → 0.5.4

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION.yml CHANGED
@@ -2,4 +2,4 @@
2
2
  :build:
3
3
  :major: 0
4
4
  :minor: 5
5
- :patch: 3
5
+ :patch: 4
@@ -22,7 +22,7 @@ module Videojuicer
22
22
  end
23
23
 
24
24
  def page_count
25
- return 1 if limit.nil?
25
+ return 1 if limit.nil? or total.nil? or total < 1
26
26
  (total.to_f/limit.to_f).ceil
27
27
  end
28
28
 
@@ -27,6 +27,11 @@ describe Videojuicer::Resource::Collection do
27
27
  c.page_number.should == 1
28
28
  end
29
29
 
30
+ it "reports page 1 when there are zero items" do
31
+ c = Videojuicer::Resource::Collection.new(@objects[0..9], 0, 0, 10)
32
+ c.page_number.should == 1
33
+ end
34
+
30
35
  it "pagination copes with a nil limit" do
31
36
  collection = Videojuicer::Resource::Collection.new(@objects[0..9], 155, 17, nil)
32
37
  collection.page_count.should == 1
data/vj-sdk.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{vj-sdk}
8
- s.version = "0.5.3"
8
+ s.version = "0.5.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["danski", "thejohnny", "knowtheory", "sixones", "btab"]
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 5
8
- - 3
9
- version: 0.5.3
8
+ - 4
9
+ version: 0.5.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - danski