settings_cabinet 0.1.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/CHANGELOG.md +18 -0
- data/Gemfile +1 -1
- data/README.md +7 -3
- data/lib/settings_cabinet/base.rb +3 -3
- data/lib/settings_cabinet/settings.rb +2 -2
- data/lib/settings_cabinet/version.rb +1 -1
- data/settings_cabinet.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8862afdbcb344d8b1f566af9a980cbdfc8ce8cb02721d5a3d73cd3311978926b
|
4
|
+
data.tar.gz: 12c623325ebe6aa2ce621b16e95e2ad85b70e4efe099d846d7348d898ffdfae5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64dc4aa8c68349e60ad3d7a92e74ed88d059638bed87bcca3d6de0c81b41f816af02b2be8f920071937d96b63a50c387c542093baa6f3155762d3a1e90988be8
|
7
|
+
data.tar.gz: f400f5f358f66b3ac19dd1dec4baeda4a7aca4d31d046dad0e9d3ed01e8b4903a3dce5f353cde369a7aa534fbda263e8938f4154e835df874d79e44dbc144395
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,23 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
|
4
|
+
## [1.0.0] - 2024-07-23
|
5
|
+
|
6
|
+
### Changes
|
7
|
+
|
8
|
+
* Add Ruby 3.2 support
|
9
|
+
+ [PR#3](https://github.com/yujideveloper/settings_cabinet/pull/3)
|
10
|
+
* Add Ruby 3.3 support and drop Ruby 2.7 support
|
11
|
+
+ [PR#4](https://github.com/yujideveloper/settings_cabinet/pull/4)
|
12
|
+
|
13
|
+
### Misc
|
14
|
+
|
15
|
+
* Update required rubocop version
|
16
|
+
+ [PR#1](https://github.com/yujideveloper/settings_cabinet/pull/1)
|
17
|
+
* Fix examples in README.md
|
18
|
+
* + [PR#2](https://github.com/yujideveloper/settings_cabinet/pull/2)
|
19
|
+
|
20
|
+
|
3
21
|
## [0.1.0] - 2022-04-23
|
4
22
|
|
5
23
|
* Initial release
|
data/Gemfile
CHANGED
@@ -8,7 +8,7 @@ gemspec
|
|
8
8
|
gem "rake", "~> 13.0"
|
9
9
|
|
10
10
|
gem "rspec", "~> 3.11", require: false
|
11
|
-
gem "rubocop", "~> 1.
|
11
|
+
gem "rubocop", "~> 1.28", ">= 1.28.2", require: false
|
12
12
|
gem "rubocop-performance", "~> 1.13", require: false
|
13
13
|
gem "rubocop-rake", "~> 0.6", require: false
|
14
14
|
gem "rubocop-rspec", "~> 2.9", require: false
|
data/README.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# SettingsCabinet
|
2
2
|
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/settings_cabinet.svg)](https://badge.fury.io/rb/settings_cabinet)
|
4
|
+
[![Build](https://github.com/yujideveloper/settings_cabinet/actions/workflows/main.yml/badge.svg)](https://github.com/yujideveloper/settings_cabinet/actions/workflows/main.yml)
|
5
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/9b3e8a9816ade4c40398/maintainability)](https://codeclimate.com/github/yujideveloper/settings_cabinet/maintainability)
|
6
|
+
|
3
7
|
SettingsCabinet is a simple settings solution with ERB-enabled YAML file like [settingslogic](https://github.com/settingslogic/settingslogic).
|
4
8
|
|
5
9
|
## Installation
|
@@ -23,7 +27,7 @@ Or install it yourself as:
|
|
23
27
|
DSL is very similar to settingslogic.
|
24
28
|
|
25
29
|
```ruby
|
26
|
-
class Settings < SettingsCabinet
|
30
|
+
class Settings < SettingsCabinet::Base
|
27
31
|
using SettingsCabinet::DSL
|
28
32
|
|
29
33
|
source Rails.root.join("config", "settings.yml")
|
@@ -32,7 +36,7 @@ end
|
|
32
36
|
```
|
33
37
|
|
34
38
|
| Name | Type | Description | Default | Optional |
|
35
|
-
|
39
|
+
|--|--|--|--|--|
|
36
40
|
| `source` | String | Path of settings file. | - | No |
|
37
41
|
| `namespace` | String | Using a namespace allows you to change your configuration depending on your environment. e.g. `Rails.env` | `nil` | Yes |
|
38
42
|
| `permitted_classes` | Array of Class | Arbitrary classes can be allowed by adding those classes to the allowlist. e.g. `[Date, Time]` | `[]` | Yes |
|
@@ -71,7 +75,7 @@ Settings.load!
|
|
71
75
|
```
|
72
76
|
or
|
73
77
|
```ruby
|
74
|
-
class Settings < SettingsCabinet
|
78
|
+
class Settings < SettingsCabinet::Base
|
75
79
|
using SettingsCabinet::DSL
|
76
80
|
using SettingsCabinet::Control
|
77
81
|
|
@@ -93,11 +93,11 @@ module SettingsCabinet
|
|
93
93
|
end
|
94
94
|
|
95
95
|
def [](...)
|
96
|
-
@settings.[](...)
|
96
|
+
@settings.[](...)
|
97
97
|
end
|
98
98
|
|
99
99
|
def dig(...)
|
100
|
-
@settings.dig(...)
|
100
|
+
@settings.dig(...)
|
101
101
|
end
|
102
102
|
|
103
103
|
def fetch(...)
|
@@ -121,7 +121,7 @@ module SettingsCabinet
|
|
121
121
|
end
|
122
122
|
|
123
123
|
def self.dig(...)
|
124
|
-
instance.dig(...)
|
124
|
+
instance.dig(...)
|
125
125
|
end
|
126
126
|
|
127
127
|
def self.fetch(...)
|
data/settings_cabinet.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.description = "A simple settings solution with ERB-enabled YAML file"
|
13
13
|
spec.homepage = "https://github.com/yujideveloper/settings_cabinet"
|
14
14
|
spec.license = "MIT"
|
15
|
-
spec.required_ruby_version = ">=
|
15
|
+
spec.required_ruby_version = ">= 3.0"
|
16
16
|
|
17
17
|
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
18
18
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: settings_cabinet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuji Hanamura
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A simple settings solution with ERB-enabled YAML file
|
14
14
|
email:
|
@@ -51,14 +51,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
51
51
|
requirements:
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: '3.0'
|
55
55
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
56
56
|
requirements:
|
57
57
|
- - ">="
|
58
58
|
- !ruby/object:Gem::Version
|
59
59
|
version: '0'
|
60
60
|
requirements: []
|
61
|
-
rubygems_version: 3.3.
|
61
|
+
rubygems_version: 3.3.26
|
62
62
|
signing_key:
|
63
63
|
specification_version: 4
|
64
64
|
summary: A simple settings solution with ERB-enabled YAML file
|