simple_form_bs5_file_input 0.3.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2c053d9cb8619604bb12aeeca15ec00bba955b93189dce35eecc776bf65d99d3
4
- data.tar.gz: 3d46643934e4229fd26f90027c2cda2d2939ed1d8b15c010bf2209c4a7dc9c40
3
+ metadata.gz: 93403611032d92e8a7a6c89a1beb11e967e271eeefee958dc9142e3f22ad7821
4
+ data.tar.gz: 251e82ad97ab7534318f05f85a35129e75a12a14bcca1b07d2ffde11f56820c4
5
5
  SHA512:
6
- metadata.gz: c82a7860aea72365d85d4d56bb2eb2cc9799d6190b0b3dc63161f2b8ec592ec7f695ee788ce25b4d43df043085d519485e869c0be6154824cc23592c43c6f947
7
- data.tar.gz: cce043be273e5c0d2519f55a6a0c79e108d968da87a68cb5325e501c44c46f4810477bc42846c82462766f84792da9c7913e8655b96c4cd5097d09adf58347ed
6
+ metadata.gz: 4e40c56bacab56f6a7ab70be243ed63c90afa23984cf51fd8392ccc3fd04ab95946cc4531e3544eae5638e43c31aa2c71d1e2bbcd1395e6effe68c3009191fd2
7
+ data.tar.gz: 1a70cc08bf3cab403560060b8eeba54259238255cfc53d95eb7c4bed82ba7e1efe17422a9a933656e8dbc60520d47fbda1a19e1dd5c947e400989514df5732d6
data/Gemfile.lock CHANGED
@@ -1,221 +1,246 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- simple_form_bs5_file_input (0.3.0)
4
+ simple_form_bs5_file_input (0.3.2)
5
+ open-uri
5
6
  rails
6
7
  simple_form
7
8
 
8
9
  GEM
9
10
  remote: https://rubygems.org/
10
11
  specs:
11
- actioncable (7.1.3.2)
12
- actionpack (= 7.1.3.2)
13
- activesupport (= 7.1.3.2)
12
+ action_text-trix (2.1.19)
13
+ railties
14
+ actioncable (8.1.3)
15
+ actionpack (= 8.1.3)
16
+ activesupport (= 8.1.3)
14
17
  nio4r (~> 2.0)
15
18
  websocket-driver (>= 0.6.1)
16
19
  zeitwerk (~> 2.6)
17
- actionmailbox (7.1.3.2)
18
- actionpack (= 7.1.3.2)
19
- activejob (= 7.1.3.2)
20
- activerecord (= 7.1.3.2)
21
- activestorage (= 7.1.3.2)
22
- activesupport (= 7.1.3.2)
23
- mail (>= 2.7.1)
24
- net-imap
25
- net-pop
26
- net-smtp
27
- actionmailer (7.1.3.2)
28
- actionpack (= 7.1.3.2)
29
- actionview (= 7.1.3.2)
30
- activejob (= 7.1.3.2)
31
- activesupport (= 7.1.3.2)
32
- mail (~> 2.5, >= 2.5.4)
33
- net-imap
34
- net-pop
35
- net-smtp
20
+ actionmailbox (8.1.3)
21
+ actionpack (= 8.1.3)
22
+ activejob (= 8.1.3)
23
+ activerecord (= 8.1.3)
24
+ activestorage (= 8.1.3)
25
+ activesupport (= 8.1.3)
26
+ mail (>= 2.8.0)
27
+ actionmailer (8.1.3)
28
+ actionpack (= 8.1.3)
29
+ actionview (= 8.1.3)
30
+ activejob (= 8.1.3)
31
+ activesupport (= 8.1.3)
32
+ mail (>= 2.8.0)
36
33
  rails-dom-testing (~> 2.2)
37
- actionpack (7.1.3.2)
38
- actionview (= 7.1.3.2)
39
- activesupport (= 7.1.3.2)
34
+ actionpack (8.1.3)
35
+ actionview (= 8.1.3)
36
+ activesupport (= 8.1.3)
40
37
  nokogiri (>= 1.8.5)
41
- racc
42
38
  rack (>= 2.2.4)
43
39
  rack-session (>= 1.0.1)
44
40
  rack-test (>= 0.6.3)
45
41
  rails-dom-testing (~> 2.2)
46
42
  rails-html-sanitizer (~> 1.6)
47
- actiontext (7.1.3.2)
48
- actionpack (= 7.1.3.2)
49
- activerecord (= 7.1.3.2)
50
- activestorage (= 7.1.3.2)
51
- activesupport (= 7.1.3.2)
43
+ useragent (~> 0.16)
44
+ actiontext (8.1.3)
45
+ action_text-trix (~> 2.1.15)
46
+ actionpack (= 8.1.3)
47
+ activerecord (= 8.1.3)
48
+ activestorage (= 8.1.3)
49
+ activesupport (= 8.1.3)
52
50
  globalid (>= 0.6.0)
