dropbox-api 0.4.5 → 0.4.6
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.
- checksums.yaml +4 -4
- data/CHANGELOG +2 -0
- data/README.markdown +18 -0
- data/lib/dropbox-api/client.rb +5 -0
- data/lib/dropbox-api/version.rb +1 -1
- data/spec/lib/dropbox-api/client_spec.rb +15 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb19d89bb55d2823fc5c6602c663f4b7e5c30ba4
|
4
|
+
data.tar.gz: 1c0de62cfc0bd909339244ae28e93183c31b0b8b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 012efcbfecf3485c7d8f71cb56a158c19bebd478430b7423d65bc68a07525fb32c198f92e6acd7a2193aa003b6bd82cf9e1189c890160e408945e501cd354e08
|
7
|
+
data.tar.gz: a93b3a07bf3641994f516cfa5bbb59f0df63d6f833fde00ddce74b21b061ef2d9d1b1de6358b408f1f56f7b0daedfbe96ebd8e8702ac69ec11193e82d587c775
|
data/CHANGELOG
CHANGED
data/README.markdown
CHANGED
@@ -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
|
data/lib/dropbox-api/client.rb
CHANGED
@@ -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))
|
data/lib/dropbox-api/version.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2014-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|