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 +4 -4
- data/README.md +9 -5
- data/lib/orthoses/config/version.rb +1 -1
- data/lib/orthoses/config.rb +5 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e93ce58f24957fd16083f97d8ef4df332bd53cb2eae51f82e8a2a94d0f5d743b
|
4
|
+
data.tar.gz: c621d56c3ca2733694f37cb69e4433b2a5dd640ddf213f239f3d5de16a370713
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
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
|
-
|
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.
|
data/lib/orthoses/config.rb
CHANGED
@@ -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.
|
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-
|
10
|
+
date: 2025-03-17 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: config
|