dropio 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/dropio.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{dropio}
5
- s.version = "1.0.3"
5
+ s.version = "1.0.4"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Jake Good"]
data/lib/dropio/api.rb CHANGED
@@ -122,8 +122,8 @@ class Dropio::Api
122
122
  self.class.post("/drops/#{drop_name}/assets/#{asset_name}/move", :body => params)
123
123
  end
124
124
 
125
- def comments(drop_name, asset_name, token = nil)
126
- self.class.get("/drops/#{drop_name}/assets/#{asset_name}/comments", :query => {:token => token})
125
+ def comments(drop_name, asset_name, page = 1, token = nil)
126
+ self.class.get("/drops/#{drop_name}/assets/#{asset_name}/comments", :query => {:token => token, :page => page})
127
127
  end
128
128
 
129
129
  def create_comment(drop_name, asset_name, contents, token = nil)
@@ -151,8 +151,8 @@ class Dropio::Api
151
151
  self.class.post("/drops/#{drop_name}/subscriptions", :body => params)
152
152
  end
153
153
 
154
- def subscriptions(drop_name, admin_token)
155
- self.class.get("/drops/#{drop_name}/subscriptions", :query => {:token => admin_token})
154
+ def subscriptions(drop_name, page, admin_token)
155
+ self.class.get("/drops/#{drop_name}/subscriptions", :query => {:token => admin_token, :page => page})
156
156
  end
157
157
 
158
158
 
data/lib/dropio/asset.rb CHANGED
@@ -12,9 +12,8 @@ class Dropio::Asset < Dropio::Resource
12
12
  # Returns the comments on this Asset. Comments are loaded lazily. The first
13
13
  # call to +comments+ will fetch the comments from the server. They are then
14
14
  # cached until the Asset is reloaded.
15
- def comments
16
- @comments = Dropio::Resource.client.comments(self) if @comments.nil?
17
- @comments ||= []
15
+ def comments(page = 1)
16
+ @comments = Dropio::Resource.client.comments(self, page)
18
17
  end
19
18
 
20
19
  # Gets the Assets's embed code
data/lib/dropio/client.rb CHANGED
@@ -129,8 +129,8 @@ class Dropio::Client
129
129
  r["result"]
130
130
  end
131
131
 
132
- def comments(asset)
133
- comments = handle(:comments, self.service.comments(asset.drop.name,asset.name,asset.drop.default_token))
132
+ def comments(asset, page = 1)
133
+ comments = handle(:comments, self.service.comments(asset.drop.name,asset.name,page,asset.drop.default_token))
134
134
  comments.each{|c| c.asset = asset}
135
135
  comments
136
136
  end
@@ -170,8 +170,8 @@ class Dropio::Client
170
170
  s
171
171
  end
172
172
 
173
- def subscriptions(drop)
174
- subscriptions = handle(:subscriptions, self.service.subscriptions(drop.name, drop.admin_token))
173
+ def subscriptions(drop, page = 1)
174
+ subscriptions = handle(:subscriptions, self.service.subscriptions(drop.name,page,drop.admin_token))
175
175
  subscriptions.each{|s| s.drop = drop}
176
176
  subscriptions
177
177
  end
data/lib/dropio/drop.rb CHANGED
@@ -83,8 +83,8 @@ class Dropio::Drop < Dropio::Resource
83
83
  end
84
84
 
85
85
  # Gets a list of Subscription objects.
86
- def subscriptions
87
- Dropio::Resource.client.subscriptions(self)
86
+ def subscriptions(page = 1)
87
+ Dropio::Resource.client.subscriptions(self, page)
88
88
  end
89
89
 
90
90
  # Generates an authenticated URL that will bypass any login action.
data/lib/dropio.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Dropio
2
- VERSION = '1.0.3'
2
+ VERSION = '1.0.4'
3
3
 
4
4
  class MissingResourceError < Exception; end
5
5
  class AuthorizationError < Exception; end
@@ -27,7 +27,7 @@ describe Dropio::Asset do
27
27
  @comment = stub(Comment)
28
28
  @comment.should_receive(:asset=).once
29
29
  @client.should_receive(:handle).with(:comments,{}).and_return([@comment])
30
- @api.stub!(:comments).with(@drop.name, @asset.name, @drop.default_token).and_return({})
30
+ @api.stub!(:comments).with(@drop.name, @asset.name, 1, @drop.default_token).and_return({})
31
31
  @asset.comments.should == [@comment]
32
32
  end
33
33
 
@@ -146,7 +146,7 @@ describe Drop do
146
146
  @sub = stub(Subscription)
147
147
  @sub.should_receive(:drop=).once
148
148
  @client.should_receive(:handle).with(:subscriptions,{}).and_return([@sub])
149
- @api.stub!(:subscriptions).with(@mydrop.name, @mydrop.admin_token).and_return({})
149
+ @api.stub!(:subscriptions).with(@mydrop.name, 1, @mydrop.admin_token).and_return({})
150
150
  @mydrop.subscriptions.should == [@sub]
151
151
  end
152
152
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dropio
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jake Good