53
51
  nokogiri (>= 1.8.5)
54
- actionview (7.1.3.2)
55
- activesupport (= 7.1.3.2)
52
+ actionview (8.1.3)
53
+ activesupport (= 8.1.3)
56
54
  builder (~> 3.1)
57
55
  erubi (~> 1.11)
58
56
  rails-dom-testing (~> 2.2)
59
57
  rails-html-sanitizer (~> 1.6)
60
- activejob (7.1.3.2)
61
- activesupport (= 7.1.3.2)
58
+ activejob (8.1.3)
59
+ activesupport (= 8.1.3)
62
60
  globalid (>= 0.3.6)
63
- activemodel (7.1.3.2)
64
- activesupport (= 7.1.3.2)
65
- activerecord (7.1.3.2)
66
- activemodel (= 7.1.3.2)
67
- activesupport (= 7.1.3.2)
61
+ activemodel (8.1.3)
62
+ activesupport (= 8.1.3)
63
+ activerecord (8.1.3)
64
+ activemodel (= 8.1.3)
65
+ activesupport (= 8.1.3)
68
66
  timeout (>= 0.4.0)
69
- activestorage (7.1.3.2)
70
- actionpack (= 7.1.3.2)
71
- activejob (= 7.1.3.2)
72
- activerecord (= 7.1.3.2)
73
- activesupport (= 7.1.3.2)
67
+ activestorage (8.1.3)
68
+ actionpack (= 8.1.3)
69
+ activejob (= 8.1.3)
70
+ activerecord (= 8.1.3)
71
+ activesupport (= 8.1.3)
74
72
  marcel (~> 1.0)
75
- activesupport (7.1.3.2)
73
+ activesupport (8.1.3)
76
74
  base64
77
75
  bigdecimal
78
- concurrent-ruby (~> 1.0, >= 1.0.2)
76
+ concurrent-ruby (~> 1.0, >= 1.3.1)
79
77
  connection_pool (>= 2.2.5)
80
78
  drb
81
79
  i18n (>= 1.6, < 2)
80
+ json
81
+ logger (>= 1.4.2)
82
82
  minitest (>= 5.1)
83
- mutex_m
84
- tzinfo (~> 2.0)
85
- autoprefixer-rails (10.4.16.0)
86
- execjs (~> 2)
87
- base64 (0.2.0)
88
- bcrypt (3.1.20)
89
- bigdecimal (3.1.7)
90
- bootsnap (1.18.3)
83
+ securerandom (>= 0.3)
84
+ tzinfo (~> 2.0, >= 2.0.5)
85
+ uri (>= 0.13.1)
86
+ base64 (0.3.0)
87
+ bcrypt (3.1.22)
88
+ bigdecimal (4.1.2)
89
+ bootsnap (1.24.6)
91
90
  msgpack (~> 1.2)
92
- bootstrap (5.3.2)
93
- autoprefixer-rails (>= 9.1.0)
91
+ bootstrap (5.3.8)
94
92
  popper_js (>= 2.11.8, < 3)
95
- builder (3.2.4)
96
- concurrent-ruby (1.2.3)
97
- connection_pool (2.4.1)
98
- crass (1.0.6)
99
- date (3.3.4)
100
- devise (4.9.3)
93
+ builder (3.3.0)
94
+ concurrent-ruby (1.3.7)
95
+ connection_pool (3.0.2)
96
+ crass (1.0.7)
97
+ date (3.5.1)
98
+ devise (5.0.4)
101
99
  bcrypt (~> 3.0)
102
100
  orm_adapter (~> 0.1)
103
- railties (>= 4.1.0)
101
+ railties (>= 7.0)
104
102
  responders
105
103
  warden (~> 1.2.3)
106
- drb (2.2.1)
107
- erubi (1.12.0)
108
- execjs (2.9.1)
109
- ffi (1.16.3)
110
- globalid (1.2.1)
104
+ drb (2.2.3)
105
+ erb (6.0.4)
106
+ erubi (1.13.1)
107
+ ffi (1.17.4)
108
+ globalid (1.4.0)
111
109
  activesupport (>= 6.1)
112
- i18n (1.14.4)
110
+ i18n (1.15.2)
113
111
  concurrent-ruby (~> 1.0)
114
- io-console (0.7.2)
115
- irb (1.12.0)
116
- rdoc
112
+ io-console (0.8.2)
113
+ irb (1.18.0)
114
+ pp (>= 0.6.0)
115
+ prism (>= 1.3.0)
116
+ rdoc (>= 4.0.0)
117
117
  reline (>= 0.4.2)
118
- listen (3.9.0)
118
+ json (2.20.0)
119
+ listen (3.10.0)
120
+ logger
119
121
  rb-fsevent (~> 0.10, >= 0.10.3)
