settings_cabinet 0.1.0 → 1.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5b97d0554a3bc144e342ad263c1335930404658a1fdfb16401911cc98a23e130
4
- data.tar.gz: 2346f43f8fb95d48dbbbef5a14a177ad30e76bbeeab1c4065ca8cee901397808
3
+ metadata.gz: 8862afdbcb344d8b1f566af9a980cbdfc8ce8cb02721d5a3d73cd3311978926b
4
+ data.tar.gz: 12c623325ebe6aa2ce621b16e95e2ad85b70e4efe099d846d7348d898ffdfae5
5
5
  SHA512:
6
- metadata.gz: '0495ec42369fede25effeb3f16ba9d62245610a0fe4d3407658595b4366cb028b1d58b3491c583e0570d937ab417bb99beab5dd02ce512c14132d569276cb737'
7
- data.tar.gz: b83916434005e0a2b6d3bfbe875ee9200d66bcec25a6b608bcfd67bb164508341008f7562e181b896722a0d9003218a79f7314dd26c951160d3bf90257f9285d
6
+ metadata.gz: 64dc4aa8c68349e60ad3d7a92e74ed88d059638bed87bcca3d6de0c81b41f816af02b2be8f920071937d96b63a50c387c542093baa6f3155762d3a1e90988be8
7
+ data.tar.gz: f400f5f358f66b3ac19dd1dec4baeda4a7aca4d31d046dad0e9d3ed01e8b4903a3dce5f353cde369a7aa534fbda263e8938f4154e835df874d79e44dbc144395
data/.rubocop.yml CHANGED
@@ -4,7 +4,7 @@ require:
4
4
  - rubocop-rspec
5
5
 
6
6
  AllCops:
7
- TargetRubyVersion: 2.7
7
+ TargetRubyVersion: 3.0
8
8
  NewCops: enable
9
9
 
10
10
  Style/Documentation:
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.27", require: false
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.[](...) # rubocop:todo Layout/SpaceBeforeBrackets false positive: https://github.com/rubocop/rubocop/issues/10573
96
+ @settings.[](...)
97
97
  end
98
98
 
99
99
  def dig(...)
100
- @settings.dig(...) # rubocop:todo Style/SingleArgumentDig false positive: https://github.com/rubocop/rubocop/issues/10574
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(...) # rubocop:todo Style/SingleArgumentDig false positive: https://github.com/rubocop/rubocop/issues/10574
124
+ instance.dig(...)
125
125
  end
126
126
 
127
127
  def self.fetch(...)
@@ -39,8 +39,8 @@ module SettingsCabinet
39
39
  @values.dig(*keys)
40
40
  end
41
41
 
42
- def fetch(key, *args, &block)
43
- @values.fetch(key.to_sym, *args, &block)
42
+ def fetch(key, ...)
43
+ @values.fetch(key.to_sym, ...)
44
44
  end
45
45
 
46
46
  def fetch_values(*keys, &block)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SettingsCabinet
4
- VERSION = "0.1.0"
4
+ VERSION = "1.0.0"
5
5
  end
@@ -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 = ">= 2.7.0"
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: 0.1.0
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: 2022-04-23 00:00:00.000000000 Z
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: 2.7.0
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.7
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