ack_rails_admin_settings 1.2.1.1 → 1.2.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +120 -97
- data/lib/rails_admin_settings/engine.rb +3 -2
- data/lib/rails_admin_settings/namespaced.rb +5 -6
- data/lib/rails_admin_settings/processing.rb +3 -1
- data/lib/rails_admin_settings/rails_admin_config.rb +27 -2
- data/lib/rails_admin_settings/version.rb +1 -1
- data/rails_admin_settings.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b13bafa47596e52734635fa0c11fad17df62f733
|
4
|
+
data.tar.gz: 8b2dbfc4e5a4235cd504a79c1cf056f73b9ef93b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f02b37b4b569bf9292cf65ea347868a6320f421a40137985027310a2e34b00282aac3fed4c35aefeeef92f1853b156dc6d574b47eff3596a10edf887cc6b0f2
|
7
|
+
data.tar.gz: 79af9165cb7fd402ded4bcf9389d8d5c73abdef0086e62bea6a781338b9cabfc51f6464c779a5eea7c7c439d8e2795cfa15f659cf50a39574462d9323ec5d8a7
|
data/Gemfile.lock
CHANGED
@@ -1,130 +1,150 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ack_rails_admin_settings (1.2.1.
|
4
|
+
ack_rails_admin_settings (1.2.1.2)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
|
10
|
-
actionpack (=
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
9
|
+
actioncable (5.0.1)
|
10
|
+
actionpack (= 5.0.1)
|
11
|
+
nio4r (~> 1.2)
|
12
|
+
websocket-driver (~> 0.6.1)
|
13
|
+
actionmailer (5.0.1)
|
14
|
+
actionpack (= 5.0.1)
|
15
|
+
actionview (= 5.0.1)
|
16
|
+
activejob (= 5.0.1)
|
17
|
+
mail (~> 2.5, >= 2.5.4)
|
18
|
+
rails-dom-testing (~> 2.0)
|
19
|
+
actionpack (5.0.1)
|
20
|
+
actionview (= 5.0.1)
|
21
|
+
activesupport (= 5.0.1)
|
22
|
+
rack (~> 2.0)
|
23
|
+
rack-test (~> 0.6.3)
|
24
|
+
rails-dom-testing (~> 2.0)
|
25
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
26
|
+
actionview (5.0.1)
|
27
|
+
activesupport (= 5.0.1)
|
28
|
+
builder (~> 3.1)
|
16
29
|
erubis (~> 2.7.0)
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
activemodel (
|
23
|
-
activesupport (=
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
activesupport (3.2.22.5)
|
34
|
-
i18n (~> 0.6, >= 0.6.4)
|
35
|
-
multi_json (~> 1.0)
|
30
|
+
rails-dom-testing (~> 2.0)
|
31
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
32
|
+
activejob (5.0.1)
|
33
|
+
activesupport (= 5.0.1)
|
34
|
+
globalid (>= 0.3.6)
|
35
|
+
activemodel (5.0.1)
|
36
|
+
activesupport (= 5.0.1)
|
37
|
+
activerecord (5.0.1)
|
38
|
+
activemodel (= 5.0.1)
|
39
|
+
activesupport (= 5.0.1)
|
40
|
+
arel (~> 7.0)
|
41
|
+
activesupport (5.0.1)
|
42
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
43
|
+
i18n (~> 0.7)
|
44
|
+
minitest (~> 5.1)
|
45
|
+
tzinfo (~> 1.1)
|
36
46
|
addressable (2.5.0)
|
37
47
|
public_suffix (~> 2.0, >= 2.0.2)
|
38
|
-
arel (
|
39
|
-
|
40
|
-
|
48
|
+
arel (7.1.4)
|
49
|
+
bson (3.2.6)
|
50
|
+
builder (3.2.3)
|
51
|
+
carrierwave (0.9.0)
|
41
52
|
activemodel (>= 3.2.0)
|
42
53
|
activesupport (>= 3.2.0)
|
43
54
|
json (>= 1.7)
|
44
|
-
|
45
|
-
climate_control (0.0.3)
|
46
|
-
activesupport (>= 3.0)
|
55
|
+
climate_control (0.1.0)
|
47
56
|
cocaine (0.5.8)
|
48
57
|
climate_control (>= 0.0.3, < 1.0)
|
49
58
|
coderay (1.1.1)
|
59
|
+
concurrent-ruby (1.0.4)
|
60
|
+
connection_pool (2.2.1)
|
50
61
|
crass (1.0.2)
|
51
62
|
database_cleaner (1.5.3)
|
52
|
-
diff-lcs (1.
|
63
|
+
diff-lcs (1.3)
|
53
64
|
docile (1.1.5)
|
54
65
|
erubis (2.7.0)
|
55
66
|
factory_girl (4.8.0)
|
56
67
|
activesupport (>= 3.0.0)
|
57
68
|
geocoder (1.4.1)
|
58
|
-
glebtv-carrierwave-mongoid (0.
|
59
|
-
carrierwave (
|
60
|
-
mongoid (
|
61
|
-
glebtv-mongoid-paperclip (0.
|
69
|
+
glebtv-carrierwave-mongoid (0.7.0)
|
70
|
+
carrierwave (~> 0.9.0)
|
71
|
+
mongoid (~> 4.0.0.alpha1)
|
72
|
+
glebtv-mongoid-paperclip (0.5.0)
|
62
73
|
mongoid (>= 3.0, < 6.1)
|
63
|
-
paperclip (~>
|
64
|
-
|
74
|
+
paperclip (~> 5.1.0)
|
75
|
+
globalid (0.3.7)
|
76
|
+
activesupport (>= 4.1.0)
|
65
77
|
i18n (0.7.0)
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
78
|
+
json (2.0.3)
|
79
|
+
loofah (2.0.3)
|
80
|
+
nokogiri (>= 1.5.9)
|
81
|
+
mail (2.6.4)
|
82
|
+
mime-types (>= 1.16, < 4)
|
71
83
|
method_source (0.8.2)
|
72
|
-
mime-types (
|
73
|
-
|
84
|
+
mime-types (3.1)
|
85
|
+
mime-types-data (~> 3.2015)
|
86
|
+
mime-types-data (3.2016.0521)
|
87
|
+
mimemagic (0.3.2)
|
74
88
|
mini_portile2 (2.1.0)
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
89
|
+
minitest (5.10.1)
|
90
|
+
mongoid (4.0.0.beta2)
|
91
|
+
activemodel (>= 4.0.0)
|
92
|
+
moped (~> 2.0.beta6)
|
93
|
+
origin (~> 2.1)
|
94
|
+
tzinfo (>= 0.3.37)
|
95
|
+
mongoid-rspec (1.10.0)
|
96
|
+
mongoid (>= 3.0.1)
|
82
97
|
rake
|
83
|
-
rspec (
|
84
|
-
moped (
|
85
|
-
|
86
|
-
|
98
|
+
rspec (>= 2.14)
|
99
|
+
moped (2.0.7)
|
100
|
+
bson (~> 3.0)
|
101
|
+
connection_pool (~> 2.0)
|
102
|
+
optionable (~> 0.2.0)
|
103
|
+
nio4r (1.2.1)
|
104
|
+
nokogiri (1.7.0.1)
|
87
105
|
mini_portile2 (~> 2.1.0)
|
88
106
|
nokogumbo (1.4.10)
|
89
107
|
nokogiri
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
108
|
+
optionable (0.2.0)
|
109
|
+
origin (2.3.0)
|
110
|
+
paperclip (5.1.0)
|
111
|
+
activemodel (>= 4.2.0)
|
112
|
+
activesupport (>= 4.2.0)
|
94
113
|
cocaine (~> 0.5.5)
|
95
114
|
mime-types
|
96
|
-
mimemagic (
|
97
|
-
polyglot (0.3.5)
|
115
|
+
mimemagic (~> 0.3.0)
|
98
116
|
pry (0.10.4)
|
99
117
|
coderay (~> 1.1.0)
|
100
118
|
method_source (~> 0.8.1)
|
101
119
|
slop (~> 3.4)
|
102
|
-
public_suffix (2.0.
|
103
|
-
rack (
|
104
|
-
rack-cache (1.6.1)
|
105
|
-
rack (>= 0.4)
|
106
|
-
rack-ssl (1.3.4)
|
107
|
-
rack
|
120
|
+
public_suffix (2.0.5)
|
121
|
+
rack (2.0.1)
|
108
122
|
rack-test (0.6.3)
|
109
123
|
rack (>= 1.0)
|
110
|
-
rails (
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
124
|
+
rails (5.0.1)
|
125
|
+
actioncable (= 5.0.1)
|
126
|
+
actionmailer (= 5.0.1)
|
127
|
+
actionpack (= 5.0.1)
|
128
|
+
actionview (= 5.0.1)
|
129
|
+
activejob (= 5.0.1)
|
130
|
+
activemodel (= 5.0.1)
|
131
|
+
activerecord (= 5.0.1)
|
132
|
+
activesupport (= 5.0.1)
|
133
|
+
bundler (>= 1.3.0, < 2.0)
|
134
|
+
railties (= 5.0.1)
|
135
|
+
sprockets-rails (>= 2.0.0)
|
136
|
+
rails-dom-testing (2.0.2)
|
137
|
+
activesupport (>= 4.2.0, < 6.0)
|
138
|
+
nokogiri (~> 1.6)
|
139
|
+
rails-html-sanitizer (1.0.3)
|
140
|
+
loofah (~> 2.0)
|
141
|
+
railties (5.0.1)
|
142
|
+
actionpack (= 5.0.1)
|
143
|
+
activesupport (= 5.0.1)
|
144
|
+
method_source
|
122
145
|
rake (>= 0.8.7)
|
123
|
-
|
124
|
-
thor (>= 0.14.6, < 2.0)
|
146
|
+
thor (>= 0.18.1, < 2.0)
|
125
147
|
rake (12.0.0)
|
126
|
-
rdoc (3.12.2)
|
127
|
-
json (~> 1.4)
|
128
148
|
rspec (3.5.0)
|
129
149
|
rspec-core (~> 3.5.0)
|
130
150
|
rspec-expectations (~> 3.5.0)
|
@@ -150,19 +170,22 @@ GEM
|
|
150
170
|
simplecov-html (~> 0.10.0)
|
151
171
|
simplecov-html (0.10.0)
|
152
172
|
slop (3.6.0)
|
153
|
-
sprockets (
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
173
|
+
sprockets (3.7.1)
|
174
|
+
concurrent-ruby (~> 1.0)
|
175
|
+
rack (> 1, < 3)
|
176
|
+
sprockets-rails (3.2.0)
|
177
|
+
actionpack (>= 4.0)
|
178
|
+
activesupport (>= 4.0)
|
179
|
+
sprockets (>= 3.0.0)
|
158
180
|
thor (0.19.4)
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
polyglot (>= 0.3.1)
|
163
|
-
tzinfo (0.3.52)
|
181
|
+
thread_safe (0.3.5)
|
182
|
+
tzinfo (1.2.2)
|
183
|
+
thread_safe (~> 0.1)
|
164
184
|
validates_email_format_of (1.6.3)
|
165
185
|
i18n
|
186
|
+
websocket-driver (0.6.4)
|
187
|
+
websocket-extensions (>= 0.1.0)
|
188
|
+
websocket-extensions (0.1.2)
|
166
189
|
|
167
190
|
PLATFORMS
|
168
191
|
ruby
|
@@ -176,7 +199,7 @@ DEPENDENCIES
|
|
176
199
|
geocoder
|
177
200
|
glebtv-carrierwave-mongoid
|
178
201
|
glebtv-mongoid-paperclip
|
179
|
-
mongoid (>= 3.0, <
|
202
|
+
mongoid (>= 3.0, < 7.0)
|
180
203
|
mongoid-rspec
|
181
204
|
pry
|
182
205
|
rails
|
@@ -4,14 +4,15 @@ module RailsAdminSettings
|
|
4
4
|
require File.expand_path('../tasks', __FILE__)
|
5
5
|
end
|
6
6
|
|
7
|
-
initializer 'RailsAdminSettings Install
|
7
|
+
initializer 'RailsAdminSettings Install after_action' do |app|
|
8
8
|
require File.dirname(__FILE__) + '/../../app/models/rails_admin_settings/setting.rb'
|
9
9
|
|
10
10
|
if defined?(ActionController) and defined?(ActionController::Base)
|
11
11
|
ActionController::Base.class_eval do
|
12
|
-
|
12
|
+
after_action { Settings.unload! }
|
13
13
|
end
|
14
14
|
end
|
15
|
+
|
15
16
|
end
|
16
17
|
end
|
17
18
|
end
|
@@ -87,18 +87,17 @@ module RailsAdminSettings
|
|
87
87
|
end
|
88
88
|
|
89
89
|
options[:cache_keys] ||= options.delete :cache_key
|
90
|
+
_cache_keys = options.delete :cache_keys
|
90
91
|
|
91
|
-
if
|
92
|
+
if _cache_keys.nil?
|
92
93
|
if _cache
|
93
94
|
options[:cache_keys_str] = name.underscore
|
94
95
|
end
|
95
96
|
else
|
96
|
-
if
|
97
|
-
options[:cache_keys_str] =
|
98
|
-
elsif options[:cache_keys].class.name == 'Array'
|
99
|
-
options[:cache_keys_str] = options.delete(:cache_keys).map { |k| k.to_s }.join(" ")
|
97
|
+
if _cache_keys.is_a?(Array)
|
98
|
+
options[:cache_keys_str] = _cache_keys.map { |k| k.to_s }.join(" ")
|
100
99
|
else
|
101
|
-
options[:cache_keys_str] =
|
100
|
+
options[:cache_keys_str] = _cache_keys.to_s
|
102
101
|
end
|
103
102
|
end
|
104
103
|
|
@@ -99,7 +99,9 @@ module RailsAdminSettings
|
|
99
99
|
|
100
100
|
def process_text
|
101
101
|
text = raw.dup
|
102
|
-
text.gsub!
|
102
|
+
text.gsub!'{{year}}' do
|
103
|
+
Time.now.strftime('%Y')
|
104
|
+
end
|
103
105
|
text.gsub! /\{\{year\|([\d]{4})\}\}/ do
|
104
106
|
if Time.now.strftime('%Y') == $1
|
105
107
|
$1
|
@@ -13,10 +13,22 @@ module RailsAdminSettings
|
|
13
13
|
else
|
14
14
|
field :enabled
|
15
15
|
end
|
16
|
-
field :kind
|
17
|
-
|
16
|
+
field :kind do
|
17
|
+
searchable true
|
18
|
+
end
|
19
|
+
field :ns do
|
20
|
+
searchable true
|
21
|
+
end
|
18
22
|
field :name
|
23
|
+
field :label do
|
24
|
+
visible false
|
25
|
+
searchable true
|
26
|
+
end
|
27
|
+
field :key do
|
28
|
+
searchable true
|
29
|
+
end
|
19
30
|
field :raw do
|
31
|
+
searchable true
|
20
32
|
pretty_value do
|
21
33
|
if bindings[:object].file_kind?
|
22
34
|
"<a href='#{CGI::escapeHTML(bindings[:object].file.url)}'>#{CGI::escapeHTML(bindings[:object].to_path)}</a>".html_safe.freeze
|
@@ -27,6 +39,9 @@ module RailsAdminSettings
|
|
27
39
|
end
|
28
40
|
end
|
29
41
|
end
|
42
|
+
field :cache_keys_str, :text do
|
43
|
+
searchable true
|
44
|
+
end
|
30
45
|
if ::Settings.table_exists?
|
31
46
|
nss = ::RailsAdminSettings::Setting.pluck(:ns).uniq.map { |c| "ns_#{c.gsub('-', '_')}".to_sym }
|
32
47
|
scopes([nil] + nss)
|
@@ -35,6 +50,14 @@ module RailsAdminSettings
|
|
35
50
|
|
36
51
|
edit do
|
37
52
|
field :enabled
|
53
|
+
field :ns do
|
54
|
+
read_only true
|
55
|
+
help false
|
56
|
+
end
|
57
|
+
field :key do
|
58
|
+
read_only true
|
59
|
+
help false
|
60
|
+
end
|
38
61
|
field :label do
|
39
62
|
read_only true
|
40
63
|
help false
|
@@ -56,12 +79,14 @@ module RailsAdminSettings
|
|
56
79
|
end
|
57
80
|
end
|
58
81
|
end
|
82
|
+
|
59
83
|
field :cache_keys_str, :text do
|
60
84
|
visible do
|
61
85
|
render_object = (bindings[:controller] || bindings[:view])
|
62
86
|
render_object and render_object.current_user.admin?
|
63
87
|
end
|
64
88
|
end
|
89
|
+
|
65
90
|
end
|
66
91
|
end
|
67
92
|
else
|
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
21
|
|
22
|
-
spec.add_development_dependency "mongoid", [">= 3.0", "<
|
22
|
+
spec.add_development_dependency "mongoid", [">= 3.0", "< 7.0"]
|
23
23
|
spec.add_development_dependency "rails"
|
24
24
|
spec.add_development_dependency "bundler"
|
25
25
|
spec.add_development_dependency "rake"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ack_rails_admin_settings
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.1.
|
4
|
+
version: 1.2.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Kiseliev
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2017-01-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mongoid
|
@@ -20,7 +20,7 @@ dependencies:
|
|
20
20
|
version: '3.0'
|
21
21
|
- - "<"
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: '
|
23
|
+
version: '7.0'
|
24
24
|
type: :development
|
25
25
|
prerelease: false
|
26
26
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -30,7 +30,7 @@ dependencies:
|
|
30
30
|
version: '3.0'
|
31
31
|
- - "<"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '7.0'
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: rails
|
36
36
|
requirement: !ruby/object:Gem::Requirement
|