boxr 0.7.0 → 0.8.0

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: c0c27f80c271f3f13e8b2fb13946467f136b1955
4
- data.tar.gz: 1ad858f6831a877a0f03dccf822941a4d6a91bb3
3
+ metadata.gz: 0aa4abe4312f4c46511db9986e8ad93b35b8cfe8
4
+ data.tar.gz: 47fb80ce3be0012b8690957bcc0e284d86e9c1c2
5
5
  SHA512:
6
- metadata.gz: c62b62f3fd96d3a71edc34c636f7df4b1280ab91af52a4f899d7cde3250b3c9cafd0dc31e1b3ecee1cdf05e4f7a564cc4cb23961b2a355cd9f3729afe16b7924
7
- data.tar.gz: 7d6fd3a95d20051270074956ed1379ade4bc2fbd999b58033056bf7967e5a5c59cb790d502094af23b9a55dc7a0f8a0c7ae1923059fd1d4c0f072c21ceba457d
6
+ metadata.gz: 53efb9140c1c6b83d14d83a825aad2541423f98508cb659b9946d093a5455ad675dc8abd9d71a19d8252c4b7e0ff4ce9d4c4d1330de132743a46d83c2244a26b
7
+ data.tar.gz: 7b93b21a33d06744eb47aa6af0c6352b54a358da83a5c7663b91163830e7a92117e122627cec995c3c7df2eb9e9dcca3f69578c98c214554d3467ed7295cbff6
data/README.md CHANGED
@@ -92,6 +92,9 @@ puts "Shared Link: #{file.shared_link.url}"
92
92
  #### [Folders](https://developers.box.com/docs/#folders)
93
93
  ```ruby
94
94
  folder_from_path(path)
95
+
96
+ folder_from_id(folder_id, fields: [])
97
+ alias :folder :folder_from_id
95
98
 
96
99
  folder_items(folder, fields: [], offset: 0, limit: FOLDER_ITEMS_LIMIT)
97
100
 
@@ -99,8 +102,6 @@ root_folder_items(fields: [], offset: 0, limit: FOLDER_ITEMS_LIMIT)
99
102
 
100
103
  create_folder(name, parent)
101
104
 
102
- folder(folder_id, fields: [])
103
-
104
105
  update_folder(folder, name: nil, description: nil, parent_id: nil, shared_link: nil,
105
106
  folder_upload_email_access: nil, owned_by_id: nil, sync_state: nil, tags: nil,
106
107
  can_non_owners_invite: nil, if_match: nil)
@@ -125,7 +126,8 @@ restore_trashed_folder(folder, name: nil, parent_id: nil)
125
126
  ```ruby
126
127
  file_from_path(path)
127
128
 
128
- file(file_id, fields: [])
129
+ file_from_id(file_id, fields: [])
130
+ alias :file :file_from_id
129
131
 
130
132
  update_file(file, name: nil, description: nil, parent_id: nil, shared_link: nil, tags: nil, if_match: nil)
131
133
 
@@ -171,7 +173,8 @@ reply_to_comment(comment_id, message: nil, tagged_message: nil)
171
173
 
172
174
  change_comment(comment, message)
173
175
 
174
- comment(comment_id, fields: [])
176
+ comment_from_id(comment_id, fields: [])
177
+ alias :comment :comment_from_id
175
178
 
176
179
  delete_comment(comment)
177
180
  ```
@@ -185,7 +188,8 @@ edit_collaboration(collaboration, role: nil, status: nil)
185
188
 
186
189
  remove_collaboration(collaboration)
187
190
 
188
- collaboration(collaboration_id, fields: [], status: nil)
191
+ collaboration_from_id(collaboration_id, fields: [], status: nil)
192
+ alias :collaboration :collaboration_from_id
189
193
 
190
194
  pending_collaborations()
191
195
  ```
