dropbox_api 0.1.5 β†’ 0.1.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: c0eede08a0f815d30642620662824beb4772cd27
4
- data.tar.gz: ffcd6a73b9f84613db886767ea931d86c23189b4
3
+ metadata.gz: 7b389b70a2387d0fdb49c3fdb6f2eee7f668c8a6
4
+ data.tar.gz: d3e52de1f131820d0bef5ceef1317d3e27f87bf7
5
5
  SHA512:
6
- metadata.gz: 9135f8db610192f4ec44b63b9133a61d06d0610f8c070732f8164e00f27ecb2a68c27b5aaf2b1092c44cb97cff980aaa2afca322146cbc07b9f6d86afff1a8c3
7
- data.tar.gz: cc47310f7f6007517a1074137c5872c51c4f8da491f1ef09391c7a7d3678ae102e37c336af9cdaeddcb6f39da1601363b4f4f25ebf5c71285422f73086543d0c
6
+ metadata.gz: 3a6069d423d4a9166875aaaa13d7a10147eddc28035eaa46e330bf63e05ed9c88d3397ca42085a1135aaccf12f7059cb3f8b27ae5fa8af000c3e0085e3e2873f
7
+ data.tar.gz: 5a589ff7f10403e2dca274742b2e22f27f1ab370094f47168f6f16b543b569d92b0dd8da40e45cb33043b74a6319a4caa1eabbba098a190ce0047372ad25b59b
data/.yardopts CHANGED
@@ -1,8 +1,9 @@
1
- --load yardoc/endpoint_handler.rb
2
- --load yardoc/rspec.rb
3
- --load yardoc/helpers/html_helper.rb
1
+ --load ./yardoc/endpoint_handler.rb
2
+ --plugin rspec
4
3
  lib/**/*.rb
5
4
  spec/endpoints/**/*_spec.rb
5
+ --markup=markdown
6
+ --markup-provider=redcarpet
6
7
  -
7
8
  api_coverage.md
8
9
  rails_setup.md
data/Gemfile CHANGED
@@ -1,3 +1,7 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
+
5
+ # Documentation
6
+ gem 'yard-rspec', :git => "https://github.com/Jesus/yard-spec-plugin.git"
7
+ gem 'redcarpet'
data/README.md CHANGED
@@ -18,7 +18,23 @@ Or install it yourself as:
18
18
 
19
19
  $ gem install dropbox_api
20
20
 
