filestack 2.9.6 → 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: a6257a989f754721ccea17bb8ba9ec05e3b919e224599239e6c4b07596be95db
4
- data.tar.gz: 203b1b4d9cb0627115e13b2af655edba664ae8743c7e9772fdb5641ceadeb0e6
3
+ metadata.gz: 2aaa98b594a492feb98669ada0e1ad0118893c0c1993194b3a0cfe0386b66bc4
4
+ data.tar.gz: 9d7cca2dd7f86ee16d88eb5a5e810bceb3299930acaaee00dbf831afa6726e14
5
5
  SHA512:
6
- metadata.gz: 796f587b6695c730e884aee7731673b98ac9f9b22d5ba33473d7236ceae4222ad8f8f1fe51b4362f50b137743be308b6096e827cc9ea634fb4352f40aa421cd3
7
- data.tar.gz: 9fe556c481445e41fe51e4d8d1a15bae7bf8f9ffc2753282a91b350221c70705727fe4f67499a887416087eda98c6238959e5c3e3eb34aa3afe97d8215150f52
6
+ metadata.gz: 2d04a14df2e333ad3f04a262d0a321883ce01054a8e91c1edc682d86e0646e6970549add42e8d2c7aec6668da51661fcc432ea633434f74efe73f351f3d36a0e
7
+ data.tar.gz: c634e6292049d9bf4b511010dab7609edb6a3a82938fb5671403eeac0f05c4624937342552e9974e580653e830ed44f6915e0feab8b7ac4fd29a76811a7f6cf5
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Filestack-Ruby Changelog
2
2
 
3
+ ## 3.0.0 (Sept 07, 2023)
4
+ - Upgrade to Ruby 3.0
5
+
6
+ ## 2.9.7 (Sept 07, 2023)
7
+ - Replace URI encode to ERB
8
+
3
9
  ## 2.9.6 (Oct 29, 2021)
4
10
  - Return response body on upload complete to get workflows jobid
5
11
 
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.6
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.6'.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?
@@ -58,7 +58,7 @@ module UploadUtils
58
58
  FilestackConfig::HEADERS
59
59
  end
60
60
  Typhoeus.public_send(
61
- action, URI.encode(url), params: parameters, headers: headers
61
+ action, URI::Parser.new.escape(url), params: parameters, headers: headers
62
62
  )
63
63
  end
64
64
 
@@ -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.6
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Filestack
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-10-29 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
@@ -201,7 +201,7 @@ homepage: https://github.com/filestack/filestack-ruby
201
201
  licenses:
202
202
  - MIT
203
203
  metadata: {}
204
- post_install_message:
204
+ post_install_message:
205
205
  rdoc_options: []
206
206
  require_paths:
207
207
  - lib
@@ -209,15 +209,15 @@ 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
  - - ">="
216
216
  - !ruby/object:Gem::Version
217
217
  version: '0'
218
218
  requirements: []
219
- rubygems_version: 3.0.8
220
- signing_key:
219
+ rubygems_version: 3.1.2
220
+ signing_key:
221
221
  specification_version: 4
222
222
  summary: Official Ruby SDK for the Filestack API
223
223
  test_files: []