simple_form_bs5_file_input 0.3.0 → 0.3.1

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: 571aeb22f6990e2036122289c282c284b6cabd709188d65860f51ab41da177b4
4
+ data.tar.gz: b859bb2e11e80a1f41df47c1e6a361798b23598a13a186dfbf60fd567ef4c626
5
5
  SHA512:
6
- metadata.gz: c82a7860aea72365d85d4d56bb2eb2cc9799d6190b0b3dc63161f2b8ec592ec7f695ee788ce25b4d43df043085d519485e869c0be6154824cc23592c43c6f947
7
- data.tar.gz: cce043be273e5c0d2519f55a6a0c79e108d968da87a68cb5325e501c44c46f4810477bc42846c82462766f84792da9c7913e8655b96c4cd5097d09adf58347ed
6
+ metadata.gz: 025d702681c9879c047c2f28c50fe71e8ebb9479a6c727b0bc895eeca6a82a933f63d7779f9a94e0aa776ca304716744b6aaa3a642183dea67936e1697861a3e
7
+ data.tar.gz: 8726bfd3e0f5b70a92ba71769252e2445e7f6fd3e8c5c4726920ea47d80cf96a688dbe2c80527131966e37b52ad07680e4b3eda7f50afedc136e41320cb4960d
data/Gemfile.lock CHANGED
@@ -1,221 +1,235 @@
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.1)
5
5
  rails
6
6
  simple_form
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- actioncable (7.1.3.2)
12
- actionpack (= 7.1.3.2)
13
- activesupport (= 7.1.3.2)
11
+ action_text-trix (2.1.16)
12
+ railties
13
+ actioncable (8.1.2)
14
+ actionpack (= 8.1.2)
15
+ activesupport (= 8.1.2)
14
16
  nio4r (~> 2.0)
15
17
  websocket-driver (>= 0.6.1)
16
18
  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
19
+ actionmailbox (8.1.2)
20
+ actionpack (= 8.1.2)
21
+ activejob (= 8.1.2)
22
+ activerecord (= 8.1.2)
23
+ activestorage (= 8.1.2)
24
+ activesupport (= 8.1.2)
25
+ mail (>= 2.8.0)
26
+ actionmailer (8.1.2)
27
+ actionpack (= 8.1.2)
28
+ actionview (= 8.1.2)
29
+ activejob (= 8.1.2)
30
+ activesupport (= 8.1.2)
31
+ mail (>= 2.8.0)
36
32
  rails-dom-testing (~> 2.2)
37
- actionpack (7.1.3.2)
38
- actionview (= 7.1.3.2)
39
- activesupport (= 7.1.3.2)
33
+ actionpack (8.1.2)
34
+ actionview (= 8.1.2)
35
+ activesupport (= 8.1.2)
40
36
  nokogiri (>= 1.8.5)
41
- racc
42
37
  rack (>= 2.2.4)
43
38
  rack-session (>= 1.0.1)
44
39
  rack-test (>= 0.6.3)
45
40
  rails-dom-testing (~> 2.2)
46
41
  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)
42
+ useragent (~> 0.16)
43
+ actiontext (8.1.2)
44
+ action_text-trix (~> 2.1.15)
45
+ actionpack (= 8.1.2)
46
+ activerecord (= 8.1.2)
47
+ activestorage (= 8.1.2)
48
+ activesupport (= 8.1.2)
52
49
  globalid (>= 0.6.0)
53
50
  nokogiri (>= 1.8.5)
54
- actionview (7.1.3.2)
55
- activesupport (= 7.1.3.2)
51
+ actionview (8.1.2)
52
+ activesupport (= 8.1.2)
56
53
  builder (~> 3.1)
57
54
  erubi (~> 1.11)
58
55
  rails-dom-testing (~> 2.2)
59
56
  rails-html-sanitizer (~> 1.6)
60
- activejob (7.1.3.2)
61
- activesupport (= 7.1.3.2)
57
+ activejob (8.1.2)
58
+ activesupport (= 8.1.2)
62
59
  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)
60
+ activemodel (8.1.2)
61
+ activesupport (= 8.1.2)
62
+ activerecord (8.1.2)
63
+ activemodel (= 8.1.2)
64
+ activesupport (= 8.1.2)
68
65
  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)
66
+ activestorage (8.1.2)
67
+ actionpack (= 8.1.2)
68
+ activejob (= 8.1.2)
69
+ activerecord (= 8.1.2)
70
+ activesupport (= 8.1.2)
74
71
  marcel (~> 1.0)
75
- activesupport (7.1.3.2)
72
+ activesupport (8.1.2)
76
73
  base64
