filestack 2.9.7 → 3.0.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
  SHA256:
3
- metadata.gz: c847c2a9ed6e1078e3c19e969659eb4171450f8eae8e8f8613f197b12bda479b
4
- data.tar.gz: e34883049cb327b4dedfbeada46a941a5d34bc046dcabdae45e392fa7d6dda82
3
+ metadata.gz: 2aaa98b594a492feb98669ada0e1ad0118893c0c1993194b3a0cfe0386b66bc4
4
+ data.tar.gz: 9d7cca2dd7f86ee16d88eb5a5e810bceb3299930acaaee00dbf831afa6726e14
5
5
  SHA512:
6
- metadata.gz: e2f2ee126ae57f1f2222690a5d33c059a84273309e3f91933d2f4a4fcb85769dddcfb0fd4a6629c229218992870d4d0f985c371eb562b591f5b1ee153a4f0989
7
- data.tar.gz: ed477ccd9f6404f6c23fffa88037dbb8e2e780b34e5264864da52c807419e9170a7c443924b69a57693141ac28eca69d80d513523437fc764ffcf63c1c7ee054
6
+ metadata.gz: 2d04a14df2e333ad3f04a262d0a321883ce01054a8e91c1edc682d86e0646e6970549add42e8d2c7aec6668da51661fcc432ea633434f74efe73f351f3d36a0e
7
+ data.tar.gz: c634e6292049d9bf4b511010dab7609edb6a3a82938fb5671403eeac0f05c4624937342552e9974e580653e830ed44f6915e0feab8b7ac4fd29a76811a7f6cf5
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Filestack-Ruby Changelog
2
2
 
3
+ ## 3.0.0 (Sept 07, 2023)
4
+ - Upgrade to Ruby 3.0
5
+
3
6
  ## 2.9.7 (Sept 07, 2023)
4
7
  - Replace URI encode to ERB
5
8
 
data/README.md CHANGED
@@ -56,11 +56,6 @@ filelink = client.upload(filepath: '/path/to/localfile')
56
56
 
57
57
  filelink = client.upload(external_url: 'http://domain.com/image.png')
58
58
 
59
- # OR
60
-
61
- file = StringIO.new
62
- filelink = client.upload(io: file)
63
-
64
59
 
65
60
  # Return response body on upload complete
66
61
  puts filelink.upload_response
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.9.7
1
+ 3.0.0
@@ -9,6 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.version = Filestack::Ruby::VERSION
10
10
  spec.authors = ["Filestack"]
11
11
  spec.email = ["dev@filestack.com"]
12
+ spec.required_ruby_version = '>= 3.0.0'
12
13
 
13
14
  spec.summary = %q{Official Ruby SDK for the Filestack API}
14
15
  spec.description = %q{This is the official Ruby SDK for Filestack - API and content management system that makes it easy to add powerful file uploading and transformation capabilities to any web or mobile application.}
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Filestack
2
3
  # A helper class for the purpose of implementing a symbolize_keys method
3
4
  # similar to ActiveSupport's symbolize_keys.
@@ -1,5 +1,6 @@
1
+ # frozen_string_literal: true
1
2
  module Filestack
2
3
  module Ruby
3
- VERSION = '2.9.7'.freeze
4
+ VERSION = '3.0.0'.freeze
4
5
  end
5
6
  end
@@ -107,11 +107,11 @@ module MultipartUploadUtils
107
107
 
108
108
  part_info[:store].merge!(options) if options
109
109
 
110
- if seek_point + FilestackConfig::DEFAULT_CHUNK_SIZE > filesize
111
- size = filesize - (seek_point)
110
+ size = if seek_point + FilestackConfig::DEFAULT_CHUNK_SIZE > filesize
111
+ filesize - (seek_point)
112
112
  else
113
- size = FilestackConfig::DEFAULT_CHUNK_SIZE
114
- end
113
+ FilestackConfig::DEFAULT_CHUNK_SIZE
114
+ end
115
115
  part_info[:size] = size
116
116
  jobs.push(part_info)
117
117
  part += 1
@@ -275,7 +275,7 @@ module MultipartUploadUtils
275
275
  )
276
276
  end
277
277
  }
278
- rescue
278
+ rescue StandardError
279
279
  raise "Upload timed out upon completion. Please try again later"
280
280
  end
281
281
  JSON.parse(response_complete.body)
@@ -9,13 +9,13 @@ require 'filestack/config'
9
9
  class IntelligentState
10
10
  attr_accessor :offset, :ok, :error_type
11
11
  def initialize
12
- @offset = 524288
12
+ @offset = 524_288
13
13
  @ok = true
14
14
  @alive = true
15
15
  @retries = 0
16
16
  @backoff = 1
17
17
  @offset_index = 0
18
- @offset_sizes = [524288, 262144, 131072, 65536, 32768]
18
+ @offset_sizes = [524_288, 262_144, 131_072, 65_536, 32_768]
19
19
  end
20
20
 
21
21
  def alive?
@@ -103,7 +103,7 @@ module UploadUtils
103
103
  begin
104
104
  response_body = JSON.parse(response.body)
105
105
  return response_body
106
- rescue
106
+ rescue StandardError
107
107
  raise response.body
108
108
  end
109
109
  end
@@ -317,7 +317,7 @@ module IntelligentUtils
317
317
  Parallel.map(chunks, in_threads: 3) do |chunk|
318
318
  begin
319
319
  upload_chunk_intelligently(chunk, state, part[:apikey], filepath, io, part[:options], storage)
320
- rescue => e
320
+ rescue StandardError => e
321
321
  state.error_type = e.message
322
322
  failed = true
323
323
  Parallel::Kill
@@ -401,7 +401,7 @@ module IntelligentUtils
401
401
  end
402
402
  end
403
403
 
404
- rescue
404
+ rescue StandardError
405
405
  raise 'BACKEND_NETWORK'
406
406
  end
407
407
  fs_response = JSON.parse(fs_response.body)
@@ -419,7 +419,7 @@ module IntelligentUtils
419
419
  end
420
420
  end
421
421
 
422
- rescue
422
+ rescue StandardError
423
423
  raise 'S3_NETWORK'
424
424
  end
425
425
  amazon_response
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: filestack
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.9.7
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Filestack
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-09-07 00:00:00.000000000 Z
11
+ date: 2023-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -209,7 +209,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
209
209
  requirements:
210
210
  - - ">="
211
211
  - !ruby/object:Gem::Version
212
- version: '0'
212
+ version: 3.0.0
213
213
  required_rubygems_version: !ruby/object:Gem::Requirement
214
214
  requirements:
215
215
  - - ">="