dropbox-api 0.4.5 → 0.4.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 479b56344f30f924e5356feb539d00639397d4bd
4
- data.tar.gz: cc4e16ab4d6507626469ab4172cf1860d7d9888b
3
+ metadata.gz: cb19d89bb55d2823fc5c6602c663f4b7e5c30ba4
4
+ data.tar.gz: 1c0de62cfc0bd909339244ae28e93183c31b0b8b
5
5
  SHA512:
6
- metadata.gz: 4dc5213599843a81ad89b47842a1298063150d9e658e543df9bc5641bd1678319bcdb796ff51caeba33fb849b264a45ee5372b7a4fb4990634a1f7afc07bb1cb
7
- data.tar.gz: 059424661b5c12a9263a6f828c192dffaa8fe35cc13b41a438a8d9da8e04aa7dc0296c74f874da61f271d66cb34e6a3d60c4ae2afb0604dd8a2674b4d839a79a
6
+ metadata.gz: 012efcbfecf3485c7d8f71cb56a158c19bebd478430b7423d65bc68a07525fb32c198f92e6acd7a2193aa003b6bd82cf9e1189c890160e408945e501cd354e08
7
+ data.tar.gz: a93b3a07bf3641994f516cfa5bbb59f0df63d6f833fde00ddce74b21b061ef2d9d1b1de6358b408f1f56f7b0daedfbe96ebd8e8702ac69ec11193e82d587c775
data/CHANGELOG CHANGED
@@ -1,3 +1,5 @@
1
+ 0.4.6
2
+ + Add Dropbox::API::Client#destroy
1
3
  0.4.5
2
4
  + Add Dropbox::API::Client#chunked_upload
3
5
  0.4.4
@@ -173,6 +173,16 @@ When provided a path, returns a single file or directory
173
173
  client.find 'file.txt' # => #<Dropbox::API::File>
174
174
  ```
175
175
 
176
+ ### Dropbox::API::Client#destroy
177
+
178
+ Removes the file specified by path
179
+
180
+ Returns a Dropbox::API::File object of the deleted file
181
+
182
+ ```ruby
183
+ client.destroy 'file.txt' # => #<Dropbox::API::File>
184
+ ```
185
+
176
186
  ### Dropbox::API::Client#ls
177
187
 
178
188
  When provided a path, returns a list of files or directories within that path
@@ -205,6 +215,14 @@ Stores a file with a provided body under a provided name and returns a Dropbox::
205
215
  client.upload 'file.txt', 'file body' # => #<Dropbox::API::File>
206
216
  ```
207
217
 
218
+ ### Dropbox::API::Client#chunked_upload
219
+
220
+ Stores a file from a File object under a provided name and returns a Dropbox::API::File object. It should be used for larger files.
221
+
222
+ ```ruby
223
+ client.chunked_upload 'file.txt', File.open('file.txt') # => #<Dropbox::API::File>
224
+ ```
225
+
208
226
  ### Dropbox::API::Client#download
209
227
 
210
228
  Downloads a file with a provided name and returns it's content
@@ -37,6 +37,11 @@ module Dropbox
37
37
  Dropbox::API::Dir.init(response, self)
38
38
  end
39
39
 
40
+ def destroy(path, options = {})
41
+ response = raw.delete({ :path => path }.merge(options))
42
+ Dropbox::API::Object.convert(response, self)
43
+ end
44
+
40
45
  def search(term, options = {})
41
46
  options[:path] ||= ''
42
47
  results = raw.search({ :query => term }.merge(options))
@@ -1,5 +1,5 @@
1
1
  module Dropbox
2
2
  module API
3
- VERSION = "0.4.5"
3
+ VERSION = "0.4.6"
4
4
  end
5
5
  end
@@ -135,6 +135,21 @@ describe Dropbox::API::Client do
135
135
 
136
136
  end
137
137
 
138
+ describe "#destroy" do
139
+
140
+ before do
141
+ @client = Dropbox::Spec.instance
142
+ @filename = "#{Dropbox::Spec.test_dir}/spec-test-#{Time.now.to_i}.txt"
143
+ @file = @client.upload @filename, "spec file"
144
+ end
145
+
146
+ it "destroys the file properly" do
147
+ file = @client.destroy(@filename)
148
+ file.is_deleted.should == true
149
+ end
150
+
151
+ end
152
+
138
153
  describe "#search" do
139
154
 
140
155
  let(:term) { "searchable-test-#{Dropbox::Spec.namespace}" }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dropbox-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.5
4
+ version: 0.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcin Bunsch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-31 00:00:00.000000000 Z
11
+ date: 2014-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json