120
122
  rb-inotify (~> 0.9, >= 0.9.10)
121
- loofah (2.22.0)
123
+ logger (1.7.0)
124
+ loofah (2.25.1)
122
125
  crass (~> 1.0.2)
123
126
  nokogiri (>= 1.12.0)
124
- mail (2.8.1)
127
+ mail (2.9.0)
128
+ logger
125
129
  mini_mime (>= 0.1.1)
126
130
  net-imap
127
131
  net-pop
128
132
  net-smtp
129
- marcel (1.0.4)
133
+ marcel (1.2.1)
130
134
  mini_mime (1.1.5)
131
- mini_portile2 (2.8.5)
132
- minitest (5.22.3)
133
- msgpack (1.7.2)
134
- mutex_m (0.2.0)
135
- net-imap (0.5.0)
135
+ mini_portile2 (2.8.9)
136
+ minitest (6.0.6)
137
+ drb (~> 2.0)
138
+ prism (~> 1.5)
139
+ msgpack (1.8.3)
140
+ net-imap (0.6.4.1)
136
141
  date
137
142
  net-protocol
138
143
  net-pop (0.1.2)
139
144
  net-protocol
140
145
  net-protocol (0.2.2)
141
146
  timeout
142
- net-smtp (0.5.0)
147
+ net-smtp (0.5.1)
143
148
  net-protocol
144
- nio4r (2.7.3)
145
- nokogiri (1.16.2)
149
+ nio4r (2.7.5)
150
+ nokogiri (1.19.4)
146
151
  mini_portile2 (~> 2.8.2)
147
152
  racc (~> 1.4)
153
+ open-uri (0.5.0)
154
+ stringio
155
+ time
156
+ uri
148
157
  orm_adapter (0.5.0)
149
- pg (1.5.6)
158
+ pg (1.6.3)
150
159
  popper_js (2.11.8)
151
- psych (5.1.2)
152
- stringio
153
- racc (1.7.3)
154
- rack (3.0.9.1)
155
- rack-session (2.0.0)
160
+ pp (0.6.4)
161
+ prettyprint
162
+ prettyprint (0.2.0)
163
+ prism (1.9.0)
164
+ racc (1.8.1)
165
+ rack (3.2.6)
166
+ rack-session (2.1.2)
167
+ base64 (>= 0.1.0)
156
168
  rack (>= 3.0.0)
157
- rack-test (2.1.0)
169
+ rack-test (2.2.0)
158
170
  rack (>= 1.3)
159
- rackup (2.1.0)
171
+ rackup (2.3.1)
160
172
  rack (>= 3)
161
- webrick (~> 1.8)
162
- rails (7.1.3.2)
163
- actioncable (= 7.1.3.2)
164
- actionmailbox (= 7.1.3.2)
165
- actionmailer (= 7.1.3.2)
166
- actionpack (= 7.1.3.2)
167
- actiontext (= 7.1.3.2)
168
- actionview (= 7.1.3.2)
169
- activejob (= 7.1.3.2)
170
- activemodel (= 7.1.3.2)
171
- activerecord (= 7.1.3.2)
172
- activestorage (= 7.1.3.2)
173
- activesupport (= 7.1.3.2)
173
+ rails (8.1.3)
174
+ actioncable (= 8.1.3)
175
+ actionmailbox (= 8.1.3)
176
+ actionmailer (= 8.1.3)
177
+ actionpack (= 8.1.3)
178
+ actiontext (= 8.1.3)
179
+ actionview (= 8.1.3)
180
+ activejob (= 8.1.3)
181
+ activemodel (= 8.1.3)
182
+ activerecord (= 8.1.3)
183
+ activestorage (= 8.1.3)
184
+ activesupport (= 8.1.3)
174
185
  bundler (>= 1.15.0)
175
- railties (= 7.1.3.2)
176
- rails-dom-testing (2.2.0)
186
+ railties (= 8.1.3)
187
+ rails-dom-testing (2.3.0)
177
188
  activesupport (>= 5.0.0)
178
189
  minitest
179
190
  nokogiri (>= 1.6)
180
- rails-html-sanitizer (1.6.0)
181
- loofah (~> 2.21)
182
- nokogiri (~> 1.14)
183
- railties (7.1.3.2)
184
- actionpack (= 7.1.3.2)
185
- activesupport (= 7.1.3.2)
186
- irb
191
+ rails-html-sanitizer (1.7.0)
192
+ loofah (~> 2.25)
193
+ nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
194
+ railties (8.1.3)
195
+ actionpack (= 8.1.3)
196
+ activesupport (= 8.1.3)
197
+ irb (~> 1.13)
187
198
  rackup (>= 1.0.0)
188
199
  rake (>= 12.2)
