mass-client 1.0.22 → 1.0.23

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
  SHA256:
3
- metadata.gz: 89942512c664d6c1e10f0511db2f17c914a22d4b5b80d6b50fa4151c17997304
4
- data.tar.gz: c7dc604ffa10a35ed2f1e74377d73a7402a2714b3c554c086c91216f867fccb7
3
+ metadata.gz: 8a5ae6cc2ac6143f4c2a98af32576c2cf85c2fe27faa8d7e1746df88d4192fe0
4
+ data.tar.gz: 9e3a2043d09803dc5a668fc5a03409819f296be6bd3ce5d35e6338dabfb991eb
5
5
  SHA512:
6
- metadata.gz: b1480e0a4e9f4b414a7bec3148ee96c8611e2f44fd3b7dde949e296be04a4b3ab0354f485dfa964546ec40e1e15876612cfca54781073d8dcc104ad932205e1a
7
- data.tar.gz: 6abc1702733af395df62d3c8ff01b1d2c701f337d32427bfb77b59ea4ebff591f87ab39690fb3943d87a77f2e7560a96f4aedbfb045ac69d08156734d6fd2bfd
6
+ metadata.gz: 96e85dce902b72f67f6ff88c546591a639f126fb814b561fb1c1845036dcd159e04cafd7c7aa6921878fbbb5e991ca1eaf7ed320d1588c09217770e91a3c2ae8
7
+ data.tar.gz: 02edbb6c8c90ba3fbbdc4f2202cd67ce5bc079f70cc7bc3a54c17e318fdb8c4715cbec556a5593ac74c0db394a17d78f5f3ccac204a91ca463367786883869d3
@@ -218,14 +218,14 @@ module Mass
218
218
  #
219
219
  # @return [String] The URL of the file in Dropbox, with the `&dl=1` parameter
220
220
  # replaced by `&dl=0`.
221
- # @raise [RuntimeError] If the file is not available within the specified
221
+ # @return nil If the file is not available within the specified
222
222
  # maximum wait time, raises an error with a timeout message.
223
223
  #
224
224
  # @example
225
225
  # wait_for_dropbox_url('/path/to/file', max_wait: 60, interval: 3)
226
226
  # # => "https://www.dropbox.com/s/yourfile?dl=0"
227
227
  #
228
- def wait_for_dropbox_url(path, max_wait: 30, interval: 2)
228
+ def wait_for_dropbox_url(path, max_wait: 5, interval: 2)
229
229
  start_time = Time.now
230
230
 
231
231
  loop do
@@ -235,7 +235,8 @@ module Mass
235
235
  rescue => e
236
236
  # Check if the timeout has been exceeded
237
237
  if Time.now - start_time > max_wait
238
- raise "Timeout exceeded while waiting for Dropbox file (#{path}): #{e.message}"
238
+ #raise "Timeout exceeded while waiting for Dropbox file (#{path}): #{e.message}"
239
+ return nil
239
240
  end
240
241
 
241
242
  # Wait for a short interval before retrying
@@ -326,7 +327,11 @@ module Mass
326
327
  BlackStack::DropBox.dropbox_create_folder(folder)
327
328
 
328
329
  # Upload the file to Dropbox
329
- BlackStack::DropBox.dropbox_upload_file(tmp_path, path)
330
+ s = BlackStack::DropBox.dropbox_upload_file(tmp_path, path)
331
+ json = JSON.parse(s)
332
+ if json['is_downloadable'].nil? || !json['is_downloadable']
333
+ raise "Dropbox file upload failed. Dropbox response: #{s}"
334
+ end
330
335
  # Delete the local file
331
336
  File.delete(tmp_path)
332
337
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mass-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.22
4
+ version: 1.0.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leandro Daniel Sardi