@@ -208,10 +212,10 @@ search(query, scope: nil, file_extensions: nil, created_at_range: nil, updated_a
208
212
  #### [Users](https://developers.box.com/docs/#users)
209
213
  ```ruby
210
214
  current_user(fields: [])
211
-
212
215
  alias :me :current_user
213
216
 
214
- user(user_id, fields: [])
217
+ user_from_id(user_id, fields: [])
218
+ alias :user :user_from_id
215
219
 
216
220
  all_users(filter_term: nil, fields: [], offset: 0, limit: DEFAULT_LIMIT)
217
221
 
@@ -235,7 +239,6 @@ groups(fields: [], offset: 0, limit: DEFAULT_LIMIT)
235
239
  create_group(name)
236
240
 
237
241
  update_group(group, name)
238
-
239
242
  alias :rename_group :update_group
240
243
 
241
244
  delete_group(group)
@@ -246,7 +249,8 @@ group_memberships_for_user(user, offset: 0, limit: DEFAULT_LIMIT)
246
249
 
247
250
  group_memberships_for_me(offset: 0, limit: DEFAULT_LIMIT)
248
251
 
249
- group_membership(membership_id)
252
+ group_membership_from_id(membership_id)
253
+ alias :group_membership :group_membership_from_id
250
254
 
251
255
  add_user_to_group(user, group, role: nil)
252
256
 
@@ -262,7 +266,8 @@ file_tasks(file, fields: [])
262
266
 
263
267
  create_task(file, action: :review, message: nil, due_at: nil)
264
268
 
265
- task(task_id)
269
+ task_from_id(task_id)
270
+ alias :task :task_from_id
266
271
 
267
272
  update_task(task, action: :review, message: nil, due_at: nil)
268
273
 
@@ -27,12 +27,13 @@ module Boxr
27
27
  updated_comment
28
28
  end
29
29
 
30
- def comment(comment_id, fields: [])
30
+ def comment_from_id(comment_id, fields: [])
31
31
  comment_id = ensure_id(comment_id)
32
32
  uri ="#{COMMENTS_URI}/#{comment_id}"
33
33
  comment, response = get(uri)
34
34
  comment
35
35
  end
36
+ alias :comment :comment_from_id
36
37
 
37
38
  def delete_comment(comment)
38
39
  comment_id = ensure_id(comment)
@@ -17,13 +17,14 @@ module Boxr
17
17
  file
18
18
  end
19
19
 
20
- def file(file_id, fields: [])
20
+ def file_from_id(file_id, fields: [])
21
21
  file_id = ensure_id(file_id)
22
22
  uri = "#{FILES_URI}/#{file_id}"
23
23
  query = build_fields_query(fields, FOLDER_AND_FILE_FIELDS_QUERY)
24
24
  file, response = get(uri, query: query)
25
25
  file
26
26
  end
27
+ alias :file :file_from_id
27
28
 
28
29
  def update_file(file, name: nil, description: nil, parent_id: nil, shared_link: nil, tags: nil, if_match: nil)
29
30
  file_id = ensure_id(file)
@@ -16,6 +16,16 @@ module Boxr
16
16
  end
17
17
  end
18
18
 
19
+ def folder_from_id(folder_id, fields: [])
20
+ folder_id = ensure_id(folder_id)
21
+ query = build_fields_query(fields, FOLDER_AND_FILE_FIELDS_QUERY)
22
+ uri = "#{FOLDERS_URI}/#{folder_id}"
23
+
24
+ folder, response = get(uri, query: query)
25
+ folder
26
+ end
27
+ alias :folder :folder_from_id
28
+
19
29
  def folder_items(folder, fields: [], offset: nil, limit: nil)
20
30
  folder_id = ensure_id(folder)
21
31
  query = build_fields_query(fields, FOLDER_AND_FILE_FIELDS_QUERY)
@@ -44,15 +54,6 @@ module Boxr
44
54
  created_folder
45
55
  end
46
56
 
47
- def folder(folder_id, fields: [])
48
- folder_id = ensure_id(folder_id)
49
- query = build_fields_query(fields, FOLDER_AND_FILE_FIELDS_QUERY)
50
- uri = "#{FOLDERS_URI}/#{folder_id}"
51
-
52
- folder, response = get(uri, query: query)
53
- folder
54
- end
55
-
56
57
  def update_folder(folder, name: nil, description: nil, parent_id: nil, shared_link: nil,
57
58
  folder_upload_email_access: nil, owned_by_id: nil, sync_state: nil, tags: nil,
58
59
  can_non_owners_invite: nil, if_match: nil)
@@ -20,7 +20,6 @@ module Boxr
20
20
  updated_group, response = put(uri, attributes)
21
21
  updated_group
22
22
  end
23
-
24
23
  alias :rename_group :update_group
25
24
 
26
25
  def delete_group(group)
@@ -47,12 +46,13 @@ module Boxr
47
46
  memberships = get_all_with_pagination(uri, offset: 0, limit: DEFAULT_LIMIT)
48
47
  end
49
48
 
50
- def group_membership(membership_id)
49
+ def group_membership_from_id(membership_id)
51
50
  membership_id = ensure_id(membership_id)
52
51
  uri = "#{GROUP_MEMBERSHIPS_URI}/#{membership_id}"
53
52
  membership, response = get(uri)
54
53
  membership
55
54
  end
55
+ alias :group_membership :group_membership_from_id
56
56
 
57
57
  def add_user_to_group(user, group, role: nil)
58
58
  user_id = ensure_id(user)
@@ -21,12 +21,13 @@ module Boxr
21
21
  new_task
22
22
  end
23
23
 
24
- def task(task_id)
24
+ def task_from_id(task_id)
25
25
  task_id = ensure_id(task_id)
26
26
  uri = "#{TASKS_URI}/#{task_id}"
27
27
  task, response = get(uri)
28
28
  task
29
29
  end
30
+ alias :task :task_from_id
30
31
 
31
32
  def update_task(task, action: :review, message: nil, due_at: nil)
32
33
  task_id = ensure_id(task)
@@ -7,16 +7,16 @@ module Boxr
7
7
  user, response = get(uri, query: query)
8
8
  user
9
9
  end
10
-
11
10
  alias :me :current_user
12
11
 
13
- def user(user_id, fields: [])
12
+ def user_from_id(user_id, fields: [])
14
13
  user_id = ensure_id(user_id)
15
14
  uri = "#{USERS_URI}/#{user_id}"
16
15
  query = build_fields_query(fields, USER_FIELDS_QUERY)
17
16
  user, response = get(uri, query: query)
18
17
  user
19
18
  end
19
+ alias :user :user_from_id
20
20
 
21
21
  def all_users(filter_term: nil, fields: [], offset: nil, limit: nil)
22
22
  uri = USERS_URI
@@ -1,3 +1,3 @@
1
1
  module Boxr
2
- VERSION = "0.7.0"
2
+ VERSION = "0.8.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: boxr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chad Burnette