balloon 1.1.3 → 1.1.4

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: 7c867d95dbb5c4a0d87faf47ccaf9e893388b46abd615a8d9f98801241fb6bde
4
- data.tar.gz: 6f950eec27013a0f257bae84e848269c5e0a2693d9795ac622f1be572d7c4d95
3
+ metadata.gz: 93ee09077783f74ff932ed5552a56e6bfff56c32761cfe9e3a56c71e29a3420f
4
+ data.tar.gz: b3a4618315f7344436e4338f37080409f7c1664535d8e3a060688105eb9286e1
5
5
  SHA512:
6
- metadata.gz: 82a9c414d16d7f2435e854568d1d6be4de522e4cda381a129d4ea5deba49c95ad6507098feb18528e369576e96bc13884bd694f688632c140b15d01a3c31510a
7
- data.tar.gz: a6a4163b12edf1c43acd3bf42ea9646de72dd72644105a94a52b9cc3e4a912108519147aacd03fcb2239ee249d3d67795bdaeb674ca5d48093bffcb51a755376
6
+ metadata.gz: 3df6102dcf37884530d91c9eb42876089db2b898c88199635e18ad0c7097dd3d809fcd60e8144185906dbd50f385c1a33d2056863eece3a7d9f5509457384be2
7
+ data.tar.gz: 4596fd7f51c8fad31481b3b1fba27b8c068c8c28f4266f0d9a9804e119d20298445e61f3726259a3f9a928e5944b28951abf93e58879e74780cf57586836ad7e
@@ -18,7 +18,17 @@ module Balloon
18
18
  end
19
19
 
20
20
  def save_to_cache(up_file)
21
- uploader_file = up_file.is_a?(String) && up_file.include?("://") ? down_url(up_file) : up_file
21
+ upload_data = {}
22
+ uploader_file = up_file
23
+
24
+ if up_file.is_a?(String) && up_file.include?("://")
25
+ upload_data[:remote_url] = up_file
26
+ uploader_file = down_url(up_file)
27
+ end
28
+
29
+ if up_file.is_a?(ActionDispatch::Http::UploadedFile)
30
+ upload_data[:original_filename] = up_file.original_filename
31
+ end
22
32
 
23
33
  uploader_file_ext = Balloon::FileExtension.new(uploader_file)
24
34
  file_mime_type = uploader_file_ext.mime_type
@@ -44,7 +54,8 @@ module Balloon
44
54
  size: @cache_meta[:size],
45
55
  mime_type: @cache_meta[:mime_type],
46
56
  extension: @cache_meta[:extension],
47
- data: @cache_meta[:data]
57
+ upload_data: upload_data,
58
+ data: upload_data.merge(@cache_meta[:data])
48
59
  }
49
60
  end
50
61
 
@@ -1,3 +1,3 @@
1
1
  module Balloon
2
- VERSION = "1.1.3"
2
+ VERSION = "1.1.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: balloon
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - yeeli
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-05-09 00:00:00.000000000 Z
11
+ date: 2022-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport