vj-sdk 0.5.1 → 0.5.2

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: 1
5
+ :patch: 2
@@ -27,7 +27,7 @@ module Videojuicer
27
27
  end
28
28
 
29
29
  def page_number
30
- return 1 if limit.nil?
30
+ return 1 if limit.nil? or offset.nil? or offset < 1
31
31
  (offset.to_f/limit.to_f).ceil
32
32
  end
33
33
 
@@ -22,6 +22,11 @@ describe Videojuicer::Resource::Collection do
22
22
  @collection.page_number.should == 2
23
23
  end
24
24
 
25
+ it "reports page 1 when tested with a zero offset" do
26
+ c = Videojuicer::Resource::Collection.new(@objects[0..9], 155, 0, 10)
27
+ c.page_number.should == 1
28
+ end
29
+
25
30
  it "pagination copes with a nil limit" do
26
31
  collection = Videojuicer::Resource::Collection.new(@objects[0..9], 155, 17, nil)
27
32
  collection.page_count.should == 1
data/vj-sdk.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{vj-sdk}
8
- s.version = "0.5.1"
8
+ s.version = "0.5.2"
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"]
12
- s.date = %q{2010-04-26}
12
+ s.date = %q{2010-05-10}
13
13
  s.email = %q{dan@videojuicer.com}
14
14
  s.extra_rdoc_files = [
15
15
  "LICENSE",
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 5
8
- - 1
9
- version: 0.5.1
8
+ - 2
9
+ version: 0.5.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - danski
@@ -18,7 +18,7 @@ autorequire:
18
18
  bindir: bin
19
19
  cert_chain: []
20
20
 
21
- date: 2010-04-26 00:00:00 +01:00
21
+ date: 2010-05-10 00:00:00 +01:00
22
22
  default_executable:
23
23
  dependencies:
24
24
  - !ruby/object:Gem::Dependency