orthoses-config 0.1.0 → 0.2.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: fb93aba361609ea92746322769755031b856964fa250a60c3cf7abee82eebe98
4
- data.tar.gz: 5ccbef770c16cc37987af7a43b0220886f52fe35200b067b6a5185790d6be9ce
3
+ metadata.gz: e93ce58f24957fd16083f97d8ef4df332bd53cb2eae51f82e8a2a94d0f5d743b
4
+ data.tar.gz: c621d56c3ca2733694f37cb69e4433b2a5dd640ddf213f239f3d5de16a370713
5
5
  SHA512:
6
- metadata.gz: 1e452fc29a4660d7e7f626f03b3bd2a84ede5f909ba18d40ce6c60192e488621a3bf829ecc60b535bb816d0ffd92ab7455f13acecdd191c32819f8e76de3fdf5
7
- data.tar.gz: 135fa9146ecd7b149fabf4ee1e8d04f681aa99cfd3d7a9d243fc4125ad1746f092f03d6612a76c07b1e7765fc5ddfc0d60b5f1718e164fc7dd67606e25e22b5f
6
+ metadata.gz: 670ab7dbc3a27b300fca6e60f6ebec34215606cd707bc422e662c20bb33199c5e2b3237057a8c67721397f7d4700a445b5fefd9e46e7c124e700b986af41886e
7
+ data.tar.gz: 0d2dbd7bf79d85d8f2f0e159dc46ee6a9834c7f1f070d28494334a5d9891cd3ad9dfe42f18f991ff572c89e65d8f4f31e619e12eb65ccb104e6476d6a98e10f3
data/README.md CHANGED
@@ -31,18 +31,16 @@ Settings.foo.bar #=> String
31
31
 
32
32
  ## Installation
33
33
 
34
- TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
35
-
36
34
  Install the gem and add to the application's Gemfile by executing:
37
35
 
38
36
  ```bash
39
- bundle add UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
37
+ bundle add orthoses-config
40
38
  ```
41
39
 
42
40
  If bundler is not being used to manage dependencies, install the gem by executing:
43
41
 
44
42
  ```bash
45
- gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
43
+ gem install orthoses-config
46
44
  ```
47
45
 
48
46
  ## Usage
@@ -50,9 +48,15 @@ gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
50
48
  It can be used as orthoses middleware.
51
49
 
52
50
  ```rb
53
- use Orthoses::Config
51
+ require 'orthoses/config'
54
52
  ```
55
53
 
54
+ ```rb
55
+ use Orthoses::Config, except_keys: %w[ignore_key]
56
+ ```
57
+
58
+ - `except_keys` is optional. You can specify root keys to be excluded from generation.
59
+
56
60
  ## Development
57
61
 
58
62
  After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Orthoses
4
4
  class Config
5
- VERSION = "0.1.0"
5
+ VERSION = "0.2.0"
6
6
  end
7
7
  end
@@ -5,8 +5,9 @@ require_relative "config/version"
5
5
 
6
6
  module Orthoses
7
7
  class Config
8
- def initialize(loader)
8
+ def initialize(loader, except_keys: [])
9
9
  @loader = loader
10
+ @except_keys = except_keys
10
11
  end
11
12
 
12
13
  def call
@@ -14,6 +15,9 @@ module Orthoses
14
15
  const_name = ::Config.const_name
15
16
  store["Object"] << "#{const_name}: (::Config::Options & ::Config::_Options_Root)"
16
17
  settings = ::Object.const_get(const_name)
18
+ @except_keys.each do |except_key|
19
+ settings.delete_field(except_key) {} # Ignore if key does not exist
20
+ end
17
21
  create_interface(store, settings, "Root")
18
22
  end
19
23
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: orthoses-config
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ksss
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-03-15 00:00:00.000000000 Z
10
+ date: 2025-03-17 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: config