21
- ## Usage
21
+ ## Documentation
22
+
23
+ Please, refer to this gem's custom [Dropbox API
24
+ documentation](http://jesus.github.io/dropbox_api).
25
+ Most of the time you'll be checking the [available
26
+ endpoints](http://jesus.github.io/dropbox_api/DropboxApi/Client.html).
27
+
28
+ Unfortunately, the documentation at [RubyDoc.info](http://www.rubydoc.info) is
29
+ disrecommended because it lacks some nice features that have been added with
30
+ YARD plugins:
31
+
32
+ - Each endpoint includes its tests right below the description, this works as
33
+ an example of its usage.
34
+ - All endpoints are shown as methods of the `Client` class, just as you will
35
+ use them.
36
+
37
+ ## Basic set up
22
38
 
23
39
  ### Authorize your application
24
40
 
@@ -76,7 +92,7 @@ Dropbox's [OAuth guide]
76
92
  (https://www.dropbox.com/developers/reference/oauth-guide#oauth-2-on-the-web).
77
93
 
78
94
  If you have a Rails application, you might be interested in this [setup
79
- guide](http://www.rubydoc.info/gems/dropbox_api/file/rails_setup.md).
95
+ guide](http://jesus.github.io/dropbox_api/file.rails_setup.html).
80
96
 
81
97
  ### Performing API calls
82
98
 
@@ -100,32 +116,17 @@ result.has_more?
100
116
 
101
117
  The instance of `Client` we've initialized is the one you'll be using to
102
118
  perform API calls. You can check the class' documentation to find
103
- [all available endpoints]
104
- (http://www.rubydoc.info/gems/dropbox_api/DropboxApi/Client)
105
-
106
- ## Dependencies
107
-
108
- ### Network adapter
109
-
110
- This gem uses [faraday](https://github.com/lostisland/faraday#faraday).
111
- So it should work on any network library.
119
+ [all available endpoints](http://jesus.github.io/dropbox_api/DropboxApi/Client.html)
112
120
 
113
121
  ## Development
114
122
 
115
123
  After checking out the repo, run `bin/setup` to install dependencies. Then, run
116
124
  `bin/console` for an interactive prompt that will allow you to experiment.
117
125
 
118
- To install this gem onto your local machine, run `bundle exec rake install`. To
119
- release a new version, update the version number in `version.rb`, and then run
120
- `bundle exec rake release` to create a git tag for the version, push git
121
- commits and tags, and push the `.gem` file to
122
- [rubygems.org](https://rubygems.org).
123
-
124
126
  ## Contributing
125
127
 
126
128
  Any help will be much appreciated. The easiest way to help is to implement one
127
- or more of the [endpoints that are still pending]
128
- (http://www.rubydoc.info/gems/dropbox_api/file/api_coverage.md). To see how the
129
+ or more of the [endpoints that are still pending](http://jesus.github.io/dropbox_api/file.api_coverage.html). To see how the
129
130
  endpoints are implemented, check out the `lib/dropbox_api/endpoints` folder.
130
131
 
131
132
  If you want to help but you're unsure how to get started, please get in touch
data/Rakefile CHANGED
@@ -1,5 +1,6 @@
1
1
  require "bundler/gem_tasks"
2
2
  require "rspec/core/rake_task"
3
+ require File.expand_path('../spec/support/rake_tasks', __FILE__)
3
4
 
4
5
  RSpec::Core::RakeTask.new(:spec)
5
6
 
data/TODO.md CHANGED
@@ -1,3 +1,8 @@
1
+ # TODO now!
2
+
3
+ - Rebuild spec fixtures for `list_folder`.
4
+ - Add documentation on how to rebuild spec fixtures.
5
+
1
6
  # Upcoming
2
7
 
3
8
  TOKEN: VofXAX8DO1sAAAAAAAAEEyqrmzbYmFVaDQKj48yVUfhyhfOomXiG8emqP1xQGRnJ
@@ -24,8 +29,6 @@ TOKEN: VofXAX8DO1sAAAAAAAAEEyqrmzbYmFVaDQKj48yVUfhyhfOomXiG8emqP1xQGRnJ
24
29
 
25
30
  # Further on
26
31
 
27
- - Improve the API reference page, help here:
28
- http://gnuu.org/2009/11/18/customizing-yard-templates/
29
32
  - Supporting streams would be great.
30
33
  - Add a layer to handle pagination, use `Enumerable`.
31
34
 
@@ -40,3 +43,7 @@ Release process:
40
43
  3. `git fetch`
41
44
  4. `gem build dropbox_api.gemspec`
42
45
  5. `gem push dropbox_api-version.gem`
46
+
47
+ ## Publish doc
48
+
49
+ 1.
data/api_coverage.md CHANGED
@@ -89,7 +89,7 @@ API call | Status
89
89
  `/share_folder` | πŸŒ•
90
90
  `/transfer_folder` | πŸŒ‘
91
91
  `/unmount_folder` | πŸŒ‘
92
- `/unshare_file` | πŸŒ‘
92
+ `/unshare_file` | πŸŒ•
93
93
  `/unshare_folder` | πŸŒ‘
94
94
  `/update_folder_member` | πŸŒ‘
95
95
  `/update_folder_policy` | πŸŒ‘
data/lib/dropbox_api.rb CHANGED
@@ -78,6 +78,7 @@ require 'dropbox_api/errors/upload_session_lookup_error'
78
78
  require 'dropbox_api/errors/upload_session_finish_error'
79
79
  require 'dropbox_api/errors/upload_write_failed_error'
80
80
  require 'dropbox_api/errors/upload_error'
81
+ require 'dropbox_api/errors/unshare_file_error'
81
82
  require 'dropbox_api/errors/poll_error'
82
83
  require 'dropbox_api/errors/add_file_member_error'
83
84
  require 'dropbox_api/errors/add_folder_member_error'
@@ -140,6 +141,7 @@ require 'dropbox_api/endpoints/sharing/list_folder_members'
140
141
  require 'dropbox_api/endpoints/sharing/share_folder'
141
142
  require 'dropbox_api/endpoints/sharing/list_shared_links'
142
143
  require 'dropbox_api/endpoints/sharing/create_shared_link_with_settings'
144
+ require 'dropbox_api/endpoints/sharing/unshare_file'
143
145
  require 'dropbox_api/endpoints/users/get_account'
144
146
  require 'dropbox_api/endpoints/users/get_account_batch'
145
147
  require 'dropbox_api/endpoints/users/get_current_account'
@@ -31,7 +31,7 @@ module DropboxApi::Endpoints::Files
31
31
 
32
32
  DropboxApi::Metadata::UploadSessionCursor.new({
33
33
  "session_id" => session.session_id,
34
- "offset" => content.size
34
+ "offset" => content.bytesize
35
35
  })
36
36
  end
37
37
  end
@@ -0,0 +1,19 @@
1
+ module DropboxApi::Endpoints::Sharing
2
+ class UnshareFile < DropboxApi::Endpoints::Rpc
3
+ Method = :post
4
+ Path = "/2/sharing/unshare_file".freeze
5
+ ResultType = DropboxApi::Results::VoidResult
6
+ ErrorType = DropboxApi::Errors::UnshareFileError
7
+
8
+ # Remove all members from this file. Does not remove inherited members.
9
+ #
10
+ # A successful response indicates that the file was unshared.
11
+ #
12
+ # @param file [String] Path or ID of the file in the user's Dropbox to unshare.
13
+ add_endpoint :unshare_file do |file|
14
+ perform_request({
15
+ :file => file
16
+ })
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,8 @@
1
+ module DropboxApi::Errors
2
+ class UnshareFileError < BasicError
3
+ ErrorSubtypes = {
4
+ :user_error => SharingUserError,
5
+ :access_error => SharingFileAccessError
6
+ }.freeze
7
+ end
8
+ end
@@ -25,6 +25,7 @@ module DropboxApi::Metadata
25
25
  field :server_modified, Time
26
26
  field :rev, String
27
27
  field :size, Integer
28
+ field :content_hash, String, :optional
28
29
 
29
30
  def to_hash
30
31
  super.merge(".tag" => "file")
@@ -1,3 +1,3 @@
1
1
  module DropboxApi
2
- VERSION = '0.1.5'.freeze
2
+ VERSION = '0.1.6'.freeze
3
3
  end
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.5
4
+ version: 0.1.6
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-01-14 00:00:00.000000000 Z
11
+ date: 2017-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -173,6 +173,7 @@ files:
173
173
  - lib/dropbox_api/endpoints/sharing/list_folder_members.rb
174
174
  - lib/dropbox_api/endpoints/sharing/list_shared_links.rb
175
175
  - lib/dropbox_api/endpoints/sharing/share_folder.rb
176
+ - lib/dropbox_api/endpoints/sharing/unshare_file.rb
176
177
  - lib/dropbox_api/endpoints/users/get_account.rb
177
178
  - lib/dropbox_api/endpoints/users/get_account_batch.rb
178
179
  - lib/dropbox_api/endpoints/users/get_current_account.rb
@@ -209,6 +210,7 @@ files:
209
210
  - lib/dropbox_api/errors/sharing_file_access_error.rb
210
211
  - lib/dropbox_api/errors/sharing_user_error.rb
211
212
  - lib/dropbox_api/errors/too_many_requests_error.rb
213
+ - lib/dropbox_api/errors/unshare_file_error.rb
212
214
  - lib/dropbox_api/errors/upload_error.rb
213
215
  - lib/dropbox_api/errors/upload_session_finish_error.rb
214
216
  - lib/dropbox_api/errors/upload_session_lookup_error.rb