boxr 1.4.0 → 1.5.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 070f7c0d6b0a19d622880a61080cc53f8f648545
4
- data.tar.gz: ab51a80c8118f7bdf048db7285cf04deaf9772ac
2
+ SHA256:
3
+ metadata.gz: 8f0d102a912384569f1918652ed8c2a0826fa82ebc9aed2178f34345fa9e3699
4
+ data.tar.gz: b9fb53a155bb2df57c91c46d8ec02055417c6f9a28ecbd28bacf855edac84c15
5
5
  SHA512:
6
- metadata.gz: 07cf929137f8b6bbb9877b4643861a6ab430fbf957f575fe06a3f9b18b57b81317f3c9b1bfeffbef97fcb9292a30daca50c5da0b06d3740acecaa036fb1aae1a
7
- data.tar.gz: ee5d20a7c16d3e629e9d6522b268b4749b44a337a66e8a708f2512c05d5be73b9cc88ab1d752cd006bc70c8bcc38aba085b73e11b7dd6f8dc81a49181bf8592c
6
+ metadata.gz: d55466cf1c6571ed22ac9c708b50dca5f7932c28095e19239f791d101dad3c8a42adb6ca20f97e4815bf11ac226eecb461d5d18d1f2cc742a7f69e878fa1f705
7
+ data.tar.gz: 73b64881401047d64bcb8473a2dfd5b7bf17f12aa2b1d5ec089314fca3421e28da01f3e8ada2e729cdca7e62e3fba216031bcd2119fe0405848e8d66880ae100
data/README.md CHANGED
@@ -1,10 +1,14 @@
1
1
  # Boxr
2
- Boxr is a Ruby client library for the Box V2 Content API. Box employees affectionately refer to one another as Boxers, hence the name of this gem.
2
+ Boxr is a Ruby client library for the Box V2 Content API. Box employees affectionately refer to one another as Boxers, hence the name of this gem.
3
3
 
4
4
  The purpose of this gem is to provide a clear, efficient, and intentional method of interacting with the Box Content API. As with any SDK that wraps a REST API, it is important to fully understand the Box Content API at the REST endpoint level. You are strongly encouraged to read through the Box documentation located [here](https://box-content.readme.io/).
5
5
 
6
6
  The full RubyDocs for Boxr can be found [here](http://www.rubydoc.info/gems/boxr/Boxr/Client). You are also encouraged to rely heavily on the source code found in the [lib/boxr](https://github.com/cburnette/boxr/tree/master/lib/boxr) directory of this gem, as well as on the integration tests found [here](https://github.com/cburnette/boxr/blob/master/spec/boxr_spec.rb).
7
7
 
8
+ ## Versioning
9
+
10
+ Boxr follows Semantic Versioning since version 1.5.0
11
+
8
12
  ## Requirements
9
13
  This gem requires Ruby 2.0.0 or higher. The integration tests are currently being run using MRI Ruby 2.0.0-p643 and MRI Ruby 2.2.0.
10
14
 
@@ -298,10 +302,12 @@ alias :user :user_from_id
298
302
 
299
303
  all_users(filter_term: nil, fields: [], offset: 0, limit: DEFAULT_LIMIT)
300
304
 
301
- create_user(login, name, role: nil, language: nil, is_sync_enabled: nil, job_title: nil,
305
+
306
+ create_user(name, login: nil, role: nil, language: nil, is_sync_enabled: nil, job_title: nil,
302
307
  phone: nil, address: nil, space_amount: nil, tracking_codes: nil,
303
308
  can_see_managed_users: nil, is_external_collab_restricted: nil, status: nil, timezone: nil,
304
- is_exempt_from_device_limits: nil, is_exempt_from_login_verification: nil)
309
+ is_exempt_from_device_limits: nil, is_exempt_from_login_verification: nil,
310
+ is_platform_access_only: nil)
305
311
 
306
312
 
307
313
  update_user(user, notify: nil, enterprise: true, name: nil, role: nil, language: nil, is_sync_enabled: nil,
@@ -129,7 +129,9 @@ module Boxr
129
129
  end
130
130
 
131
131
  def upload_new_version_of_file(path_to_file, file, content_modified_at: nil, send_content_md5: true,
132
- preflight_check: true, if_match: nil)
132
+ preflight_check: true, if_match: nil, name: nil)
133
+ filename = name ? name : File.basename(path_to_file)
134
+
133
135
  file_id = ensure_id(file)
134
136
  preflight_check_new_version_of_file(path_to_file, file_id) if preflight_check
135
137
 
@@ -139,9 +141,10 @@ module Boxr
139
141
 
140
142
  File.open(path_to_file) do |file|
141
143
  content_md5 = send_content_md5 ? Digest::SHA1.file(file).hexdigest : nil
142
- attributes = {filename: file}
144
+ attributes = {name: filename}
143
145
  attributes[:content_modified_at] = content_modified_at.to_datetime.rfc3339 unless content_modified_at.nil?
144
- file_info, response = post(uri, attributes, process_body: false, content_md5: content_md5, if_match: if_match)
146
+ body = {attributes: JSON.dump(attributes), file: file}
147
+ file_info, response = post(uri, body, process_body: false, content_md5: content_md5, if_match: if_match)
145
148
  end
146
149
 
147
150
  file_info.entries[0]
@@ -1,3 +1,3 @@
1
1
  module Boxr
2
- VERSION = "1.4.0"
2
+ VERSION = "1.5.0"
3
3
  end
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: 1.4.0
4
+ version: 1.5.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: 2017-04-23 00:00:00.000000000 Z
11
+ date: 2019-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -230,7 +230,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
230
230
  version: '0'
231
231
  requirements: []
232
232
  rubyforge_project:
233
- rubygems_version: 2.6.7
233
+ rubygems_version: 2.7.8
234
234
  signing_key:
235
235
  specification_version: 4
236
236
  summary: A Ruby client library for the Box V2 Content API.