boxr 0.10.0 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -0
- data/lib/boxr/auth.rb +1 -2
- data/lib/boxr/metadata.rb +8 -8
- data/lib/boxr/version.rb +1 -1
- 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: cc55f67539d8e74fff66d7516fd9f4cc8cd2dbdb
|
4
|
+
data.tar.gz: bfaf437be6e34775e61bc9c4144740b7fa467c1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53a31ddf944b164e2363718f7308dd0ac061d7132a8707035b40a79f1382852e3442230aa91e530dce0d4384cb92fb9abea576b3e613f9a7d0f136ebebf06bfc
|
7
|
+
data.tar.gz: 048c73b9ab455c0ac31d02cffe20903054c9c30801a1c7654dde42feb46d3520a8ff3a3e64b8afff99417414fcd36a4249d4fcf430ddf29870dd4162ba0427a2
|
data/README.md
CHANGED
@@ -93,6 +93,18 @@ puts "Shared Link: #{file.shared_link.url}"
|
|
93
93
|
```
|
94
94
|
|
95
95
|
### Methods
|
96
|
+
#### [OAuth](https://developers.box.com/docs/#oauth-2)
|
97
|
+
```ruby
|
98
|
+
#NOTE: these are all module methods
|
99
|
+
|
100
|
+
Boxr::oauth_url(state, response_type: "code", scope: nil, folder_id: nil, box_client_id: ENV['BOX_CLIENT_ID'])
|
101
|
+
|
102
|
+
Boxr::get_tokens(code, grant_type: "authorization_code", username: nil, box_client_id: ENV['BOX_CLIENT_ID'], box_client_secret: ENV['BOX_CLIENT_SECRET'])
|
103
|
+
|
104
|
+
Boxr::refresh_tokens(refresh_token, box_client_id: ENV['BOX_CLIENT_ID'], box_client_secret: ENV['BOX_CLIENT_SECRET'])
|
105
|
+
|
106
|
+
Boxr::revoke_tokens(token, box_client_id: ENV['BOX_CLIENT_ID'], box_client_secret: ENV['BOX_CLIENT_SECRET'])
|
107
|
+
```
|
96
108
|
#### [Folders](https://developers.box.com/docs/#folders)
|
97
109
|
```ruby
|
98
110
|
folder_from_path(path)
|
data/lib/boxr/auth.rb
CHANGED
data/lib/boxr/metadata.rb
CHANGED
@@ -1,30 +1,30 @@
|
|
1
1
|
module Boxr
|
2
2
|
class Client
|
3
3
|
|
4
|
-
def create_metadata(file, metadata,
|
4
|
+
def create_metadata(file, metadata, scope: :global, template: :properties)
|
5
5
|
file_id = ensure_id(file)
|
6
|
-
uri = "#{METADATA_URI}/#{file_id}/metadata/#{
|
6
|
+
uri = "#{METADATA_URI}/#{file_id}/metadata/#{scope}/#{template}"
|
7
7
|
metadata, response = post(uri, metadata, content_type: "application/json")
|
8
8
|
metadata
|
9
9
|
end
|
10
10
|
|
11
|
-
def metadata(file,
|
11
|
+
def metadata(file, scope: :global, template: :properties)
|
12
12
|
file_id = ensure_id(file)
|
13
|
-
uri = "#{METADATA_URI}/#{file_id}/metadata/#{
|
13
|
+
uri = "#{METADATA_URI}/#{file_id}/metadata/#{scope}/#{template}"
|
14
14
|
metadata, response = get(uri)
|
15
15
|
metadata
|
16
16
|
end
|
17
17
|
|
18
|
-
def update_metadata(file, updates,
|
18
|
+
def update_metadata(file, updates, scope: :global, template: :properties)
|
19
19
|
file_id = ensure_id(file)
|
20
|
-
uri = "#{METADATA_URI}/#{file_id}/metadata/#{
|
20
|
+
uri = "#{METADATA_URI}/#{file_id}/metadata/#{scope}/#{template}"
|
21
21
|
metadata, response = put(uri, updates, content_type: "application/json-patch+json")
|
22
22
|
metadata
|
23
23
|
end
|
24
24
|
|
25
|
-
def delete_metadata(file,
|
25
|
+
def delete_metadata(file, scope: :global, template: :properties)
|
26
26
|
file_id = ensure_id(file)
|
27
|
-
uri = "#{METADATA_URI}/#{file_id}/metadata/#{
|
27
|
+
uri = "#{METADATA_URI}/#{file_id}/metadata/#{scope}/#{template}"
|
28
28
|
result, response = delete(uri)
|
29
29
|
result
|
30
30
|
end
|
data/lib/boxr/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: boxr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chad Burnette
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|