settings_cabinet 1.0.0 → 1.1.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: 8862afdbcb344d8b1f566af9a980cbdfc8ce8cb02721d5a3d73cd3311978926b
4
- data.tar.gz: 12c623325ebe6aa2ce621b16e95e2ad85b70e4efe099d846d7348d898ffdfae5
3
+ metadata.gz: 509c530243a696ede84eca06403d746457b419adb824cb07af100f6c05da5969
4
+ data.tar.gz: dc77cc37b894aec7b4a5787ab1039e593d0ff6ce8edd4be63a242dab01d8fd53
5
5
  SHA512:
6
- metadata.gz: 64dc4aa8c68349e60ad3d7a92e74ed88d059638bed87bcca3d6de0c81b41f816af02b2be8f920071937d96b63a50c387c542093baa6f3155762d3a1e90988be8
7
- data.tar.gz: f400f5f358f66b3ac19dd1dec4baeda4a7aca4d31d046dad0e9d3ed01e8b4903a3dce5f353cde369a7aa534fbda263e8938f4154e835df874d79e44dbc144395
6
+ metadata.gz: 9f84f5b0561a9a6745d7643f18a7520646e131fcf908b20a0ed6dcb74d82f863ec4f8c9eb3e916c4e82c5da32ce0d8fdf02fe8ad886422fc13319f4fe61e2381
7
+ data.tar.gz: b92d4ef2c22701f6eacae5555f5da09ee9e95a772f38c2350913ea7383ff0b9ed01c9b5b128e2d01e4fa38b5b27d35dcff8cd06e818deeb51bd9399a718ffe7c
data/.rubocop.yml CHANGED
@@ -1,4 +1,4 @@
1
- require:
1
+ plugins:
2
2
  - rubocop-performance
3
3
  - rubocop-rake
4
4
  - rubocop-rspec
@@ -7,6 +7,19 @@ AllCops:
7
7
  TargetRubyVersion: 3.0
8
8
  NewCops: enable
9
9
 
10
+ Layout/LineLength:
11
+ Max: 120
12
+
13
+ Layout/MultilineMethodCallIndentation:
14
+ EnforcedStyle: indented
15
+
16
+ Metrics/BlockLength:
17
+ Exclude:
18
+ - spec/**/*
19
+
20
+ Naming/PredicateMethod:
21
+ AllowBangMethods: true
22
+
10
23
  Style/Documentation:
11
24
  Enabled: false
12
25
 
@@ -18,12 +31,9 @@ Style/StringLiteralsInInterpolation:
18
31
  Enabled: true
19
32
  EnforcedStyle: double_quotes
20
33
 
21
- Layout/LineLength:
22
- Max: 120
23
-
24
- Layout/MultilineMethodCallIndentation:
25
- EnforcedStyle: indented
26
-
27
- Metrics/BlockLength:
28
- Exclude:
29
- - spec/**/*
34
+ RSpec/ExampleLength:
35
+ CountAsOne:
36
+ - array
37
+ - hash
38
+ - heredoc
39
+ - method_call
data/CHANGELOG.md CHANGED
@@ -1,6 +1,25 @@
1
1
  ## [Unreleased]
2
2
 
3
3
 
