rails-settings-cached 2.8.1 → 2.8.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/rails-settings/base.rb +7 -3
- data/lib/rails-settings/version.rb +1 -1
- metadata +35 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 619f840c2f93682aec9caef59cb4a59404ce145fbb3b55e77dc259b0fc5b3abd
|
4
|
+
data.tar.gz: c2b49addab5c52403dbb0c3f883276b4c06a870ae4466140b876444dcbaf371f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dcefa7f181b49c310ce6aff7bccb85e004c9048488f3a40cd24d0ed29b31d55d76cbfe6678f1c5eaf9ead4c4d84d1565ef1f0a00e04d02ed2fa58c6bfaf4c6dc
|
7
|
+
data.tar.gz: 585da097235e2bccd5731500a4bb862a8bdfbc9996f9aa11938b9f6d7f0c5a75f2f88b68388a87bc3898496c1562a6fbf3652ac4b0b6b6610b03a1b1b1221fad
|
data/README.md
CHANGED
@@ -142,7 +142,7 @@ Setting.keys
|
|
142
142
|
=> ["app_name", "host", "default_locale", "readonly_item"]
|
143
143
|
|
144
144
|
# Get editable keys
|
145
|
-
|
145
|
+
Setting.editable_keys
|
146
146
|
=> ["app_name", "default_locale"]
|
147
147
|
|
148
148
|
# Get readonly keys
|
@@ -454,7 +454,7 @@ end
|
|
454
454
|
- [getzealot/zealot](https://github.com/getzealot/zealot) - 2.x
|
455
455
|
- [kaishuu0123/rebacklogs](https://github.com/kaishuu0123/rebacklogs) - 2.x
|
456
456
|
- [texterify/texterify](https://github.com/texterify/texterify) - 2.x
|
457
|
-
- [
|
457
|
+
- [mastodon/mastodon](https://github.com/mastodon/mastodon) - 0.6.x
|
458
458
|
- [helpyio/helpy](https://github.com/helpyio/helpy) - 0.5.x
|
459
459
|
- [daqing/rabel](https://github.com/daqing/rabel) - 0.4.x
|
460
460
|
|
data/lib/rails-settings/base.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module RailsSettings
|
4
|
-
class
|
4
|
+
class ProtectedKeyError < RuntimeError
|
5
5
|
def initialize(key)
|
6
6
|
super("Can't use #{key} as setting key.")
|
7
7
|
end
|
@@ -15,7 +15,11 @@ module RailsSettings
|
|
15
15
|
# get the value field, YAML decoded
|
16
16
|
def value
|
17
17
|
# rubocop:disable Security/YAMLLoad
|
18
|
-
|
18
|
+
payload = self[:value]
|
19
|
+
|
20
|
+
if payload.present?
|
21
|
+
YAML.respond_to?(:unsafe_load) ? YAML.unsafe_load(payload) : YAML.load(payload)
|
22
|
+
end
|
19
23
|
end
|
20
24
|
|
21
25
|
# set the value field, YAML encoded
|
@@ -83,7 +87,7 @@ module RailsSettings
|
|
83
87
|
def _define_field(key, default: nil, type: :string, readonly: false, separator: nil, validates: nil, **opts)
|
84
88
|
key = key.to_s
|
85
89
|
|
86
|
-
raise
|
90
|
+
raise ProtectedKeyError.new(key) if PROTECTED_KEYS.include?(key)
|
87
91
|
|
88
92
|
@defined_fields ||= []
|
89
93
|
@defined_fields << {
|
metadata
CHANGED
@@ -1,17 +1,31 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-settings-cached
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.8.
|
4
|
+
version: 2.8.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Lee
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: railties
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 5.0.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 5.0.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: activerecord
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
16
30
|
requirements:
|
17
31
|
- - ">="
|
@@ -38,6 +52,20 @@ dependencies:
|
|
38
52
|
- - ">="
|
39
53
|
- !ruby/object:Gem::Version
|
40
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
41
69
|
- !ruby/object:Gem::Dependency
|
42
70
|
name: minitest
|
43
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -107,7 +135,7 @@ homepage: https://github.com/huacnlee/rails-settings-cached
|
|
107
135
|
licenses:
|
108
136
|
- MIT
|
109
137
|
metadata: {}
|
110
|
-
post_install_message:
|
138
|
+
post_install_message:
|
111
139
|
rdoc_options: []
|
112
140
|
require_paths:
|
113
141
|
- lib
|
@@ -122,8 +150,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
122
150
|
- !ruby/object:Gem::Version
|
123
151
|
version: '0'
|
124
152
|
requirements: []
|
125
|
-
rubygems_version: 3.
|
126
|
-
signing_key:
|
153
|
+
rubygems_version: 3.3.25
|
154
|
+
signing_key:
|
127
155
|
specification_version: 4
|
128
156
|
summary: The best solution for store global settings in Rails applications.
|
129
157
|
test_files: []
|