189
200
  thor (~> 1.0, >= 1.2.2)
201
+ tsort (>= 0.2)
190
202
  zeitwerk (~> 2.6)
191
- rake (13.1.0)
203
+ rake (13.4.2)
192
204
  rb-fsevent (0.11.2)
193
- rb-inotify (0.10.1)
205
+ rb-inotify (0.11.1)
194
206
  ffi (~> 1.0)
195
- rdoc (6.6.2)
196
- psych (>= 4.0.0)
197
- reline (0.4.3)
207
+ rbs (4.0.3)
208
+ logger
209
+ prism (>= 1.6.0)
210
+ tsort
211
+ rdoc (8.0.0)
212
+ erb
213
+ prism (>= 1.6.0)
214
+ rbs (>= 4.0.0)
215
+ tsort
216
+ reline (0.6.3)
198
217
  io-console (~> 0.5)
199
- responders (3.1.1)
200
- actionpack (>= 5.2)
201
- railties (>= 5.2)
202
- simple_form (5.3.0)
203
- actionpack (>= 5.2)
204
- activemodel (>= 5.2)
205
- sqlite3 (1.7.2)
218
+ responders (3.2.0)
219
+ actionpack (>= 7.0)
220
+ railties (>= 7.0)
221
+ securerandom (0.4.1)
222
+ simple_form (5.4.1)
223
+ actionpack (>= 7.0)
224
+ activemodel (>= 7.0)
225
+ sqlite3 (2.9.5)
206
226
  mini_portile2 (~> 2.8.0)
207
- stringio (3.1.0)
208
- thor (1.3.1)
209
- timeout (0.4.1)
227
+ stringio (3.2.0)
228
+ thor (1.5.0)
229
+ time (0.4.2)
230
+ date
231
+ timeout (0.6.1)
232
+ tsort (0.2.0)
210
233
  tzinfo (2.0.6)
211
234
  concurrent-ruby (~> 1.0)
235
+ uri (1.1.1)
236
+ useragent (0.16.11)
212
237
  warden (1.2.9)
213
238
  rack (>= 2.0.9)
214
- webrick (1.8.1)
215
- websocket-driver (0.7.6)
239
+ websocket-driver (0.8.2)
240
+ base64
216
241
  websocket-extensions (>= 0.1.0)
217
242
  websocket-extensions (0.1.5)
218
- zeitwerk (2.6.13)
243
+ zeitwerk (2.8.2)
219
244
 
220
245
  PLATFORMS
221
246
  ruby
@@ -231,4 +256,4 @@ DEPENDENCIES
231
256
  sqlite3
232
257
 
233
258
  BUNDLED WITH
234
- 2.5.22
259
+ 4.0.15
@@ -1,3 +1,5 @@
1
+ require 'open-uri'
2
+
1
3
  class ActiveRecord::Base
2
4
  def self.has_one_attached_deletable(name, **options, &block)
3
5
 
@@ -34,10 +36,14 @@ class ActiveRecord::Base
34
36
  # reset the infos to prevent multiple resize if multiple save
35
37
  instance_variable_set :"@#{name}_infos", nil
36
38
 
39
+ # Skip if any of the required params are missing
40
+ return unless ['width', 'height', 'x', 'y'].all? { |k| params[k].present? }
37
41
  left = params['x'].round
38
42
  top = params['y'].round
39
43
  width = params['width'].round
40
44
  height = params['height'].round
45
+ # Skip if width or height are not > 0
46
+ return if width <= 0 || height <= 0
41
47
  rotation = params['rotate']
42
48
  transformations = {}
43
49
  if ActiveStorage.variant_processor == :mini_magick
@@ -1,3 +1,3 @@
1
1
  module SimpleFormBs5FileInput
2
- VERSION = "0.3.0".freeze
2
+ VERSION = "0.3.2".freeze
3
3
  end
@@ -17,6 +17,7 @@ Gem::Specification.new do |s|
17
17
  'https://github.com/noesya/simple_form_bs5_file_input'
18
18
  s.license = 'MIT'
19
19
 
20
+ s.add_dependency "open-uri"
20
21
  s.add_dependency "rails"
21
22
  s.add_dependency "simple_form"
22
23
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_form_bs5_file_input
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pierre-andré Boissinot
@@ -9,6 +9,20 @@ bindir: bin
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: open-uri
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: '0'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: '0'
12
26
  - !ruby/object:Gem::Dependency
13
27
  name: rails
14
28
  requirement: !ruby/object:Gem::Requirement
@@ -108,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
122
  - !ruby/object:Gem::Version
109
123
  version: '0'
110
124
  requirements: []
111
- rubygems_version: 3.6.9
125
+ rubygems_version: 4.0.10
112
126
  specification_version: 4
113
127
  summary: Simple Form BS5 File Input
114
128
  test_files: []