4
+ ## [1.1.0] - 2025-08-26
5
+
6
+ ## Changes
7
+
8
+ * Add keys method support for Hash structures
9
+ + [PR#5](https://github.com/yujideveloper/settings_cabinet/pull/5)
10
+ * Support top-level Settings.keys for consistent key access
11
+ + [PR#9](https://github.com/yujideveloper/settings_cabinet/pull/9)
12
+
13
+ ### Misc
14
+
15
+ * CI against for Ruby 3.4
16
+ + [PR#6](https://github.com/yujideveloper/settings_cabinet/pull/6)
17
+ * Update rubocop config
18
+ + [PR#7](https://github.com/yujideveloper/settings_cabinet/pull/7)
19
+ * Add irb to `Gemfile`
20
+ + [PR#8](https://github.com/yujideveloper/settings_cabinet/pull/8)
21
+
22
+
4
23
  ## [1.0.0] - 2024-07-23
5
24
 
6
25
  ### Changes
data/Gemfile CHANGED
@@ -7,8 +7,10 @@ gemspec
7
7
 
8
8
  gem "rake", "~> 13.0"
9
9
 
10
- gem "rspec", "~> 3.11", require: false
11
- gem "rubocop", "~> 1.28", ">= 1.28.2", require: false
12
- gem "rubocop-performance", "~> 1.13", require: false
13
- gem "rubocop-rake", "~> 0.6", require: false
14
- gem "rubocop-rspec", "~> 2.9", require: false
10
+ gem "irb"
11
+
12
+ gem "rspec", "~> 3.13", require: false
13
+ gem "rubocop", "~> 1.79", require: false
14
+ gem "rubocop-performance", "~> 1.25", require: false
15
+ gem "rubocop-rake", "~> 0.7", require: false
16
+ gem "rubocop-rspec", "~> 3.6", require: false
data/README.md CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/settings_cabinet.svg)](https://badge.fury.io/rb/settings_cabinet)
4
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
5
 
7
6
  SettingsCabinet is a simple settings solution with ERB-enabled YAML file like [settingslogic](https://github.com/settingslogic/settingslogic).
8
7
 
@@ -65,6 +64,10 @@ Accessors are defined in the same way as settingslogic, but writers do not.
65
64
  ```ruby
66
65
  Settings.foo.bar #=> "nested setting"
67
66
  Settings[:baz] #=> 9
67
+
68
+ # Hash Keys Support - Get all available keys from Hash structures
69
+ Settings.foo.keys #=> [:bar]
70
+ Settings.keys #=> [:foo, :baz, :quz]
68
71
  ```
69
72
 
70
73
  You can explicitly load all your settings, if needed.
@@ -116,6 +116,10 @@ module SettingsCabinet
116
116
  @settings.to_h(...)
117
117
  end
118
118
 
119
+ def keys(...)
120
+ @settings.keys(...)
121
+ end
122
+
119
123
  def self.[](...)
120
124
  instance.[](...)
121
125
  end
@@ -140,6 +144,10 @@ module SettingsCabinet
140
144
  instance.to_h(...)
141
145
  end
142
146
 
147
+ def self.keys(...)
148
+ instance.keys(...)
149
+ end
150
+
143
151
  def self.method_missing(...)
144
152
  instance.public_send(...)
145
153
  end
@@ -54,5 +54,9 @@ module SettingsCabinet
54
54
  def to_h
55
55
  @values.transform_values { |v| v.is_a?(self.class) ? v.to_h : v }
56
56
  end
57
+
58
+ def keys
59
+ @values.keys
60
+ end
57
61
  end
58
62
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SettingsCabinet
4
- VERSION = "1.0.0"
4
+ VERSION = "1.1.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: settings_cabinet
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuji Hanamura
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2024-07-23 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies: []
13
12
  description: A simple settings solution with ERB-enabled YAML file
14
13
  email:
@@ -43,7 +42,6 @@ metadata:
43
42
  source_code_uri: https://github.com/yujideveloper/settings_cabinet
44
43
  changelog_uri: https://github.com/yujideveloper/settings_cabinet/tree/main/CHANGELOG.md
45
44
  rubygems_mfa_required: 'true'
46
- post_install_message:
47
45
  rdoc_options: []
48
46
  require_paths:
49
47
  - lib
@@ -58,8 +56,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
58
56
  - !ruby/object:Gem::Version
59
57
  version: '0'
60
58
  requirements: []
61
- rubygems_version: 3.3.26
62
- signing_key:
59
+ rubygems_version: 3.6.9
63
60
  specification_version: 4
64
61
  summary: A simple settings solution with ERB-enabled YAML file
65
62
  test_files: []