filestack 2.9.2 → 2.9.3

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: 77cdeeaa1226f25d1c5eba7ac7afe6d378dd9186ca312d04702fc4f840afa77b
4
- data.tar.gz: 0ea80120de3f54a0e2ee5d6c0ed1d2a6fb7d720259c1ac5447e80d98c374768d
3
+ metadata.gz: db535c63bd1fd4b140f7450c908995306012150335eb9ee6974c462b1752b70f
4
+ data.tar.gz: 9abd562d8604200f27b50d94300c67e5beab7e42f2b05613ed655fa31ea5a210
5
5
  SHA512:
6
- metadata.gz: 41aaf72567d547bce5dbdfff016558a736f91f26ad6b52e70f242c9dc3d6a9d98aec65ed1532e0378c55e892eed465b8a3bba9a42ff92de387291cc854e54840
7
- data.tar.gz: 83081bee7119eed5d65d3d2f55aa54d8a61f81621002ff9a74de974ad794992a49db51266a544a95d2807083995af742d55b77c130f09684ed6b228f6f7b5e81
6
+ metadata.gz: 2deddcc79603eb57cc84ef8037eb025e8dbee71f2b1a4616062708e0e1d525827bebad21d50c6b2fa90f8a1cd78f58a6af24e80aa6b068bb8d566e3b9849dad7
7
+ data.tar.gz: ac4740114ff55eb5a616fa9f9793b04605d2e41ff05158033de5dd0eb02b839b7964a4031c5fede4fd537bdeec25ab16d25f86a64bebe977cc76fefeab79c695
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Filestack-Ruby Changelog
2
2
 
3
+ ## 2.9.3 (June 7, 2021)
4
+ - Handle nil mimetype of file
5
+
3
6
  ## 2.9.2 (May 5, 2021)
4
7
  - Replace mimemagic with mini_magic
5
8
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.9.2
1
+ 2.9.3
@@ -1,5 +1,5 @@
1
1
  module Filestack
2
2
  module Ruby
3
- VERSION = '2.9.2'.freeze
3
+ VERSION = '2.9.3'.freeze
4
4
  end
5
5
  end
@@ -16,7 +16,7 @@ module MultipartUploadUtils
16
16
 
17
17
  def get_file_attributes(file, options = {})
18
18
  filename = options[:filename] || File.basename(file)
19
- mimetype = options[:mimetype] || MiniMime.lookup_by_filename(File.open(file)).content_type || FilestackConfig::DEFAULT_UPLOAD_MIMETYPE
19
+ mimetype = options[:mimetype] || get_mimetype_from_file(file) || FilestackConfig::DEFAULT_UPLOAD_MIMETYPE
20
20
  filesize = File.size(file)
21
21
 
22
22
  [filename, filesize, mimetype.to_s]
@@ -280,4 +280,12 @@ module MultipartUploadUtils
280
280
  end
281
281
  JSON.parse(response_complete.body)
282
282
  end
283
+
284
+ private
285
+
286
+ def get_mimetype_from_file(file)
287
+ file_info = MiniMime.lookup_by_filename(File.open(file))
288
+
289
+ file_info ? file_info.content_type : nil
290
+ end
283
291
  end
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.2
4
+ version: 2.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Filestack
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-05-05 00:00:00.000000000 Z
11
+ date: 2021-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus