dropbox_api 0.1.6 β 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/TODO.md +6 -1
- data/api_coverage.md +2 -2
- data/lib/dropbox_api.rb +6 -0
- data/lib/dropbox_api/endpoints/files/copy_reference_get.rb +21 -0
- data/lib/dropbox_api/endpoints/files/copy_reference_save.rb +22 -0
- data/lib/dropbox_api/errors/basic_error.rb +1 -0
- data/lib/dropbox_api/errors/get_copy_reference_error.rb +7 -0
- data/lib/dropbox_api/errors/save_copy_reference_error.rb +11 -0
- data/lib/dropbox_api/results/get_copy_reference_result.rb +20 -0
- data/lib/dropbox_api/results/save_copy_reference_result.rb +8 -0
- data/lib/dropbox_api/version.rb +1 -1
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5dde8e23c02270cb1b1cc29c059d03ae27b9160f
|
4
|
+
data.tar.gz: d398b3b9c4fc2edc3f190bea2a35e9dbaf4ae0fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f174851e2e863c779082a8d5fdfa39b46ac62effb31215514a01f0ed34d5bfabe33da4fd0a7df06b331c4999e8f3683c57e712757e1a49e31ced9176d7ad4cc
|
7
|
+
data.tar.gz: 28efd74cffc713594babe9a55318c447d541fad2ac5d8c1c3acde120b1f034fa16ecb6264c90545c9ef506e6daf6d3f26d7bdb95424c6193d5eea15771ad2a72
|
data/TODO.md
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
- Rebuild spec fixtures for `list_folder`.
|
4
4
|
- Add documentation on how to rebuild spec fixtures.
|
5
|
+
- Chunked downloads, issue #8.
|
6
|
+
- Chunked uploads, issue #18.
|
5
7
|
|
6
8
|
# Upcoming
|
7
9
|
|
@@ -46,4 +48,7 @@ Release process:
|
|
46
48
|
|
47
49
|
## Publish doc
|
48
50
|
|
49
|
-
1.
|
51
|
+
1. `yardoc`
|
52
|
+
2. Change dir to dropbox_api_doc, where branch gh-pages is checked out.
|
53
|
+
3. Replace files with the updated ones.
|
54
|
+
4. `git commit` & `git push origin gh-pages`.
|
data/api_coverage.md
CHANGED
@@ -15,8 +15,8 @@ what new moon means.
|
|
15
15
|
API call | Status
|
16
16
|
--- | :---:
|
17
17
|
`/copy` | π
|
18
|
-
`/copy_reference/get` |
|
19
|
-
`/copy_reference/save` |
|
18
|
+
`/copy_reference/get` | π
|
19
|
+
`/copy_reference/save` | π
|
20
20
|
`/create_folder` | π
|
21
21
|
`/delete` | π
|
22
22
|
`/download` | π
|
data/lib/dropbox_api.rb
CHANGED
@@ -57,6 +57,8 @@ require 'dropbox_api/errors/search_error'
|
|
57
57
|
require 'dropbox_api/errors/settings_error'
|
58
58
|
require 'dropbox_api/errors/share_path_error'
|
59
59
|
require 'dropbox_api/errors/share_folder_error'
|
60
|
+
require 'dropbox_api/errors/get_copy_reference_error'
|
61
|
+
require 'dropbox_api/errors/save_copy_reference_error'
|
60
62
|
require 'dropbox_api/errors/create_folder_error'
|
61
63
|
require 'dropbox_api/errors/create_shared_link_with_settings_error'
|
62
64
|
require 'dropbox_api/errors/delete_error'
|
@@ -88,6 +90,8 @@ require 'dropbox_api/errors/get_account_error'
|
|
88
90
|
require 'dropbox_api/result_builder'
|
89
91
|
require 'dropbox_api/results/base'
|
90
92
|
require 'dropbox_api/results/basic_account_batch'
|
93
|
+
require 'dropbox_api/results/get_copy_reference_result'
|
94
|
+
require 'dropbox_api/results/save_copy_reference_result'
|
91
95
|
require 'dropbox_api/results/add_file_member_result_list'
|
92
96
|
require 'dropbox_api/results/get_temporary_link_result'
|
93
97
|
require 'dropbox_api/results/list_folder_result'
|
@@ -114,6 +118,8 @@ require 'dropbox_api/endpoints/content_download'
|
|
114
118
|
require 'dropbox_api/endpoints/content_upload'
|
115
119
|
require 'dropbox_api/endpoints/options_validator'
|
116
120
|
require 'dropbox_api/endpoints/files/copy'
|
121
|
+
require 'dropbox_api/endpoints/files/copy_reference_get'
|
122
|
+
require 'dropbox_api/endpoints/files/copy_reference_save'
|
117
123
|
require 'dropbox_api/endpoints/files/create_folder'
|
118
124
|
require 'dropbox_api/endpoints/files/delete'
|
119
125
|
require 'dropbox_api/endpoints/files/download'
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module DropboxApi::Endpoints::Files
|
2
|
+
class CopyReferenceGet < DropboxApi::Endpoints::Rpc
|
3
|
+
Method = :post
|
4
|
+
Path = "/2/files/copy_reference/get".freeze
|
5
|
+
ResultType = DropboxApi::Results::GetCopyReferenceResult
|
6
|
+
ErrorType = DropboxApi::Errors::GetCopyReferenceError
|
7
|
+
|
8
|
+
# Get a copy reference to a file or folder.
|
9
|
+
# This reference string can be used to save that file or folder
|
10
|
+
# to another user's Dropbox by passing it to {Client#copy_reference_save}.
|
11
|
+
#
|
12
|
+
# @param path [String] The path to the file or folder you want to get a
|
13
|
+
# copy reference to.
|
14
|
+
# @return [DropboxApi::Results::GetCopyReferenceResult]
|
15
|
+
add_endpoint :copy_reference_get do |path|
|
16
|
+
perform_request({
|
17
|
+
:path => path
|
18
|
+
})
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module DropboxApi::Endpoints::Files
|
2
|
+
class CopyReferenceSave < DropboxApi::Endpoints::Rpc
|
3
|
+
Method = :post
|
4
|
+
Path = "/2/files/copy_reference/save".freeze
|
5
|
+
ResultType = DropboxApi::Results::SaveCopyReferenceResult
|
6
|
+
ErrorType = DropboxApi::Errors::SaveCopyReferenceError
|
7
|
+
|
8
|
+
# Save a copy reference returned by {Client#copy_reference_get} to the
|
9
|
+
# user's Dropbox.
|
10
|
+
#
|
11
|
+
# @param copy_reference [String] A copy reference returned by
|
12
|
+
# {Client#copy_reference_get}.
|
13
|
+
# @param path [String] Path in the user's Dropbox that is the destination.
|
14
|
+
# @return [DropboxApi::Results::SaveCopyReferenceResult]
|
15
|
+
add_endpoint :copy_reference_save do |copy_reference, path|
|
16
|
+
perform_request({
|
17
|
+
:copy_reference => copy_reference,
|
18
|
+
:path => path
|
19
|
+
})
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -54,6 +54,7 @@ module DropboxApi::Errors
|
|
54
54
|
class InsufficientSpaceError < BasicError; end
|
55
55
|
class InternalError < BasicError; end
|
56
56
|
class InvalidCommentError < BasicError; end
|
57
|
+
class InvalidCopyReferenceError < BasicError; end
|
57
58
|
class InvalidCursorError < BasicError; end
|
58
59
|
class InvalidDropboxIdError < BasicError; end
|
59
60
|
class InvalidEmailError < BasicError; end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module DropboxApi::Errors
|
2
|
+
class SaveCopyReferenceError < BasicError
|
3
|
+
ErrorSubtypes = {
|
4
|
+
:path => WriteError,
|
5
|
+
:invalid_copy_reference => InvalidCopyReferenceError,
|
6
|
+
:no_permission => NoPermissionError,
|
7
|
+
:not_found => NotFoundError,
|
8
|
+
:too_many_files => TooManyFilesError
|
9
|
+
}.freeze
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module DropboxApi::Results
|
2
|
+
class GetCopyReferenceResult < DropboxApi::Results::Base
|
3
|
+
# Metadata of the file or folder.
|
4
|
+
def resource
|
5
|
+
@resource ||= DropboxApi::Metadata::Resource.new @data["metadata"]
|
6
|
+
end
|
7
|
+
|
8
|
+
# A copy reference to the file or folder.
|
9
|
+
def copy_reference
|
10
|
+
@copy_reference ||= @data["copy_reference"]
|
11
|
+
end
|
12
|
+
|
13
|
+
# The expiration date of the copy reference.
|
14
|
+
# This value is currently set to be far enough in the future
|
15
|
+
# so that expiration is effectively not an issue.
|
16
|
+
def expires
|
17
|
+
@expires ||= Time.parse(@data["expires"])
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/dropbox_api/version.rb
CHANGED
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.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JesΓΊs Burgos
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -143,6 +143,8 @@ files:
|
|
143
143
|
- lib/dropbox_api/endpoints/content_download.rb
|
144
144
|
- lib/dropbox_api/endpoints/content_upload.rb
|
145
145
|
- lib/dropbox_api/endpoints/files/copy.rb
|
146
|
+
- lib/dropbox_api/endpoints/files/copy_reference_get.rb
|
147
|
+
- lib/dropbox_api/endpoints/files/copy_reference_save.rb
|
146
148
|
- lib/dropbox_api/endpoints/files/create_folder.rb
|
147
149
|
- lib/dropbox_api/endpoints/files/delete.rb
|
148
150
|
- lib/dropbox_api/endpoints/files/download.rb
|
@@ -189,6 +191,7 @@ files:
|
|
189
191
|
- lib/dropbox_api/errors/download_error.rb
|
190
192
|
- lib/dropbox_api/errors/file_member_action_error.rb
|
191
193
|
- lib/dropbox_api/errors/get_account_error.rb
|
194
|
+
- lib/dropbox_api/errors/get_copy_reference_error.rb
|
192
195
|
- lib/dropbox_api/errors/get_metadata_error.rb
|
193
196
|
- lib/dropbox_api/errors/http_error.rb
|
194
197
|
- lib/dropbox_api/errors/list_folder_continue_error.rb
|
@@ -201,6 +204,7 @@ files:
|
|
201
204
|
- lib/dropbox_api/errors/preview_error.rb
|
202
205
|
- lib/dropbox_api/errors/relocation_error.rb
|
203
206
|
- lib/dropbox_api/errors/restore_error.rb
|
207
|
+
- lib/dropbox_api/errors/save_copy_reference_error.rb
|
204
208
|
- lib/dropbox_api/errors/save_url_error.rb
|
205
209
|
- lib/dropbox_api/errors/search_error.rb
|
206
210
|
- lib/dropbox_api/errors/settings_error.rb
|
@@ -256,12 +260,14 @@ files:
|
|
256
260
|
- lib/dropbox_api/results/add_file_member_result_list.rb
|
257
261
|
- lib/dropbox_api/results/base.rb
|
258
262
|
- lib/dropbox_api/results/basic_account_batch.rb
|
263
|
+
- lib/dropbox_api/results/get_copy_reference_result.rb
|
259
264
|
- lib/dropbox_api/results/get_temporary_link_result.rb
|
260
265
|
- lib/dropbox_api/results/list_folder_get_latest_cursor_result.rb
|
261
266
|
- lib/dropbox_api/results/list_folder_longpoll_result.rb
|
262
267
|
- lib/dropbox_api/results/list_folder_result.rb
|
263
268
|
- lib/dropbox_api/results/list_revisions_result.rb
|
264
269
|
- lib/dropbox_api/results/list_shared_links_result.rb
|
270
|
+
- lib/dropbox_api/results/save_copy_reference_result.rb
|
265
271
|
- lib/dropbox_api/results/save_url_job_status.rb
|
266
272
|
- lib/dropbox_api/results/save_url_result.rb
|
267
273
|
- lib/dropbox_api/results/search/match.rb
|