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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0405e5cfca63f64b56ba7e95817c52803184afc191c837ef312df41e368dd9e4
4
- data.tar.gz: 54a968cf325c616142394892943ffdd6a9893234acc98c381122f878696e1547
3
+ metadata.gz: 619f840c2f93682aec9caef59cb4a59404ce145fbb3b55e77dc259b0fc5b3abd
4
+ data.tar.gz: c2b49addab5c52403dbb0c3f883276b4c06a870ae4466140b876444dcbaf371f
5
5
  SHA512:
6
- metadata.gz: 171e47f07b71053d5b1218118992b3e5723f3118abe5a2b31a7b799f05354fac3e4ec28734ddf33790dead573948f2b59ff811cc0edec18ee688dedbd3d724f0
7
- data.tar.gz: 5f8aa09f8980dfb7b100aaa1ac2c5fdb65185511c7fb21e96343e29b4d63280fc5e2ef1ce5a930e69dcd543ce5bd0c4bb0fb15185db72ca3c7276b09ee27bf1e
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
- Settng.editable_keys
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
- - [tootsuite/mastodon](https://github.com/tootsuite/mastodon) - 0.6.x
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
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsSettings
4
- class ProcetedKeyError < RuntimeError
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
- YAML.load(self[:value]) if self[:value].present?
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 ProcetedKeyError.new(key) if PROTECTED_KEYS.include?(key)
90
+ raise ProtectedKeyError.new(key) if PROTECTED_KEYS.include?(key)
87
91
 
88
92
  @defined_fields ||= []
89
93
  @defined_fields << {
@@ -3,7 +3,7 @@
3
3
  module RailsSettings
4
4
  class << self
5
5
  def version
6
- "2.8.1"
6
+ "2.8.3"
7
7
  end
8
8
  end
9
9
  end
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.1
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: 2021-09-24 00:00:00.000000000 Z
11
+ date: 2022-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rails
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.1.4
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: []