config_reader 2.0.4 → 3.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 +4 -4
- data/CHANGELOG.md +24 -16
- data/README.md +4 -14
- data/lib/config_reader/{magic_hash.rb → config_hash.rb} +6 -6
- data/lib/config_reader/version.rb +1 -1
- data/lib/config_reader.rb +65 -46
- data/spec/config_reader_spec.rb +11 -0
- data/spec/sekrets_config.rb +1 -6
- data/spec/sekrets_config.yml.enc +0 -0
- data/spec/spec_helper.rb +1 -1
- data/spec/test_config.yml +3 -0
- metadata +47 -38
- data/.deepsource.toml +0 -4
- data/.github/workflows/ruby.yml +0 -31
- data/.gitignore +0 -3
- data/.nvmrc +0 -1
- data/.prettierrc +0 -6
- data/.rubocop.yml +0 -64
- data/.standard.yml +0 -23
- data/.travis.yml +0 -6
- data/.vscode/settings.json +0 -3
- data/Gemfile +0 -13
- data/Gemfile.lock +0 -136
- data/License.txt +0 -20
- data/Rakefile +0 -3
- data/checksums/config_reader-2.0.2.gem.sha512 +0 -1
- data/config_reader.gemspec +0 -25
- data/package.json +0 -6
- data/spec/sekrets_ruby_3_2.yml +0 -9
- data/spec/sekrets_ruby_3_2.yml.enc +0 -2
- data/yarn.lock +0 -13
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2737e810595affa2baee1814d8d0291e25be7748f40eb215634b52401677c533
|
|
4
|
+
data.tar.gz: c55a5f5a2bce2d866cdc93c8a1fc6b4e004d7fc693d4d26b1cb7c2fb96e11038
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bb4d11127268cd8dd236cb51c2237f9b6f8ee77174491ed406e788072a5ac92376eb91e7d7f4f20596f5378870426727c95eb8f38c31a079d14b6880c93953c4
|
|
7
|
+
data.tar.gz: 14c4bff99f6ed3ca2e75186dc019e7380af414143edcb588e494b2069083125e9371d3b704597368a590c269b1e279cfe3bc7cdd8a9a53f9b5745dc58a1fbef7
|
data/CHANGELOG.md
CHANGED
|
@@ -1,71 +1,79 @@
|
|
|
1
|
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 3.0.0 2024-12-12
|
|
4
|
+
|
|
5
|
+
Update to latest Sekrets (1.14.0)
|
|
6
|
+
Explicitly require abbrev gem
|
|
7
|
+
Expose all environment configs at the Config.envs Hash
|
|
8
|
+
|
|
9
|
+
## 2.0.4 2024-05-17
|
|
2
10
|
|
|
3
11
|
- [update rexml](https://github.com/UnderpantsGnome/config_reader-gem/pull/5)
|
|
4
12
|
|
|
5
|
-
|
|
13
|
+
## 2.0.3 2024-05-10
|
|
6
14
|
|
|
7
15
|
- add dig method to be able to extract nested values programmatically
|
|
8
16
|
|
|
9
|
-
|
|
17
|
+
## 2.0.2 2023-03-11
|
|
10
18
|
|
|
11
19
|
- remove deep-merge dependency
|
|
12
20
|
|
|
13
|
-
|
|
21
|
+
## 2.0.1 2010-03-19
|
|
14
22
|
|
|
15
23
|
- update dependencies
|
|
16
24
|
|
|
17
|
-
|
|
25
|
+
## 1.0.5 2018-02-01
|
|
18
26
|
|
|
19
27
|
- pass ignore_missing_keys to nested hashes during conversion
|
|
20
28
|
|
|
21
|
-
|
|
29
|
+
## 1.0.4 2018-02-01
|
|
22
30
|
|
|
23
31
|
- add a config option for Key Error behavior
|
|
24
32
|
|
|
25
|
-
|
|
33
|
+
## 1.0.3 2017-06-20
|
|
26
34
|
|
|
27
35
|
- add the deep_merge gem so all keys don't need to be duplicated across env sections
|
|
28
36
|
|
|
29
|
-
|
|
37
|
+
## 0.0.9 2012-02-03
|
|
30
38
|
|
|
31
39
|
- Stop abusing Hash, it's not nice
|
|
32
40
|
- convert all keys to symbols internally
|
|
33
41
|
- move to a bundler style gem
|
|
34
42
|
|
|
35
|
-
|
|
43
|
+
## 0.0.8 2011-05-12
|
|
36
44
|
|
|
37
45
|
- Silence RAILS_ENV deprecation, thanks jeanmartin
|
|
38
46
|
|
|
39
|
-
|
|
47
|
+
## 0.0.7 2010-02-14
|
|
40
48
|
|
|
41
49
|
- moved to jeweler
|
|
42
50
|
- removed the annoying post install message
|
|
43
51
|
- updated specs
|
|
44
52
|
|
|
45
|
-
|
|
53
|
+
## 0.0.6 2009-04-02
|
|
46
54
|
|
|
47
55
|
- handle keys as ['foo'], [:foo] and .foo for real this time
|
|
48
56
|
- return nil on non-existent key instead of error
|
|
49
57
|
|
|
50
|
-
|
|
58
|
+
## 0.0.5 2009-01-29
|
|
51
59
|
|
|
52
60
|
- handle keys as ['foo'], [:foo] and .foo
|
|
53
61
|
- return nil on non-existent key instead of error
|
|
54
62
|
|
|
55
|
-
|
|
63
|
+
## 0.0.4 2008-12-08
|
|
56
64
|
|
|
57
65
|
- fix the environment merging issue, for real this time
|
|
58
66
|
|
|
59
|
-
|
|
67
|
+
## 0.0.3 2008-12-02
|
|
60
68
|
|
|
61
69
|
- fix the environment merging issue
|
|
62
70
|
|
|
63
|
-
|
|
71
|
+
## 0.0.2 2008-09-10
|
|
64
72
|
|
|
65
73
|
- have find_config return the file if it exists instead of looking in . and
|
|
66
74
|
./config
|
|
67
75
|
|
|
68
|
-
|
|
76
|
+
## 0.0.1 2008-08-06
|
|
69
77
|
|
|
70
78
|
- 1 major enhancement:
|
|
71
79
|
- Initial release
|
data/README.md
CHANGED
|
@@ -20,16 +20,6 @@ Example config file:
|
|
|
20
20
|
production:
|
|
21
21
|
site_url: http://example.com
|
|
22
22
|
|
|
23
|
-
## Ruby 3.1 and 3.2
|
|
24
|
-
|
|
25
|
-
If you want to use Sekrets with these versions of Ruby you need to use this version until upstream gets updated.
|
|
26
|
-
|
|
27
|
-
```ruby
|
|
28
|
-
gem "sekrets",
|
|
29
|
-
github: "UnderpantsGnome/sekrets",
|
|
30
|
-
branch: "ruby-3-2-support"
|
|
31
|
-
```
|
|
32
|
-
|
|
33
23
|
## Sekrets
|
|
34
24
|
|
|
35
25
|
Includes Sekrets integration. See <https://github.com/ahoward/sekrets> for more
|
|
@@ -42,8 +32,8 @@ The format of the sekrets file is the same as the regular file.
|
|
|
42
32
|
class MyConfig < ConfigReader
|
|
43
33
|
configure do |config|
|
|
44
34
|
config.environment = Rails.env # (set this however you access the env in your app)
|
|
45
|
-
config.config_file =
|
|
46
|
-
config.sekrets_file =
|
|
35
|
+
config.config_file = "config/my_config.yml"
|
|
36
|
+
config.sekrets_file = "config/my_config.yml.enc" # (default nil)
|
|
47
37
|
config.ignore_missing_keys = true # (default false, raises KeyError)
|
|
48
38
|
end
|
|
49
39
|
end
|
|
@@ -52,13 +42,13 @@ The format of the sekrets file is the same as the regular file.
|
|
|
52
42
|
|
|
53
43
|
MyConfig.mail_from #=> noreply@example.com
|
|
54
44
|
MyConfig[:mail_from] #=> noreply@example.com
|
|
55
|
-
MyConfig[
|
|
45
|
+
MyConfig["mail_from"] #=> noreply@example.com
|
|
56
46
|
|
|
57
47
|
## Note on Patches/Pull Requests
|
|
58
48
|
|
|
59
49
|
* Fork the project.
|
|
60
50
|
* Make your feature addition or bug fix.
|
|
61
|
-
* Add tests for it. This is important so I don
|
|
51
|
+
* Add tests for it. This is important so I don"t break it in a future
|
|
62
52
|
version unintentionally.
|
|
63
53
|
* Commit, do not mess with rakefile, version, or history. (if you want to
|
|
64
54
|
have your own version, that is fine but bump version in a commit by itself
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
class ConfigReader
|
|
2
|
-
class
|
|
2
|
+
class ConfigHash < Hash
|
|
3
3
|
attr_accessor :ignore_missing_keys
|
|
4
4
|
|
|
5
5
|
def self.convert_hash(hash, ignore_missing_keys = false)
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
config_hash = new
|
|
7
|
+
config_hash.ignore_missing_keys = ignore_missing_keys
|
|
8
8
|
|
|
9
9
|
hash.each_pair do |key, value|
|
|
10
|
-
|
|
10
|
+
config_hash[key.to_sym] = if value.is_a?(Hash)
|
|
11
11
|
convert_hash(value, ignore_missing_keys)
|
|
12
12
|
else
|
|
13
13
|
value
|
|
14
14
|
end
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
config_hash
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
def [](key)
|
|
@@ -25,7 +25,7 @@ class ConfigReader
|
|
|
25
25
|
|
|
26
26
|
def method_missing(key, *args, &block)
|
|
27
27
|
key?(key) ? fetch(key) : super
|
|
28
|
-
rescue KeyError, NoMethodError => e
|
|
28
|
+
rescue KeyError, NoMethodError => e # skipcq: RB-P1001
|
|
29
29
|
raise e unless ignore_missing_keys
|
|
30
30
|
end
|
|
31
31
|
|
data/lib/config_reader.rb
CHANGED
|
@@ -1,34 +1,49 @@
|
|
|
1
1
|
require "config_reader/version"
|
|
2
|
-
require "config_reader/
|
|
3
|
-
require "
|
|
2
|
+
require "config_reader/config_hash"
|
|
3
|
+
require "psych"
|
|
4
4
|
|
|
5
5
|
begin
|
|
6
6
|
require "erb"
|
|
7
7
|
rescue LoadError
|
|
8
|
-
|
|
8
|
+
warn "ERB not found, you won't be able to use ERB in your config"
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
class ConfigReader
|
|
12
12
|
class << self
|
|
13
|
-
attr_reader :
|
|
13
|
+
attr_reader :envs
|
|
14
|
+
|
|
15
|
+
def [](key)
|
|
16
|
+
config[key.to_sym]
|
|
17
|
+
end
|
|
14
18
|
|
|
15
19
|
def config
|
|
16
20
|
@config = nil unless defined?(@config)
|
|
17
21
|
@config ||= reload
|
|
18
22
|
end
|
|
19
23
|
|
|
20
|
-
def
|
|
21
|
-
|
|
24
|
+
def configuration
|
|
25
|
+
@configuration ||= Configuration.new
|
|
26
|
+
end
|
|
22
27
|
|
|
23
|
-
|
|
28
|
+
def configure
|
|
29
|
+
self.configuration ||= Configuration.new
|
|
30
|
+
yield(configuration)
|
|
24
31
|
end
|
|
25
32
|
|
|
26
|
-
def
|
|
27
|
-
|
|
33
|
+
def deep_merge(hash, other_hash)
|
|
34
|
+
hash.merge!(other_hash) do |_key, this_val, other_val|
|
|
35
|
+
if this_val.is_a?(Hash) && other_val.is_a?(Hash)
|
|
36
|
+
deep_merge(this_val, other_val)
|
|
37
|
+
else
|
|
38
|
+
other_val
|
|
39
|
+
end
|
|
40
|
+
end
|
|
28
41
|
end
|
|
29
42
|
|
|
30
|
-
def
|
|
31
|
-
|
|
43
|
+
def dig(*args)
|
|
44
|
+
args.map!(&:to_sym) if args.respond_to?(:map!)
|
|
45
|
+
|
|
46
|
+
config.dig(*args)
|
|
32
47
|
end
|
|
33
48
|
|
|
34
49
|
def find_config
|
|
@@ -42,18 +57,6 @@ class ConfigReader
|
|
|
42
57
|
nil
|
|
43
58
|
end
|
|
44
59
|
|
|
45
|
-
def method_missing(key, *args, &block)
|
|
46
|
-
if key.to_s.end_with?("=")
|
|
47
|
-
raise ArgumentError.new("ConfigReader is immutable")
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
config[key] || nil
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
def respond_to_missing?(m, *)
|
|
54
|
-
config.key?(m)
|
|
55
|
-
end
|
|
56
|
-
|
|
57
60
|
def inspect
|
|
58
61
|
puts config.inspect
|
|
59
62
|
end
|
|
@@ -63,9 +66,17 @@ class ConfigReader
|
|
|
63
66
|
|
|
64
67
|
conf =
|
|
65
68
|
if defined?(ERB)
|
|
66
|
-
|
|
69
|
+
Psych.safe_load(
|
|
70
|
+
ERB.new(File.read(find_config)).result,
|
|
71
|
+
aliases: true,
|
|
72
|
+
permitted_classes: configuration.permitted_classes.to_a + [Symbol]
|
|
73
|
+
)
|
|
67
74
|
else
|
|
68
|
-
|
|
75
|
+
Psych.safe_load_file(
|
|
76
|
+
File.read(find_config),
|
|
77
|
+
aliases: true,
|
|
78
|
+
permitted_classes: configuration.permitted_classes.to_a + [Symbol]
|
|
79
|
+
)
|
|
69
80
|
end
|
|
70
81
|
|
|
71
82
|
raise "No config found" unless conf
|
|
@@ -90,51 +101,59 @@ class ConfigReader
|
|
|
90
101
|
end
|
|
91
102
|
|
|
92
103
|
def merge_configs(conf, sekrets)
|
|
104
|
+
@envs = {}
|
|
105
|
+
env_keys = conf.keys - ["defaults"]
|
|
93
106
|
env = configuration.environment
|
|
94
107
|
|
|
95
108
|
defaults = conf["defaults"]
|
|
96
109
|
|
|
97
110
|
if sekrets && sekrets["defaults"]
|
|
98
|
-
deep_merge
|
|
111
|
+
defaults = deep_merge(defaults, sekrets["defaults"])
|
|
99
112
|
end
|
|
100
113
|
|
|
101
|
-
|
|
102
|
-
|
|
114
|
+
env_keys.each do |key|
|
|
115
|
+
key_hash = deep_merge(defaults, conf[key]) if conf[key]
|
|
116
|
+
key_hash = deep_merge(defaults, sekrets[key]) if sekrets && sekrets[key]
|
|
117
|
+
|
|
118
|
+
@envs[key] = ConfigHash.convert_hash(
|
|
119
|
+
key_hash,
|
|
120
|
+
configuration.ignore_missing_keys
|
|
121
|
+
)
|
|
122
|
+
end
|
|
103
123
|
|
|
104
|
-
|
|
124
|
+
@envs[env]
|
|
105
125
|
end
|
|
106
126
|
|
|
107
|
-
def
|
|
108
|
-
|
|
109
|
-
|
|
127
|
+
def method_missing(key, *_args, &_block)
|
|
128
|
+
if key.to_s.end_with?("=")
|
|
129
|
+
raise ArgumentError.new("ConfigReader is immutable")
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
config[key] || nil
|
|
110
133
|
end
|
|
111
134
|
|
|
112
|
-
def
|
|
113
|
-
|
|
135
|
+
def reload
|
|
136
|
+
merge_configs(load_config, load_sekrets)
|
|
114
137
|
end
|
|
115
138
|
|
|
116
|
-
def
|
|
117
|
-
|
|
118
|
-
if this_val.is_a?(Hash) && other_val.is_a?(Hash)
|
|
119
|
-
deep_merge!(this_val, other_val)
|
|
120
|
-
else
|
|
121
|
-
other_val
|
|
122
|
-
end
|
|
123
|
-
end
|
|
139
|
+
def respond_to_missing?(m, *)
|
|
140
|
+
config.key?(m)
|
|
124
141
|
end
|
|
125
142
|
end
|
|
126
143
|
|
|
127
144
|
class Configuration
|
|
128
145
|
attr_accessor :config_file,
|
|
129
|
-
:
|
|
146
|
+
:environment,
|
|
130
147
|
:ignore_missing_keys,
|
|
131
|
-
:
|
|
148
|
+
:permitted_classes,
|
|
149
|
+
:sekrets_file
|
|
132
150
|
|
|
133
151
|
def initialize
|
|
134
152
|
@config_file = nil
|
|
135
|
-
@sekrets_file = nil
|
|
136
|
-
@ignore_missing_keys = false
|
|
137
153
|
@environment = nil
|
|
154
|
+
@ignore_missing_keys = false
|
|
155
|
+
@permitted_classes = []
|
|
156
|
+
@sekrets_file = nil
|
|
138
157
|
end
|
|
139
158
|
end
|
|
140
159
|
end
|
data/spec/config_reader_spec.rb
CHANGED
|
@@ -31,6 +31,17 @@ describe "ConfigReader" do
|
|
|
31
31
|
end
|
|
32
32
|
end
|
|
33
33
|
|
|
34
|
+
describe "all envs available" do
|
|
35
|
+
it "should have all envs available" do
|
|
36
|
+
expect(TestConfig.envs.keys).to eq(%w[test not_test])
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
it "should have ConfigHash for all envs" do
|
|
40
|
+
expect(TestConfig.envs["test"].app_name).to eq("test_app")
|
|
41
|
+
expect(TestConfig.envs["not_test"].app_name).to eq("not_test_app")
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
34
45
|
describe "#dig" do
|
|
35
46
|
it "finds values as symbols" do
|
|
36
47
|
expect(TestConfig.dig(*%i[nested_key value])).to eq("test")
|
data/spec/sekrets_config.rb
CHANGED
data/spec/sekrets_config.yml.enc
CHANGED
|
Binary file
|
data/spec/spec_helper.rb
CHANGED
data/spec/test_config.yml
CHANGED
metadata
CHANGED
|
@@ -1,15 +1,49 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: config_reader
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 3.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Michael Moen
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2024-
|
|
11
|
+
date: 2024-12-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: abbrev
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - ">="
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '0'
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - ">="
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '0'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: psych
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '5.2'
|
|
34
|
+
- - ">="
|
|
35
|
+
- !ruby/object:Gem::Version
|
|
36
|
+
version: 5.2.1
|
|
37
|
+
type: :runtime
|
|
38
|
+
prerelease: false
|
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
40
|
+
requirements:
|
|
41
|
+
- - "~>"
|
|
42
|
+
- !ruby/object:Gem::Version
|
|
43
|
+
version: '5.2'
|
|
44
|
+
- - ">="
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: 5.2.1
|
|
13
47
|
- !ruby/object:Gem::Dependency
|
|
14
48
|
name: rake
|
|
15
49
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -44,14 +78,14 @@ dependencies:
|
|
|
44
78
|
requirements:
|
|
45
79
|
- - "~>"
|
|
46
80
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: '1'
|
|
81
|
+
version: '1.14'
|
|
48
82
|
type: :development
|
|
49
83
|
prerelease: false
|
|
50
84
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
85
|
requirements:
|
|
52
86
|
- - "~>"
|
|
53
87
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: '1'
|
|
88
|
+
version: '1.14'
|
|
55
89
|
- !ruby/object:Gem::Dependency
|
|
56
90
|
name: pry
|
|
57
91
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -73,42 +107,26 @@ executables: []
|
|
|
73
107
|
extensions: []
|
|
74
108
|
extra_rdoc_files: []
|
|
75
109
|
files:
|
|
76
|
-
- ".deepsource.toml"
|
|
77
|
-
- ".github/workflows/ruby.yml"
|
|
78
|
-
- ".gitignore"
|
|
79
|
-
- ".nvmrc"
|
|
80
|
-
- ".prettierrc"
|
|
81
|
-
- ".rubocop.yml"
|
|
82
|
-
- ".standard.yml"
|
|
83
|
-
- ".travis.yml"
|
|
84
|
-
- ".vscode/settings.json"
|
|
85
110
|
- CHANGELOG.md
|
|
86
|
-
- Gemfile
|
|
87
|
-
- Gemfile.lock
|
|
88
|
-
- License.txt
|
|
89
111
|
- README.md
|
|
90
|
-
- Rakefile
|
|
91
|
-
- checksums/config_reader-2.0.2.gem.sha512
|
|
92
|
-
- config_reader.gemspec
|
|
93
112
|
- lib/config_reader.rb
|
|
94
|
-
- lib/config_reader/
|
|
113
|
+
- lib/config_reader/config_hash.rb
|
|
95
114
|
- lib/config_reader/version.rb
|
|
96
|
-
- package.json
|
|
97
115
|
- spec/config_reader_spec.rb
|
|
98
116
|
- spec/no_key_no_error_config.rb
|
|
99
117
|
- spec/sekrets_config.rb
|
|
100
118
|
- spec/sekrets_config.yml.enc
|
|
101
|
-
- spec/sekrets_ruby_3_2.yml
|
|
102
|
-
- spec/sekrets_ruby_3_2.yml.enc
|
|
103
119
|
- spec/spec_helper.rb
|
|
104
120
|
- spec/test_config.rb
|
|
105
121
|
- spec/test_config.yml
|
|
106
|
-
- yarn.lock
|
|
107
122
|
homepage: https://github.com/UnderpantsGnome/config_reader-gem
|
|
108
123
|
licenses: []
|
|
109
|
-
metadata:
|
|
110
|
-
|
|
111
|
-
|
|
124
|
+
metadata:
|
|
125
|
+
rubygems_mfa_required: 'true'
|
|
126
|
+
post_install_message: |
|
|
127
|
+
If you are are upgrading from a pre 2.x version,
|
|
128
|
+
please see the configuration changes in the
|
|
129
|
+
README https://github.com/UnderpantsGnome/config_reader-gem/blob/master/README.rdoc
|
|
112
130
|
rdoc_options: []
|
|
113
131
|
require_paths:
|
|
114
132
|
- lib
|
|
@@ -123,17 +141,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
123
141
|
- !ruby/object:Gem::Version
|
|
124
142
|
version: '0'
|
|
125
143
|
requirements: []
|
|
126
|
-
rubygems_version: 3.
|
|
144
|
+
rubygems_version: 3.5.11
|
|
127
145
|
signing_key:
|
|
128
146
|
specification_version: 4
|
|
129
147
|
summary: Provides a way to manage environment specific configuration settings.
|
|
130
|
-
test_files:
|
|
131
|
-
- spec/config_reader_spec.rb
|
|
132
|
-
- spec/no_key_no_error_config.rb
|
|
133
|
-
- spec/sekrets_config.rb
|
|
134
|
-
- spec/sekrets_config.yml.enc
|
|
135
|
-
- spec/sekrets_ruby_3_2.yml
|
|
136
|
-
- spec/sekrets_ruby_3_2.yml.enc
|
|
137
|
-
- spec/spec_helper.rb
|
|
138
|
-
- spec/test_config.rb
|
|
139
|
-
- spec/test_config.yml
|
|
148
|
+
test_files: []
|
data/.deepsource.toml
DELETED
data/.github/workflows/ruby.yml
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
name: Specs
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches: [ "main" ]
|
|
6
|
-
pull_request:
|
|
7
|
-
branches: [ "main" ]
|
|
8
|
-
|
|
9
|
-
permissions:
|
|
10
|
-
contents: read
|
|
11
|
-
|
|
12
|
-
jobs:
|
|
13
|
-
test:
|
|
14
|
-
|
|
15
|
-
runs-on: ubuntu-latest
|
|
16
|
-
strategy:
|
|
17
|
-
matrix:
|
|
18
|
-
ruby-version: ['3.0', '3.1', '3.2']
|
|
19
|
-
|
|
20
|
-
steps:
|
|
21
|
-
- uses: actions/checkout@v3
|
|
22
|
-
- name: Set up Ruby
|
|
23
|
-
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
|
|
24
|
-
# change this to (see https://github.com/ruby/setup-ruby#versioning):
|
|
25
|
-
# uses: ruby/setup-ruby@v1
|
|
26
|
-
uses: ruby/setup-ruby@v1
|
|
27
|
-
with:
|
|
28
|
-
ruby-version: ${{ matrix.ruby-version }}
|
|
29
|
-
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
|
30
|
-
- name: Run tests
|
|
31
|
-
run: bundle exec rspec
|
data/.gitignore
DELETED
data/.nvmrc
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
lts/Hydrogen
|
data/.prettierrc
DELETED
data/.rubocop.yml
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
# https://docs.rubocop.org/en/latest/cops_layout/
|
|
2
|
-
|
|
3
|
-
require: rubocop-rspec
|
|
4
|
-
|
|
5
|
-
AllCops:
|
|
6
|
-
Exclude:
|
|
7
|
-
- "app/controllers/graphql_controller.rb"
|
|
8
|
-
- "app/graphql/vivo_point_schema.rb"
|
|
9
|
-
- "bin/**/*"
|
|
10
|
-
- "config/**/*"
|
|
11
|
-
- "db/**/*"
|
|
12
|
-
- "lib/util.rb"
|
|
13
|
-
- "node_modules/**/*"
|
|
14
|
-
- "script/**/*"
|
|
15
|
-
- "spec/**/*"
|
|
16
|
-
TargetRubyVersion: 2.6
|
|
17
|
-
|
|
18
|
-
Rails/UnknownEnv:
|
|
19
|
-
Environments:
|
|
20
|
-
- development
|
|
21
|
-
- test
|
|
22
|
-
- staging
|
|
23
|
-
- uat
|
|
24
|
-
- production
|
|
25
|
-
|
|
26
|
-
Layout/MultilineMethodCallIndentation:
|
|
27
|
-
EnforcedStyle: indented
|
|
28
|
-
|
|
29
|
-
Metrics/AbcSize:
|
|
30
|
-
Max: 20
|
|
31
|
-
|
|
32
|
-
Metrics/BlockLength:
|
|
33
|
-
ExcludedMethods:
|
|
34
|
-
- "generate_jwt!"
|
|
35
|
-
- "guard"
|
|
36
|
-
- "included"
|
|
37
|
-
- "namespace"
|
|
38
|
-
|
|
39
|
-
Metrics/MethodLength:
|
|
40
|
-
ExcludedMethods:
|
|
41
|
-
- "generate_jwt!"
|
|
42
|
-
- "add_resource_roles_to_user"
|
|
43
|
-
Max: 15
|
|
44
|
-
|
|
45
|
-
Style/StringLiterals:
|
|
46
|
-
EnforcedStyle: double_quotes
|
|
47
|
-
|
|
48
|
-
Style/AndOr:
|
|
49
|
-
Enabled: false
|
|
50
|
-
|
|
51
|
-
Style/Documentation:
|
|
52
|
-
Enabled: false
|
|
53
|
-
|
|
54
|
-
Style/MultilineMemoization:
|
|
55
|
-
EnforcedStyle: braces
|
|
56
|
-
|
|
57
|
-
Style/StringLiteralsInInterpolation:
|
|
58
|
-
EnforcedStyle: double_quotes
|
|
59
|
-
|
|
60
|
-
Style/FrozenStringLiteralComment:
|
|
61
|
-
Enabled: false
|
|
62
|
-
|
|
63
|
-
Style/YodaCondition:
|
|
64
|
-
EnforcedStyle: require_for_equality_operators_only
|
data/.standard.yml
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
default_ignores: false
|
|
2
|
-
fix: true
|
|
3
|
-
format: progress
|
|
4
|
-
parallel: true
|
|
5
|
-
|
|
6
|
-
ignore:
|
|
7
|
-
- "db/schema.rb"
|
|
8
|
-
- "vendor/**/*"
|
|
9
|
-
- "test/**/*":
|
|
10
|
-
- Layout/AlignHash
|
|
11
|
-
- "**/*":
|
|
12
|
-
- Layout/ArgumentAlignment
|
|
13
|
-
- Layout/ArrayAlignment
|
|
14
|
-
- Layout/BlockAlignment
|
|
15
|
-
- Layout/ClosingHeredocIndentation
|
|
16
|
-
- Layout/FirstArgumentIndentation
|
|
17
|
-
- Layout/MultilineMethodCallIndentation
|
|
18
|
-
- Layout/MultilineOperationIndentation
|
|
19
|
-
- Layout/SpaceInsideHashLiteralBraces
|
|
20
|
-
- Lint/AssignmentInCondition
|
|
21
|
-
- Lint/ShadowedException
|
|
22
|
-
- Style/MultilineMemoization
|
|
23
|
-
- Style/RescueStandardError
|
data/.travis.yml
DELETED
data/.vscode/settings.json
DELETED
data/Gemfile
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
source "http://rubygems.org"
|
|
2
|
-
|
|
3
|
-
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
|
4
|
-
|
|
5
|
-
# Specify your gem's dependencies in config_reader.gemspec
|
|
6
|
-
gemspec
|
|
7
|
-
|
|
8
|
-
gem "sekrets", github: "UnderpantsGnome/sekrets", branch: "ruby-3-2-support"
|
|
9
|
-
|
|
10
|
-
group :development do
|
|
11
|
-
gem "prettier", "~> 4.0"
|
|
12
|
-
gem "standard", "~> 1.29"
|
|
13
|
-
end
|
data/Gemfile.lock
DELETED
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
GIT
|
|
2
|
-
remote: https://github.com/UnderpantsGnome/sekrets.git
|
|
3
|
-
revision: 9f939c7789e2ed03902db9534b9df5cc8030c365
|
|
4
|
-
branch: ruby-3-2-support
|
|
5
|
-
specs:
|
|
6
|
-
sekrets (1.13.0)
|
|
7
|
-
coerce (~> 0.0.3)
|
|
8
|
-
fattr (~> 2.2)
|
|
9
|
-
highline (~> 1.6)
|
|
10
|
-
main (~> 6.1)
|
|
11
|
-
map (~> 6.3)
|
|
12
|
-
|
|
13
|
-
PATH
|
|
14
|
-
remote: .
|
|
15
|
-
specs:
|
|
16
|
-
config_reader (2.0.4)
|
|
17
|
-
|
|
18
|
-
GEM
|
|
19
|
-
remote: http://rubygems.org/
|
|
20
|
-
specs:
|
|
21
|
-
abbrev (0.1.2)
|
|
22
|
-
arrayfields (4.9.2)
|
|
23
|
-
ast (2.4.2)
|
|
24
|
-
chronic (0.10.2)
|
|
25
|
-
coderay (1.1.3)
|
|
26
|
-
coerce (0.0.8)
|
|
27
|
-
chronic (>= 0.6.2)
|
|
28
|
-
diff-lcs (1.5.0)
|
|
29
|
-
fattr (2.4.0)
|
|
30
|
-
haml (6.3.0)
|
|
31
|
-
temple (>= 0.8.2)
|
|
32
|
-
thor
|
|
33
|
-
tilt
|
|
34
|
-
highline (1.7.10)
|
|
35
|
-
json (2.7.2)
|
|
36
|
-
language_server-protocol (3.17.0.3)
|
|
37
|
-
lint_roller (1.1.0)
|
|
38
|
-
main (6.3.0)
|
|
39
|
-
arrayfields (~> 4.9, >= 4.9.2)
|
|
40
|
-
chronic (~> 0.10, >= 0.10.2)
|
|
41
|
-
fattr (~> 2.4, >= 2.4.0)
|
|
42
|
-
map (~> 6.6, >= 6.6.0)
|
|
43
|
-
map (6.6.0)
|
|
44
|
-
method_source (1.0.0)
|
|
45
|
-
parallel (1.24.0)
|
|
46
|
-
parser (3.3.1.0)
|
|
47
|
-
ast (~> 2.4.1)
|
|
48
|
-
racc
|
|
49
|
-
prettier (4.0.4)
|
|
50
|
-
syntax_tree (>= 4.0.1)
|
|
51
|
-
syntax_tree-haml (>= 2.0.0)
|
|
52
|
-
syntax_tree-rbs (>= 0.2.0)
|
|
53
|
-
prettier_print (1.2.1)
|
|
54
|
-
pry (0.14.2)
|
|
55
|
-
coderay (~> 1.1)
|
|
56
|
-
method_source (~> 1.0)
|
|
57
|
-
racc (1.7.3)
|
|
58
|
-
rainbow (3.1.1)
|
|
59
|
-
rake (13.0.6)
|
|
60
|
-
rbs (3.4.4)
|
|
61
|
-
abbrev
|
|
62
|
-
regexp_parser (2.9.0)
|
|
63
|
-
rexml (3.2.8)
|
|
64
|
-
strscan (>= 3.0.9)
|
|
65
|
-
rspec (3.12.0)
|
|
66
|
-
rspec-core (~> 3.12.0)
|
|
67
|
-
rspec-expectations (~> 3.12.0)
|
|
68
|
-
rspec-mocks (~> 3.12.0)
|
|
69
|
-
rspec-core (3.12.1)
|
|
70
|
-
rspec-support (~> 3.12.0)
|
|
71
|
-
rspec-expectations (3.12.2)
|
|
72
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
|
73
|
-
rspec-support (~> 3.12.0)
|
|
74
|
-
rspec-mocks (3.12.3)
|
|
75
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
|
76
|
-
rspec-support (~> 3.12.0)
|
|
77
|
-
rspec-support (3.12.0)
|
|
78
|
-
rubocop (1.62.1)
|
|
79
|
-
json (~> 2.3)
|
|
80
|
-
language_server-protocol (>= 3.17.0)
|
|
81
|
-
parallel (~> 1.10)
|
|
82
|
-
parser (>= 3.3.0.2)
|
|
83
|
-
rainbow (>= 2.2.2, < 4.0)
|
|
84
|
-
regexp_parser (>= 1.8, < 3.0)
|
|
85
|
-
rexml (>= 3.2.5, < 4.0)
|
|
86
|
-
rubocop-ast (>= 1.31.1, < 2.0)
|
|
87
|
-
ruby-progressbar (~> 1.7)
|
|
88
|
-
unicode-display_width (>= 2.4.0, < 3.0)
|
|
89
|
-
rubocop-ast (1.31.3)
|
|
90
|
-
parser (>= 3.3.1.0)
|
|
91
|
-
rubocop-performance (1.20.2)
|
|
92
|
-
rubocop (>= 1.48.1, < 2.0)
|
|
93
|
-
rubocop-ast (>= 1.30.0, < 2.0)
|
|
94
|
-
ruby-progressbar (1.13.0)
|
|
95
|
-
standard (1.35.1)
|
|
96
|
-
language_server-protocol (~> 3.17.0.2)
|
|
97
|
-
lint_roller (~> 1.0)
|
|
98
|
-
rubocop (~> 1.62.0)
|
|
99
|
-
standard-custom (~> 1.0.0)
|
|
100
|
-
standard-performance (~> 1.3)
|
|
101
|
-
standard-custom (1.0.2)
|
|
102
|
-
lint_roller (~> 1.0)
|
|
103
|
-
rubocop (~> 1.50)
|
|
104
|
-
standard-performance (1.3.1)
|
|
105
|
-
lint_roller (~> 1.1)
|
|
106
|
-
rubocop-performance (~> 1.20.2)
|
|
107
|
-
strscan (3.1.0)
|
|
108
|
-
syntax_tree (6.2.0)
|
|
109
|
-
prettier_print (>= 1.2.0)
|
|
110
|
-
syntax_tree-haml (4.0.3)
|
|
111
|
-
haml (>= 5.2)
|
|
112
|
-
prettier_print (>= 1.2.1)
|
|
113
|
-
syntax_tree (>= 6.0.0)
|
|
114
|
-
syntax_tree-rbs (1.0.0)
|
|
115
|
-
prettier_print
|
|
116
|
-
rbs
|
|
117
|
-
syntax_tree (>= 2.0.1)
|
|
118
|
-
temple (0.10.3)
|
|
119
|
-
thor (1.3.1)
|
|
120
|
-
tilt (2.3.0)
|
|
121
|
-
unicode-display_width (2.5.0)
|
|
122
|
-
|
|
123
|
-
PLATFORMS
|
|
124
|
-
ruby
|
|
125
|
-
|
|
126
|
-
DEPENDENCIES
|
|
127
|
-
config_reader!
|
|
128
|
-
prettier (~> 4.0)
|
|
129
|
-
pry
|
|
130
|
-
rake
|
|
131
|
-
rspec (~> 3.9)
|
|
132
|
-
sekrets!
|
|
133
|
-
standard (~> 1.29)
|
|
134
|
-
|
|
135
|
-
BUNDLED WITH
|
|
136
|
-
2.3.13
|
data/License.txt
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
Copyright (c) 2008 Michael Moen
|
|
2
|
-
|
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
|
-
a copy of this software and associated documentation files (the
|
|
5
|
-
"Software"), to deal in the Software without restriction, including
|
|
6
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to
|
|
9
|
-
the following conditions:
|
|
10
|
-
|
|
11
|
-
The above copyright notice and this permission notice shall be
|
|
12
|
-
included in all copies or substantial portions of the Software.
|
|
13
|
-
|
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
15
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
18
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
19
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ecd65abf0eef2de025cf028a84de56bddeb3f6fae18c78565e8f647a3bc79eec777b542c5de26bb74c1c5f7b5cf2ad6eaf71e8061f3729141ac6d38e48367aa7
|
data/config_reader.gemspec
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
|
2
|
-
$:.push File.expand_path('../lib', __FILE__)
|
|
3
|
-
require 'config_reader/version'
|
|
4
|
-
|
|
5
|
-
Gem::Specification.new do |s|
|
|
6
|
-
s.name = 'config_reader'
|
|
7
|
-
s.version = ConfigReader::VERSION
|
|
8
|
-
s.authors = ['Michael Moen']
|
|
9
|
-
s.email = ['michael@underpantsgnome.com']
|
|
10
|
-
s.homepage = 'https://github.com/UnderpantsGnome/config_reader-gem'
|
|
11
|
-
s.summary = %q{Provides a way to manage environment specific configuration settings.}
|
|
12
|
-
s.description = %q{Provides a way to manage environment specific configuration settings.}
|
|
13
|
-
|
|
14
|
-
s.files = `git ls-files`.split("\n")
|
|
15
|
-
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
|
16
|
-
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
|
17
|
-
s.require_paths = ['lib']
|
|
18
|
-
|
|
19
|
-
s.add_development_dependency 'rake'
|
|
20
|
-
s.add_development_dependency 'rspec', '~> 3.9'
|
|
21
|
-
s.add_development_dependency 'sekrets', '~> 1'
|
|
22
|
-
s.add_development_dependency 'pry'
|
|
23
|
-
|
|
24
|
-
s.post_install_message = "If you are are upgrading from a pre 2.x version, please see the configuration changes in the README https://github.com/UnderpantsGnome/config_reader-gem/blob/master/README.rdoc"
|
|
25
|
-
end
|
data/package.json
DELETED
data/spec/sekrets_ruby_3_2.yml
DELETED
data/yarn.lock
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
2
|
-
# yarn lockfile v1
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
"@prettier/plugin-ruby@^4.0.4":
|
|
6
|
-
version "4.0.4"
|
|
7
|
-
resolved "https://registry.yarnpkg.com/@prettier/plugin-ruby/-/plugin-ruby-4.0.4.tgz#73d85fc2a1731a3f62b57ac3116cf1c234027cb6"
|
|
8
|
-
integrity sha512-lCpvfS/dQU5WrwN3AQ5vR8qrvj2h5gE41X08NNzAAXvHdM4zwwGRcP2sHSxfu6n6No+ljWCVx95NvJPFTTjCTg==
|
|
9
|
-
|
|
10
|
-
prettier@^3.2.5:
|
|
11
|
-
version "3.2.5"
|
|
12
|
-
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.2.5.tgz#e52bc3090586e824964a8813b09aba6233b28368"
|
|
13
|
-
integrity sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==
|