77
74
  bigdecimal
78
- concurrent-ruby (~> 1.0, >= 1.0.2)
75
+ concurrent-ruby (~> 1.0, >= 1.3.1)
79
76
  connection_pool (>= 2.2.5)
80
77
  drb
81
78
  i18n (>= 1.6, < 2)
79
+ json
80
+ logger (>= 1.4.2)
82
81
  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)
82
+ securerandom (>= 0.3)
83
+ tzinfo (~> 2.0, >= 2.0.5)
84
+ uri (>= 0.13.1)
85
+ base64 (0.3.0)
86
+ bcrypt (3.1.21)
87
+ bigdecimal (4.0.1)
88
+ bootsnap (1.21.1)
91
89
  msgpack (~> 1.2)
92
- bootstrap (5.3.2)
93
- autoprefixer-rails (>= 9.1.0)
90
+ bootstrap (5.3.8)
94
91
  popper_js (>= 2.11.8, < 3)
95
- builder (3.2.4)
96
- concurrent-ruby (1.2.3)
97
- connection_pool (2.4.1)
92
+ builder (3.3.0)
93
+ concurrent-ruby (1.3.6)
94
+ connection_pool (3.0.2)
98
95
  crass (1.0.6)
99
- date (3.3.4)
100
- devise (4.9.3)
96
+ date (3.5.1)
97
+ devise (5.0.0)
101
98
  bcrypt (~> 3.0)
102
99
  orm_adapter (~> 0.1)
103
- railties (>= 4.1.0)
100
+ railties (>= 7.0)
104
101
  responders
105
102
  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)
103
+ drb (2.2.3)
104
+ erb (6.0.1)
105
+ erubi (1.13.1)
106
+ ffi (1.17.3)
107
+ globalid (1.3.0)
111
108
  activesupport (>= 6.1)
112
- i18n (1.14.4)
109
+ i18n (1.14.8)
113
110
  concurrent-ruby (~> 1.0)
114
- io-console (0.7.2)
115
- irb (1.12.0)
116
- rdoc
111
+ io-console (0.8.2)
112
+ irb (1.16.0)
113
+ pp (>= 0.6.0)
114
+ rdoc (>= 4.0.0)
117
115
  reline (>= 0.4.2)
118
- listen (3.9.0)
116
+ json (2.18.0)
117
+ listen (3.10.0)
118
+ logger
119
119
  rb-fsevent (~> 0.10, >= 0.10.3)
120
120
  rb-inotify (~> 0.9, >= 0.9.10)
121
- loofah (2.22.0)
121
+ logger (1.7.0)
122
+ loofah (2.25.0)
122
123
  crass (~> 1.0.2)
123
124
  nokogiri (>= 1.12.0)
124
- mail (2.8.1)
125
+ mail (2.9.0)
126
+ logger
125
127
  mini_mime (>= 0.1.1)
126
128
  net-imap
127
129
  net-pop
128
130
  net-smtp
129
- marcel (1.0.4)
131
+ marcel (1.1.0)
130
132
  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)
133
+ mini_portile2 (2.8.9)
134
+ minitest (6.0.1)
135
+ prism (~> 1.5)
136
+ msgpack (1.8.0)
137
+ net-imap (0.6.2)
136
138
  date
137
139
  net-protocol
138
140
  net-pop (0.1.2)
139
141
  net-protocol
140
142
  net-protocol (0.2.2)
141
143
  timeout
142
- net-smtp (0.5.0)
144
+ net-smtp (0.5.1)
143
145
  net-protocol
144
- nio4r (2.7.3)
145
- nokogiri (1.16.2)
146
+ nio4r (2.7.5)
147
+ nokogiri (1.19.0)
146
148
  mini_portile2 (~> 2.8.2)
147
149
  racc (~> 1.4)
148
150
  orm_adapter (0.5.0)
149
- pg (1.5.6)
151
+ pg (1.6.3)
150
152
  popper_js (2.11.8)
151
- psych (5.1.2)
153
+ pp (0.6.3)
154
+ prettyprint
155
+ prettyprint (0.2.0)
156
+ prism (1.8.0)
157
+ psych (5.3.1)
158
+ date
152
159
  stringio
153
- racc (1.7.3)
154
- rack (3.0.9.1)
155
- rack-session (2.0.0)
160
+ racc (1.8.1)
161
+ rack (3.2.4)
162
+ rack-session (2.1.1)
163
+ base64 (>= 0.1.0)
156
164
  rack (>= 3.0.0)
157
- rack-test (2.1.0)
165
+ rack-test (2.2.0)
158
166
  rack (>= 1.3)
