dropio 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/History.rdoc CHANGED
@@ -1,3 +1,9 @@
1
+ === 1.0.1 - 1.0.5 / 2009-10-08
2
+
3
+ * Final button ups.
4
+ * Addition of pingback urls and convert to parameters.
5
+ * Pagination of comments and subscriptions
6
+
1
7
  === 1.0.0 / 2009-10-02
2
8
 
3
9
  * Moved to API version 2.0
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.4"
5
+ s.version = "1.0.5"
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
@@ -71,8 +71,8 @@ class Dropio::Api
71
71
  (r.nil? or r.body.nil? or r.body.empty?) ? [] : HTTParty::Response.new(Crack::JSON.parse(r.body), r.body, r.code, r.message, r.to_hash)
72
72
  end
73
73
 
74
- def add_file_from_url(drop_name, url, token = nil)
75
- self.class.post("/drops/#{drop_name}/assets", :body => {:token => token, :file_url => url})
74
+ def add_file_from_url(drop_name, url, convert_to = nil, pingback_url = nil, token = nil)
75
+ self.class.post("/drops/#{drop_name}/assets", :body => {:token => token, :file_url => url, :convert_to => convert_to, :pingback_url => pingback_url})
76
76
  end
77
77
 
78
78
  def assets(drop_name, page = 1, order = :oldest, token = nil)
data/lib/dropio/client.rb CHANGED
@@ -65,8 +65,8 @@ class Dropio::Client
65
65
  a
66
66
  end
67
67
 
68
- def add_file_from_url(drop, url)
69
- a = handle(:asset, self.service.add_file_from_url(drop.name, url, drop.default_token))
68
+ def add_file_from_url(drop, url, convert_to = nil, pingback_url = nil)
69
+ a = handle(:asset, self.service.add_file_from_url(drop.name, url, convert_to, pingback_url, drop.default_token))
70
70
  a.drop = drop
71
71
  a
72
72
  end
data/lib/dropio/drop.rb CHANGED
@@ -53,8 +53,8 @@ class Dropio::Drop < Dropio::Resource
53
53
  end
54
54
 
55
55
  # Adds a file to the Drop from a given +url+
56
- def add_file_from_url(url)
57
- Dropio::Resource.client.add_file_from_url(self,url)
56
+ def add_file_from_url(url, convert_to = nil, pingback_url = nil)
57
+ Dropio::Resource.client.add_file_from_url(self,url, convert_to, pingback_url)
58
58
  end
59
59
 
60
60
  # Adds a file to the Drop given the +file_path+.
data/lib/dropio.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Dropio
2
- VERSION = '1.0.4'
2
+ VERSION = '1.0.5'
3
3
 
4
4
  class MissingResourceError < Exception; end
5
5
  class AuthorizationError < Exception; end
@@ -90,10 +90,18 @@ describe Drop do
90
90
  @asset = stub(Asset)
91
91
  @asset.should_receive(:drop=).once
92
92
  @client.should_receive(:handle).with(:asset,{}).and_return(@asset)
93
- @api.should_receive(:add_file_from_url).with(@mydrop.name,"http://myurl.com/myfile.txt",@mydrop.default_token).and_return({})
93
+ @api.should_receive(:add_file_from_url).with(@mydrop.name,"http://myurl.com/myfile.txt", nil, nil, @mydrop.default_token).and_return({})
94
94
  @mydrop.add_file_from_url("http://myurl.com/myfile.txt").should == @asset
95
95
  end
96
96
 
97
+ it "should add files from a url with conversion and pingback url" do
98
+ @asset = stub(Asset)
99
+ @asset.should_receive(:drop=).once
100
+ @client.should_receive(:handle).with(:asset,{}).and_return(@asset)
101
+ @api.should_receive(:add_file_from_url).with(@mydrop.name,"http://myurl.com/myfile.txt", 'H264_HIGH_RES', 'http://drop.io/test/pinged', @mydrop.default_token).and_return({})
102
+ @mydrop.add_file_from_url("http://myurl.com/myfile.txt", 'H264_HIGH_RES', 'http://drop.io/test/pinged').should == @asset
103
+ end
104
+
97
105
  it "should add files from a path" do
98
106
  @asset = stub(Asset)
99
107
  @asset.should_receive(:drop=).once
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.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jake Good