rails_admin_settings 1.4.0 → 1.6.0
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 +4 -4
- data/.gitignore +1 -0
- data/.rakeTasks +7 -0
- data/.travis.yml +15 -4
- data/CHANGELOG.md +13 -0
- data/Gemfile.lock +156 -116
- data/README.md +16 -1
- data/app/models/rails_admin_settings/setting.rb +0 -1
- data/app/views/rails_admin/main/_setting_value.html.haml +1 -2
- data/lib/generators/rails_admin_settings/templates/migration.rb +3 -0
- data/lib/rails_admin_settings.rb +75 -42
- data/lib/rails_admin_settings/determine_mime_type.rb +193 -0
- data/lib/rails_admin_settings/kinds.rb +1 -0
- data/lib/rails_admin_settings/processing.rb +14 -5
- data/lib/rails_admin_settings/rails_admin_config.rb +2 -3
- data/lib/rails_admin_settings/settings.rb +3 -26
- data/lib/rails_admin_settings/storage/shrine_uploader.rb +14 -0
- data/lib/rails_admin_settings/uploads.rb +12 -1
- data/lib/rails_admin_settings/validation.rb +89 -57
- data/lib/rails_admin_settings/version.rb +1 -1
- data/rails_admin_settings.gemspec +6 -2
- data/spec/factories/setting.rb +1 -1
- data/spec/shrine_spec.rb +34 -0
- data/spec/spec_helper.rb +16 -2
- data/spec/support/1024x768.gif +0 -0
- data/spec/types_spec.rb +7 -0
- metadata +66 -8
- data/.ruby-gemset +0 -2
- data/.ruby-version +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d138604a0c03f484ed60c6a4a3bf3df0c7936c4e28ff18b4914dee9b05276e5a
|
4
|
+
data.tar.gz: 3f37b53322fdd2dc6ae98500b84edb4d91b2ed8638d141226740b80e5a9b09f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d78b5b79ea3487bb14dd67c4ac2a9d6bc97c4027d42fe8ee548d1fefa1b858c7dafcd6df67f03bde8899641e2619ce62a86b95327bb7d688f75c527bb919dd9
|
7
|
+
data.tar.gz: 3aa78be3967ac7178f2389390c82ebb4f845ca1e5dd5e482e40d4c785643a4256e416722fdff2e11dab863b1515f6806e56d711cd149b0be5660aa61cf8c80a9
|
data/.gitignore
CHANGED
data/.rakeTasks
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<Settings><!--This file was automatically generated by Ruby plugin.
|
3
|
+
You are allowed to:
|
4
|
+
1. Remove rake task
|
5
|
+
2. Add existing rake tasks
|
6
|
+
To add existing rake tasks automatically delete this file and reload the project.
|
7
|
+
--><RakeGroup description="" fullCmd="" taksId="rake" /></Settings>
|
data/.travis.yml
CHANGED
@@ -9,12 +9,23 @@ rvm:
|
|
9
9
|
- 2.5.0
|
10
10
|
|
11
11
|
env:
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
12
|
+
global:
|
13
|
+
- CC_TEST_REPORTER_ID=f23ba257d0a12c588551991b4377e3eb218c1ff80050bc48c6b18c49ca16cb62
|
14
|
+
matrix:
|
15
|
+
- "UPLOADS=paperclip"
|
16
|
+
- "UPLOADS=carrierwave"
|
17
|
+
- "UPLOADS=shrine"
|
18
|
+
- "RAILS=1 UPLOADS=paperclip"
|
19
|
+
- "RAILS=1 UPLOADS=carrierwave"
|
20
|
+
- "RAILS=1 UPLOADS=shrine"
|
16
21
|
|
17
22
|
gemfile:
|
18
23
|
- gemfiles/mongoid-6.0.gemfile
|
19
24
|
- gemfiles/mongoid-6.3.gemfile
|
20
25
|
|
26
|
+
before_script:
|
27
|
+
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
28
|
+
- chmod +x ./cc-test-reporter
|
29
|
+
- ./cc-test-reporter before-build
|
30
|
+
after_script:
|
31
|
+
- ./cc-test-reporter after-build --debug --exit-code $TRAVIS_TEST_RESULT
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,193 +1,229 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rails_admin_settings (1.
|
4
|
+
rails_admin_settings (1.6.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
actioncable (5.
|
10
|
-
actionpack (= 5.
|
9
|
+
actioncable (5.2.3)
|
10
|
+
actionpack (= 5.2.3)
|
11
11
|
nio4r (~> 2.0)
|
12
|
-
websocket-driver (
|
13
|
-
actionmailer (5.
|
14
|
-
actionpack (= 5.
|
15
|
-
actionview (= 5.
|
16
|
-
activejob (= 5.
|
12
|
+
websocket-driver (>= 0.6.1)
|
13
|
+
actionmailer (5.2.3)
|
14
|
+
actionpack (= 5.2.3)
|
15
|
+
actionview (= 5.2.3)
|
16
|
+
activejob (= 5.2.3)
|
17
17
|
mail (~> 2.5, >= 2.5.4)
|
18
18
|
rails-dom-testing (~> 2.0)
|
19
|
-
actionpack (5.
|
20
|
-
actionview (= 5.
|
21
|
-
activesupport (= 5.
|
19
|
+
actionpack (5.2.3)
|
20
|
+
actionview (= 5.2.3)
|
21
|
+
activesupport (= 5.2.3)
|
22
22
|
rack (~> 2.0)
|
23
23
|
rack-test (>= 0.6.3)
|
24
24
|
rails-dom-testing (~> 2.0)
|
25
25
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
26
|
-
actionview (5.
|
27
|
-
activesupport (= 5.
|
26
|
+
actionview (5.2.3)
|
27
|
+
activesupport (= 5.2.3)
|
28
28
|
builder (~> 3.1)
|
29
29
|
erubi (~> 1.4)
|
30
30
|
rails-dom-testing (~> 2.0)
|
31
31
|
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
32
|
-
activejob (5.
|
33
|
-
activesupport (= 5.
|
32
|
+
activejob (5.2.3)
|
33
|
+
activesupport (= 5.2.3)
|
34
34
|
globalid (>= 0.3.6)
|
35
|
-
activemodel (5.
|
36
|
-
activesupport (= 5.
|
37
|
-
activerecord (5.
|
38
|
-
activemodel (= 5.
|
39
|
-
activesupport (= 5.
|
40
|
-
arel (
|
41
|
-
|
35
|
+
activemodel (5.2.3)
|
36
|
+
activesupport (= 5.2.3)
|
37
|
+
activerecord (5.2.3)
|
38
|
+
activemodel (= 5.2.3)
|
39
|
+
activesupport (= 5.2.3)
|
40
|
+
arel (>= 9.0)
|
41
|
+
activestorage (5.2.3)
|
42
|
+
actionpack (= 5.2.3)
|
43
|
+
activerecord (= 5.2.3)
|
44
|
+
marcel (~> 0.3.1)
|
45
|
+
activesupport (5.2.3)
|
42
46
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
43
|
-
i18n (
|
47
|
+
i18n (>= 0.7, < 2)
|
44
48
|
minitest (~> 5.1)
|
45
49
|
tzinfo (~> 1.1)
|
46
|
-
addressable (2.
|
50
|
+
addressable (2.6.0)
|
47
51
|
public_suffix (>= 2.0.2, < 4.0)
|
48
|
-
arel (
|
49
|
-
|
52
|
+
arel (9.0.0)
|
53
|
+
ast (2.4.0)
|
54
|
+
bson (4.5.0)
|
50
55
|
builder (3.2.3)
|
51
|
-
carrierwave (1.
|
56
|
+
carrierwave (1.3.1)
|
52
57
|
activemodel (>= 4.0.0)
|
53
58
|
activesupport (>= 4.0.0)
|
54
59
|
mime-types (>= 1.16)
|
55
|
-
carrierwave-mongoid (1.
|
56
|
-
carrierwave (>= 0.8, <
|
57
|
-
mongoid (>= 3.0, <
|
60
|
+
carrierwave-mongoid (1.3.0)
|
61
|
+
carrierwave (>= 0.8, < 3)
|
62
|
+
mongoid (>= 3.0, < 8.0)
|
58
63
|
mongoid-grid_fs (>= 1.3, < 3.0)
|
59
64
|
climate_control (0.2.0)
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
crass (1.0.3)
|
65
|
-
database_cleaner (1.6.2)
|
65
|
+
concurrent-ruby (1.1.5)
|
66
|
+
content_disposition (1.0.0)
|
67
|
+
crass (1.0.4)
|
68
|
+
database_cleaner (1.7.0)
|
66
69
|
diff-lcs (1.3)
|
67
|
-
docile (1.
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
70
|
+
docile (1.3.2)
|
71
|
+
down (5.1.1)
|
72
|
+
addressable (~> 2.5)
|
73
|
+
erubi (1.8.0)
|
74
|
+
factory_bot (5.0.2)
|
75
|
+
activesupport (>= 4.2.0)
|
76
|
+
ffi (1.13.0)
|
77
|
+
geocoder (1.5.1)
|
78
|
+
globalid (0.4.2)
|
73
79
|
activesupport (>= 4.2.0)
|
74
|
-
i18n (
|
80
|
+
i18n (1.6.0)
|
75
81
|
concurrent-ruby (~> 1.0)
|
76
|
-
|
77
|
-
|
82
|
+
image_processing (1.11.0)
|
83
|
+
mini_magick (>= 4.9.5, < 5)
|
84
|
+
ruby-vips (>= 2.0.17, < 3)
|
85
|
+
jaro_winkler (1.5.3)
|
86
|
+
json (2.2.0)
|
87
|
+
loofah (2.2.3)
|
78
88
|
crass (~> 1.0.2)
|
79
89
|
nokogiri (>= 1.5.9)
|
80
|
-
mail (2.7.
|
90
|
+
mail (2.7.1)
|
81
91
|
mini_mime (>= 0.1.1)
|
82
|
-
|
83
|
-
|
92
|
+
marcel (0.3.3)
|
93
|
+
mimemagic (~> 0.3.2)
|
94
|
+
method_source (0.9.2)
|
95
|
+
mime-types (3.2.2)
|
84
96
|
mime-types-data (~> 3.2015)
|
85
|
-
mime-types-data (3.
|
86
|
-
mimemagic (0.3.
|
87
|
-
|
88
|
-
|
97
|
+
mime-types-data (3.2019.0331)
|
98
|
+
mimemagic (0.3.3)
|
99
|
+
mini_magick (4.10.1)
|
100
|
+
mini_mime (1.0.2)
|
101
|
+
mini_portile2 (2.4.0)
|
89
102
|
minitest (5.11.3)
|
90
|
-
mongo (2.
|
91
|
-
bson (>= 4.
|
92
|
-
mongoid (6.
|
93
|
-
activemodel (
|
94
|
-
mongo (>= 2.5.
|
103
|
+
mongo (2.9.0)
|
104
|
+
bson (>= 4.4.2, < 5.0.0)
|
105
|
+
mongoid (6.4.4)
|
106
|
+
activemodel (>= 5.1, < 6.0.0)
|
107
|
+
mongo (>= 2.5.1, < 3.0.0)
|
95
108
|
mongoid-compatibility (0.5.1)
|
96
109
|
activesupport
|
97
110
|
mongoid (>= 2.0)
|
98
|
-
mongoid-grid_fs (2.
|
111
|
+
mongoid-grid_fs (2.4.0)
|
99
112
|
mime-types (>= 1.0, < 4.0)
|
100
|
-
mongoid (>= 3.0, <
|
113
|
+
mongoid (>= 3.0, < 8.0)
|
101
114
|
mongoid-paperclip (0.0.11)
|
102
115
|
mongoid
|
103
116
|
paperclip (>= 2.3.6, != 4.3.0)
|
104
|
-
mongoid-rspec (4.0.
|
117
|
+
mongoid-rspec (4.0.1)
|
105
118
|
activesupport (>= 3.0.0)
|
106
|
-
mongoid (>=
|
107
|
-
mongoid-compatibility
|
119
|
+
mongoid (>= 3.1)
|
120
|
+
mongoid-compatibility (>= 0.5.1)
|
108
121
|
rspec (~> 3.3)
|
109
|
-
nio4r (2.
|
110
|
-
nokogiri (1.
|
111
|
-
mini_portile2 (~> 2.
|
112
|
-
nokogumbo (
|
113
|
-
nokogiri
|
114
|
-
paperclip (
|
122
|
+
nio4r (2.4.0)
|
123
|
+
nokogiri (1.10.3)
|
124
|
+
mini_portile2 (~> 2.4.0)
|
125
|
+
nokogumbo (2.0.1)
|
126
|
+
nokogiri (~> 1.8, >= 1.8.4)
|
127
|
+
paperclip (6.1.0)
|
115
128
|
activemodel (>= 4.2.0)
|
116
129
|
activesupport (>= 4.2.0)
|
117
|
-
cocaine (~> 0.5.5)
|
118
130
|
mime-types
|
119
131
|
mimemagic (~> 0.3.0)
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
rack
|
132
|
+
terrapin (~> 0.6.0)
|
133
|
+
parallel (1.17.0)
|
134
|
+
parser (2.6.3.0)
|
135
|
+
ast (~> 2.4.0)
|
136
|
+
public_suffix (3.1.1)
|
137
|
+
rack (2.0.7)
|
138
|
+
rack-test (1.1.0)
|
126
139
|
rack (>= 1.0, < 3)
|
127
|
-
rails (5.
|
128
|
-
actioncable (= 5.
|
129
|
-
actionmailer (= 5.
|
130
|
-
actionpack (= 5.
|
131
|
-
actionview (= 5.
|
132
|
-
activejob (= 5.
|
133
|
-
activemodel (= 5.
|
134
|
-
activerecord (= 5.
|
135
|
-
|
140
|
+
rails (5.2.3)
|
141
|
+
actioncable (= 5.2.3)
|
142
|
+
actionmailer (= 5.2.3)
|
143
|
+
actionpack (= 5.2.3)
|
144
|
+
actionview (= 5.2.3)
|
145
|
+
activejob (= 5.2.3)
|
146
|
+
activemodel (= 5.2.3)
|
147
|
+
activerecord (= 5.2.3)
|
148
|
+
activestorage (= 5.2.3)
|
149
|
+
activesupport (= 5.2.3)
|
136
150
|
bundler (>= 1.3.0)
|
137
|
-
railties (= 5.
|
151
|
+
railties (= 5.2.3)
|
138
152
|
sprockets-rails (>= 2.0.0)
|
139
153
|
rails-dom-testing (2.0.3)
|
140
154
|
activesupport (>= 4.2.0)
|
141
155
|
nokogiri (>= 1.6)
|
142
|
-
rails-html-sanitizer (1.0.
|
143
|
-
loofah (~> 2.
|
144
|
-
railties (5.
|
145
|
-
actionpack (= 5.
|
146
|
-
activesupport (= 5.
|
156
|
+
rails-html-sanitizer (1.0.4)
|
157
|
+
loofah (~> 2.2, >= 2.2.2)
|
158
|
+
railties (5.2.3)
|
159
|
+
actionpack (= 5.2.3)
|
160
|
+
activesupport (= 5.2.3)
|
147
161
|
method_source
|
148
162
|
rake (>= 0.8.7)
|
149
|
-
thor (>= 0.
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
rspec-
|
154
|
-
rspec-
|
155
|
-
|
156
|
-
|
157
|
-
|
163
|
+
thor (>= 0.19.0, < 2.0)
|
164
|
+
rainbow (3.0.0)
|
165
|
+
rake (12.3.3)
|
166
|
+
rspec (3.8.0)
|
167
|
+
rspec-core (~> 3.8.0)
|
168
|
+
rspec-expectations (~> 3.8.0)
|
169
|
+
rspec-mocks (~> 3.8.0)
|
170
|
+
rspec-core (3.8.2)
|
171
|
+
rspec-support (~> 3.8.0)
|
172
|
+
rspec-expectations (3.8.4)
|
158
173
|
diff-lcs (>= 1.2.0, < 2.0)
|
159
|
-
rspec-support (~> 3.
|
160
|
-
rspec-mocks (3.
|
174
|
+
rspec-support (~> 3.8.0)
|
175
|
+
rspec-mocks (3.8.1)
|
161
176
|
diff-lcs (>= 1.2.0, < 2.0)
|
162
|
-
rspec-support (~> 3.
|
163
|
-
rspec-support (3.
|
164
|
-
|
165
|
-
|
166
|
-
|
177
|
+
rspec-support (~> 3.8.0)
|
178
|
+
rspec-support (3.8.2)
|
179
|
+
rubocop (0.74.0)
|
180
|
+
jaro_winkler (~> 1.5.1)
|
181
|
+
parallel (~> 1.10)
|
182
|
+
parser (>= 2.6)
|
183
|
+
rainbow (>= 2.2.2, < 4.0)
|
184
|
+
ruby-progressbar (~> 1.7)
|
185
|
+
unicode-display_width (>= 1.4.0, < 1.7)
|
186
|
+
rubocop-rspec (1.30.1)
|
187
|
+
rubocop (>= 0.60.0)
|
188
|
+
ruby-progressbar (1.10.1)
|
189
|
+
ruby-vips (2.0.17)
|
190
|
+
ffi (~> 1.9)
|
191
|
+
russian_phone (0.6.1)
|
192
|
+
safe_yaml (1.0.5)
|
193
|
+
sanitize (5.0.0)
|
167
194
|
crass (~> 1.0.2)
|
168
|
-
nokogiri (>= 1.
|
169
|
-
nokogumbo (~>
|
170
|
-
|
171
|
-
|
195
|
+
nokogiri (>= 1.8.0)
|
196
|
+
nokogumbo (~> 2.0)
|
197
|
+
shrine (3.2.1)
|
198
|
+
content_disposition (~> 1.0)
|
199
|
+
down (~> 5.1)
|
200
|
+
shrine-mongoid (1.0.0)
|
201
|
+
mongoid (>= 5.0)
|
202
|
+
shrine (>= 3.0.0.beta3, < 4)
|
203
|
+
simplecov (0.17.0)
|
204
|
+
docile (~> 1.1)
|
172
205
|
json (>= 1.8, < 3)
|
173
206
|
simplecov-html (~> 0.10.0)
|
174
207
|
simplecov-html (0.10.2)
|
175
|
-
sprockets (3.7.
|
208
|
+
sprockets (3.7.2)
|
176
209
|
concurrent-ruby (~> 1.0)
|
177
210
|
rack (> 1, < 3)
|
178
211
|
sprockets-rails (3.2.1)
|
179
212
|
actionpack (>= 4.0)
|
180
213
|
activesupport (>= 4.0)
|
181
214
|
sprockets (>= 3.0.0)
|
182
|
-
|
215
|
+
terrapin (0.6.0)
|
216
|
+
climate_control (>= 0.0.3, < 1.0)
|
217
|
+
thor (0.20.3)
|
183
218
|
thread_safe (0.3.6)
|
184
219
|
tzinfo (1.2.5)
|
185
220
|
thread_safe (~> 0.1)
|
221
|
+
unicode-display_width (1.6.0)
|
186
222
|
validates_email_format_of (1.6.3)
|
187
223
|
i18n
|
188
|
-
websocket-driver (0.
|
224
|
+
websocket-driver (0.7.1)
|
189
225
|
websocket-extensions (>= 0.1.0)
|
190
|
-
websocket-extensions (0.1.
|
226
|
+
websocket-extensions (0.1.4)
|
191
227
|
|
192
228
|
PLATFORMS
|
193
229
|
ruby
|
@@ -199,19 +235,23 @@ DEPENDENCIES
|
|
199
235
|
database_cleaner
|
200
236
|
factory_bot
|
201
237
|
geocoder
|
238
|
+
image_processing
|
239
|
+
mini_magick
|
202
240
|
mongoid (~> 6.3)
|
203
241
|
mongoid-paperclip
|
204
242
|
mongoid-rspec
|
205
|
-
pry
|
206
243
|
rails
|
207
244
|
rails_admin_settings!
|
208
245
|
rake
|
209
246
|
rspec
|
247
|
+
rubocop-rspec
|
210
248
|
russian_phone
|
211
249
|
safe_yaml
|
212
250
|
sanitize
|
251
|
+
shrine (~> 3.0)
|
252
|
+
shrine-mongoid (~> 1.0)
|
213
253
|
simplecov
|
214
254
|
validates_email_format_of
|
215
255
|
|
216
256
|
BUNDLED WITH
|
217
|
-
1.
|
257
|
+
1.17.3
|
data/README.md
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
# RailsAdminSettings
|
2
2
|
|
3
|
+
Master repository has moved to gitlab, all new code will be there:
|
4
|
+
|
5
|
+
https://gitlab.com/rocket-science/rails_admin_settings
|
6
|
+
|
7
|
+
|
3
8
|
[](http://travis-ci.org/rs-pro/rails_admin_settings)
|
4
|
-
[](https://badge.fury.io/rb/rails_admin_settings)
|
10
|
+
[](https://hakiri.io/github/rs-pro/rails_admin_settings/master)
|
11
|
+
[](https://codeclimate.com/github/rs-pro/rails_admin_settings/maintainability)
|
12
|
+
[](https://codeclimate.com/github/rs-pro/rails_admin_settings/test_coverage)
|
5
13
|
|
6
14
|
App settings editable via RailsAdmin with support for ActiveRecord and Mongoid.
|
7
15
|
|
@@ -134,6 +142,13 @@ Simple format types are stored in db as-is.
|
|
134
142
|
|
135
143
|
Rails admin management for settings is supported out of the box
|
136
144
|
|
145
|
+
It is recommended to disable new/create page (it is not supported by design, settings are defined in ruby code).
|
146
|
+
Disable via cancan:
|
147
|
+
|
148
|
+
```
|
149
|
+
cannot :create, RailsAdminSettings::Setting
|
150
|
+
```
|
151
|
+
|
137
152
|
## Contributing
|
138
153
|
|
139
154
|
1. Fork it
|