159
- rackup (2.1.0)
167
+ rackup (2.3.1)
160
168
  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)
169
+ rails (8.1.2)
170
+ actioncable (= 8.1.2)
171
+ actionmailbox (= 8.1.2)
172
+ actionmailer (= 8.1.2)
173
+ actionpack (= 8.1.2)
174
+ actiontext (= 8.1.2)
175
+ actionview (= 8.1.2)
176
+ activejob (= 8.1.2)
177
+ activemodel (= 8.1.2)
178
+ activerecord (= 8.1.2)
179
+ activestorage (= 8.1.2)
180
+ activesupport (= 8.1.2)
174
181
  bundler (>= 1.15.0)
175
- railties (= 7.1.3.2)
176
- rails-dom-testing (2.2.0)
182
+ railties (= 8.1.2)
183
+ rails-dom-testing (2.3.0)
177
184
  activesupport (>= 5.0.0)
178
185
  minitest
179
186
  nokogiri (>= 1.6)
180
- rails-html-sanitizer (1.6.0)
187
+ rails-html-sanitizer (1.6.2)
181
188
  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
189
+ 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)
190
+ railties (8.1.2)
191
+ actionpack (= 8.1.2)
192
+ activesupport (= 8.1.2)
193
+ irb (~> 1.13)
187
194
  rackup (>= 1.0.0)
188
195
  rake (>= 12.2)
189
196
  thor (~> 1.0, >= 1.2.2)
197
+ tsort (>= 0.2)
190
198
  zeitwerk (~> 2.6)
191
- rake (13.1.0)
199
+ rake (13.3.1)
192
200
  rb-fsevent (0.11.2)
193
- rb-inotify (0.10.1)
201
+ rb-inotify (0.11.1)
194
202
  ffi (~> 1.0)
195
- rdoc (6.6.2)
203
+ rdoc (7.1.0)
204
+ erb
196
205
  psych (>= 4.0.0)
197
- reline (0.4.3)
206
+ tsort
207
+ reline (0.6.3)
198
208
  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)
209
+ responders (3.2.0)
210
+ actionpack (>= 7.0)
211
+ railties (>= 7.0)
212
+ securerandom (0.4.1)
213
+ simple_form (5.4.1)
214
+ actionpack (>= 7.0)
215
+ activemodel (>= 7.0)
216
+ sqlite3 (2.9.0)
206
217
  mini_portile2 (~> 2.8.0)
207
- stringio (3.1.0)
208
- thor (1.3.1)
209
- timeout (0.4.1)
218
+ stringio (3.2.0)
219
+ thor (1.5.0)
220
+ timeout (0.6.0)
221
+ tsort (0.2.0)
210
222
  tzinfo (2.0.6)
211
223
  concurrent-ruby (~> 1.0)
224
+ uri (1.1.1)
225
+ useragent (0.16.11)
212
226
  warden (1.2.9)
213
227
  rack (>= 2.0.9)
214
- webrick (1.8.1)
215
- websocket-driver (0.7.6)
228
+ websocket-driver (0.8.0)
229
+ base64
216
230
  websocket-extensions (>= 0.1.0)
217
231
  websocket-extensions (0.1.5)
218
- zeitwerk (2.6.13)
232
+ zeitwerk (2.7.4)
219
233
 
220
234
  PLATFORMS
221
235
  ruby
@@ -34,10 +34,14 @@ class ActiveRecord::Base
34
34
  # reset the infos to prevent multiple resize if multiple save
35
35
  instance_variable_set :"@#{name}_infos", nil
36
36
 
37
+ # Skip if any of the required params are missing
38
+ return unless ['width', 'height', 'x', 'y'].all? { |k| params[k].present? }
37
39
  left = params['x'].round
38
40
  top = params['y'].round
39
41
  width = params['width'].round
40
42
  height = params['height'].round
43
+ # Skip if width or height are not > 0
44
+ return if width <= 0 || height <= 0
41
45
  rotation = params['rotate']
42
46
  transformations = {}
43
47
  if ActiveStorage.variant_processor == :mini_magick
@@ -1,3 +1,3 @@
1
1
  module SimpleFormBs5FileInput
2
- VERSION = "0.3.0".freeze
2
+ VERSION = "0.3.1".freeze
3
3
  end
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.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pierre-andré Boissinot
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  - !ruby/object:Gem::Version
109
109
  version: '0'
110
110
  requirements: []
111
- rubygems_version: 3.6.9
111
+ rubygems_version: 4.0.3
112
112
  specification_version: 4
113
113
  summary: Simple Form BS5 File Input
114
114
  test_files: []