dropio 1.0.1 → 1.0.2

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.1"
5
+ s.version = "1.0.2"
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
@@ -55,14 +55,15 @@ class Dropio::Api
55
55
  self.class.post("/drops/#{drop_name}/assets", :body => params)
56
56
  end
57
57
 
58
- def add_file(drop_name, file_path, comment = nil, token = nil)
58
+ def add_file(drop_name, file_path, convert_to = nil, pingback_url = nil, comment = nil, token = nil)
59
59
  url = URI.parse("http://assets.drop.io/upload/")
60
60
  r = nil
61
61
  File.open(file_path) do |file|
62
62
  mime_type = (MIME::Types.type_for(file_path)[0] || MIME::Types["application/octet-stream"][0])
63
63
  req = Net::HTTP::Post::Multipart.new url.path,
64
64
  { 'api_key' => self.class.default_params[:api_key], 'drop_name' => drop_name, 'format' => 'json',
65
- 'token' => token, 'version' => '2.0', 'comment' => comment, 'file' => UploadIO.new(file, mime_type, file_path) }
65
+ 'token' => token, 'version' => '2.0', 'convert_to' => convert_to, 'pingback_url' => pingback_url,
66
+ 'comment' => comment, 'file' => UploadIO.new(file, mime_type, file_path) }
66
67
  http = Net::HTTP.new(url.host, url.port)
67
68
  r = http.start{|http| http.request(req)}
68
69
  end
data/lib/dropio/client.rb CHANGED
@@ -59,8 +59,8 @@ class Dropio::Client
59
59
  a
60
60
  end
61
61
 
62
- def add_file(drop, file_path, comment = nil)
63
- a = handle(:asset, self.service.add_file(drop.name, file_path, drop.default_token, comment))
62
+ def add_file(drop, file_path, convert_to = nil, pingback_url = nil, comment = nil)
63
+ a = handle(:asset, self.service.add_file(drop.name, file_path, convert_to, pingback_url, comment, drop.default_token))
64
64
  a.drop = drop
65
65
  a
66
66
  end
data/lib/dropio/drop.rb CHANGED
@@ -58,8 +58,8 @@ class Dropio::Drop < Dropio::Resource
58
58
  end
59
59
 
60
60
  # Adds a file to the Drop given the +file_path+.
61
- def add_file(file_path, comment = nil)
62
- Dropio::Resource.client.add_file(self, file_path, comment)
61
+ def add_file(file_path, convert_to = nil, pingback_url = nil, comment = nil)
62
+ Dropio::Resource.client.add_file(self, file_path, convert_to, pingback_url, comment)
63
63
  end
64
64
 
65
65
  # Creates a note with a +title+ and +contents+
data/lib/dropio.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Dropio
2
- VERSION = '1.0.1'
2
+ VERSION = '1.0.2'
3
3
 
4
4
  class MissingResourceError < Exception; end
5
5
  class AuthorizationError < Exception; end
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.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jake Good