boa-config 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 0664aa2fe2753a1ef35a3ac38c2b406bb609e937912efcaa27aa93b5f599ea42
4
+ data.tar.gz: d1c4de144ec56f86934fc50ab9719e47f2db15bcb89968ef2c397894df61fb8e
5
+ SHA512:
6
+ metadata.gz: 83d41ea11f66d30a97f838f5f74163cb334c276173284b372a2bd450501dead9ee9da83f4cba9503496829e750c48d5e67f3ae894bceb80d635f3b6c4086d668
7
+ data.tar.gz: de52c323be2142a8e1e8aeece2938593c6f3097193812315eb2f80d0d7f3c02a7489ec48db8d55dac0cd9d222c0aaebcc036735f93c2882c270dbe8d650544f5
data/.rubocop.yml ADDED
@@ -0,0 +1,33 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.6
3
+ NewCops: enable
4
+ SuggestExtensions: false
5
+
6
+ Style/Documentation:
7
+ Enabled: false
8
+
9
+ Style/StringLiterals:
10
+ Enabled: true
11
+ EnforcedStyle: double_quotes
12
+
13
+ Style/StringLiteralsInInterpolation:
14
+ Enabled: true
15
+ EnforcedStyle: double_quotes
16
+
17
+ Style/GlobalVars:
18
+ Enabled: false
19
+
20
+ Layout/LineLength:
21
+ Max: 120
22
+
23
+ Metrics/MethodLength:
24
+ Max: 30
25
+
26
+ Metrics/ClassLength:
27
+ Enabled: false
28
+
29
+ Naming/AccessorMethodName:
30
+ Enabled: false
31
+
32
+ Metrics/PerceivedComplexity:
33
+ Max: 10
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2022-12-23
4
+
5
+ - Initial release
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at greg.c.schofield@gmail.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in Boa.gemspec
6
+ gemspec
7
+
8
+ group :development do
9
+ gem "minitest", "~> 5.0"
10
+ gem "rake", "~> 13.0"
11
+ gem "rubocop", "~> 1.21"
12
+ end
13
+
14
+ group :test do
15
+ gem "foo", path: "./test/fixtures/foo"
16
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,50 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ boa-config (0.1.0)
5
+
6
+ PATH
7
+ remote: test/fixtures/foo
8
+ specs:
9
+ foo (0.1.0)
10
+
11
+ GEM
12
+ remote: https://rubygems.org/
13
+ specs:
14
+ ast (2.4.2)
15
+ json (2.6.3)
16
+ minitest (5.16.3)
17
+ parallel (1.22.1)
18
+ parser (3.1.3.0)
19
+ ast (~> 2.4.1)
20
+ rainbow (3.1.1)
21
+ rake (13.0.6)
22
+ regexp_parser (2.6.1)
23
+ rexml (3.2.5)
24
+ rubocop (1.41.1)
25
+ json (~> 2.3)
26
+ parallel (~> 1.10)
27
+ parser (>= 3.1.2.1)
28
+ rainbow (>= 2.2.2, < 4.0)
29
+ regexp_parser (>= 1.8, < 3.0)
30
+ rexml (>= 3.2.5, < 4.0)
31
+ rubocop-ast (>= 1.23.0, < 2.0)
32
+ ruby-progressbar (~> 1.7)
33
+ unicode-display_width (>= 1.4.0, < 3.0)
34
+ rubocop-ast (1.24.0)
35
+ parser (>= 3.1.1.0)
36
+ ruby-progressbar (1.11.0)
37
+ unicode-display_width (2.3.0)
38
+
39
+ PLATFORMS
40
+ arm64-darwin-21
41
+
42
+ DEPENDENCIES
43
+ boa-config!
44
+ foo!
45
+ minitest (~> 5.0)
46
+ rake (~> 13.0)
47
+ rubocop (~> 1.21)
48
+
49
+ BUNDLED WITH
50
+ 2.3.26
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2022 Gregory Schofield
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,37 @@
1
+ # boa-config
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/boa`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Install the gem and add to the application's Gemfile by executing:
10
+
11
+ $ bundle add boa
12
+
13
+ If bundler is not being used to manage dependencies, install the gem by executing:
14
+
15
+ $ gem install boa
16
+
17
+ ## Usage
18
+
19
+ TODO: Write usage instructions here
20
+
21
+ ## Development
22
+
23
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
24
+
25
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
26
+
27
+ ## Contributing
28
+
29
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/Boa. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/Boa/blob/main/CODE_OF_CONDUCT.md).
30
+
31
+ ## License
32
+
33
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
34
+
35
+ ## Code of Conduct
36
+
37
+ Everyone interacting in the Boa project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/Boa/blob/main/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rake/testtask"
5
+
6
+ Rake::TestTask.new(:test) do |t|
7
+ t.libs << "test"
8
+ t.libs << "lib"
9
+ t.test_files = FileList["test/**/test_*.rb"]
10
+ end
11
+
12
+ require "rubocop/rake_task"
13
+
14
+ RuboCop::RakeTask.new
15
+
16
+ task default: %i[test rubocop]
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/boa/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "boa-config"
7
+ spec.version = Boa::VERSION
8
+ spec.authors = ["Gregory Schofield"]
9
+ spec.email = ["greg.c.schofield@gmail.com"]
10
+ spec.summary = "A configuration library inspired by spf13/viper."
11
+ spec.homepage = "https://github.com/gscho/boa"
12
+ spec.license = "MIT"
13
+ spec.required_ruby_version = ">= 2.6.0"
14
+ spec.metadata["homepage_uri"] = spec.homepage
15
+ spec.metadata["source_code_uri"] = spec.homepage
16
+ spec.metadata["changelog_uri"] = "#{spec.homepage}/CHANGELOG.md"
17
+ spec.files = Dir.chdir(__dir__) do
18
+ `git ls-files -z`.split("\x0").reject do |f|
19
+ (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
20
+ end
21
+ end
22
+ spec.require_paths = ["lib"]
23
+ spec.metadata["rubygems_mfa_required"] = "true"
24
+ end
data/lib/boa/config.rb ADDED
@@ -0,0 +1,215 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "singleton"
4
+
5
+ module Boa
6
+ class Config
7
+ include Singleton
8
+ attr_reader :config, :config_paths, :name, :type
9
+
10
+ def initialize
11
+ @config = {}
12
+ @config_paths = []
13
+ @env_prefix = ""
14
+ end
15
+
16
+ # Mainly for unit tests
17
+ def reset!
18
+ @config = {}
19
+ @config_paths = []
20
+ @env_prefix = ""
21
+ @name = nil
22
+ @type = nil
23
+ end
24
+
25
+ def set_default(key, val)
26
+ @config[key.to_s] = val
27
+ end
28
+
29
+ def set_config_name(name)
30
+ @name = name
31
+ end
32
+
33
+ def set_config_type(type)
34
+ @type = type.delete_prefix(".")
35
+ end
36
+
37
+ def add_config_path(path)
38
+ @config_paths << path
39
+ end
40
+
41
+ def read_config(config_string)
42
+ raise BoaConfigError, "Must provide the config type before calling read_config" if @type.empty?
43
+
44
+ read_config_from(config_string)
45
+ end
46
+
47
+ def read_in_config
48
+ @type ||= File.extname(@name).delete_prefix(".")
49
+ if @type.empty?
50
+ raise BoaConfigError,
51
+ "Must provide an extension in the config name or explicitly set the config type"
52
+ end
53
+
54
+ file = "#{File.basename(@name, ".#{@type}")}.#{@type}"
55
+ config_dir = @config_paths.find { |p| File.exist?(File.join(p, file)) }
56
+ if config_dir.nil?
57
+ raise BoaConfigError,
58
+ "Unable to locate a config file named: '#{file}' at the provided config paths."
59
+ end
60
+
61
+ file_path = File.join(config_dir, file)
62
+ read_config_from(File.read(file_path))
63
+ end
64
+
65
+ def get(key)
66
+ key = @env_prefix + key
67
+ return ENV.fetch(key.upcase, value_at_path(@config, key)) if @automatic_env
68
+
69
+ value_at_path(@config, key)
70
+ end
71
+
72
+ def get_float(key)
73
+ get(key).to_f
74
+ end
75
+
76
+ def get_int(key)
77
+ get(key).to_i
78
+ end
79
+
80
+ def get_int_array(key)
81
+ key = @env_prefix + key
82
+ value = value_at_path(@config, key)
83
+ return value if value.nil?
84
+ raise BoaConfigError, "Value at key: '#{key}' is not an array" unless value.is_a?(Array)
85
+
86
+ value.map(&:to_i)
87
+ end
88
+
89
+ def get_string(key)
90
+ get(key).to_s
91
+ end
92
+
93
+ def get_string_hash(key)
94
+ key = @env_prefix + key
95
+ value = value_at_path(@config, key)
96
+ return value if value.nil?
97
+ raise BoaConfigError, "Value at key: '#{key}' is not a hash" unless value.is_a?(Hash)
98
+
99
+ value.transform_keys(&:to_s)
100
+ end
101
+
102
+ def get_string_array(key)
103
+ value = value_at_path(@config, key)
104
+ return value if value.nil?
105
+ raise BoaConfigError, "Value at key: '#{key}' is not an array" unless value.is_a?(Array)
106
+
107
+ value.map(&:to_s)
108
+ end
109
+
110
+ def set(key, value)
111
+ set_value_at_path(@config, key, value)
112
+ end
113
+
114
+ def set?(key)
115
+ value = get(key)
116
+ !value.nil? && !value.empty?
117
+ end
118
+
119
+ def all_settings
120
+ @config
121
+ end
122
+
123
+ def write_config
124
+ raise BoaConfigError, "No config paths added" if config_paths.empty?
125
+
126
+ write_config_as(config_paths.first)
127
+ end
128
+
129
+ def safe_write_config
130
+ raise BoaConfigError, "No config paths added" if config_paths.empty?
131
+
132
+ safe_write_config_as(config_paths.first)
133
+ end
134
+
135
+ def write_config_as(path)
136
+ @type ||= File.extname(@name).delete_prefix(".")
137
+ if @type.empty?
138
+ raise BoaConfigError,
139
+ "Must provide an extension in the config name or explicitly set the config type"
140
+ end
141
+
142
+ file = "#{File.basename(@name, ".#{@type}")}.#{@type}"
143
+ path = File.join(path, file)
144
+
145
+ write_config_to(path)
146
+ end
147
+
148
+ def safe_write_config_as(path)
149
+ raise BoaConfigError, "Config file: '#{path}' already exists" if File.exist?(path)
150
+
151
+ write_config_as(path)
152
+ end
153
+
154
+ def set_env_prefix(prefix)
155
+ @env_prefix = "#{prefix.upcase}_"
156
+ end
157
+
158
+ def bind_env(key, *names)
159
+ if names.any?
160
+ key = key.upcase
161
+ names.each do |n|
162
+ value = ENV.fetch(n, nil)
163
+ if value
164
+ @config[key] = value
165
+ break
166
+ end
167
+ end
168
+ else
169
+ key = @env_prefix + key.upcase
170
+ @config[key] = ENV.fetch(key, nil)
171
+ end
172
+ end
173
+
174
+ def automatic_env
175
+ @automatic_env = true
176
+ end
177
+
178
+ def value_at_path(hash, nested_path)
179
+ path = nested_path.split(".")
180
+ at_path = hash[path[0].downcase]
181
+ at_path = hash[path[0].upcase] if at_path.nil?
182
+ return at_path if path.size == 1 || at_path.nil?
183
+
184
+ path.shift
185
+ value_at_path(at_path, path.join("."))
186
+ end
187
+
188
+ def set_value_at_path(hash, nested_path, value)
189
+ path = nested_path.split(".")
190
+ at_path = hash[path[0].downcase]
191
+ at_path = hash[path[0].upcase] if at_path.nil?
192
+ if path.size == 1
193
+ hash[path[0]] = value
194
+ return
195
+ end
196
+ path.shift
197
+ set_value_at_path(at_path, path.join("."), value)
198
+ rescue NoMethodError
199
+ raise BoaConfigError, "Unable to modify config at: '#{nested_path}' because parent is nil or not a hash"
200
+ end
201
+
202
+ private
203
+
204
+ def read_config_from(file)
205
+ serde = Boa::Plugin.plugin_for_type(@type)
206
+ parsed = serde.deserialize(file)
207
+ @config.merge! parsed
208
+ end
209
+
210
+ def write_config_to(path)
211
+ serde = Boa::Plugin.plugin_for_type(@type)
212
+ File.write(path, serde.serialize(@config))
213
+ end
214
+ end
215
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Boa
4
+ module Plugin
5
+ class Base
6
+ def deserialize(data); end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "base"
4
+ require "json"
5
+
6
+ module Boa
7
+ module Plugin
8
+ class BoaJSON < Boa::Plugin::Base
9
+ Boa::Plugin.register("json", self)
10
+
11
+ def deserialize(data)
12
+ JSON.parse data
13
+ end
14
+
15
+ def serialize(config)
16
+ config.to_json
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "base"
4
+ require "yaml"
5
+
6
+ module Boa
7
+ module Plugin
8
+ class BoaYAML < Boa::Plugin::Base
9
+ Boa::Plugin.register("yaml", self)
10
+
11
+ def deserialize(data)
12
+ YAML.safe_load data
13
+ end
14
+
15
+ def serialize(config)
16
+ config.to_yaml
17
+ end
18
+ end
19
+ end
20
+ end
data/lib/boa/plugin.rb ADDED
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Boa
4
+ module Plugin
5
+ def self.register(type, klass)
6
+ raise BoaPluginError, "Invalid plugin definition for: '#{type}'. Plugin must be a Class" unless klass.is_a?(Class)
7
+
8
+ @plugins[type] = klass.new
9
+ end
10
+
11
+ def self.plugin_for_type(type)
12
+ @plugins ||= {}
13
+ return @plugins[type] unless @plugins[type].nil?
14
+
15
+ Boa::Plugin.search(type)
16
+ raise BoaPluginError, "Unable to find a plugin for type: '#{type}'" if @plugins[type].nil?
17
+
18
+ @plugins[type]
19
+ end
20
+
21
+ # rubocop:disable Metrics/AbcSize
22
+ # rubocop:disable Metrics/CyclomaticComplexity
23
+ def self.search(type)
24
+ path = "boa/plugin/boa_#{type}"
25
+ files = $LOAD_PATH.map do |lp|
26
+ lpath = File.expand_path(File.join(lp, "#{path}.rb"))
27
+ File.exist?(lpath) ? lpath : nil
28
+ end.compact
29
+
30
+ unless files.empty?
31
+ require files.max
32
+ return
33
+ end
34
+
35
+ specs = Gem::Specification.find_all do |spec|
36
+ spec.contains_requirable_file? path
37
+ end.sort_by(&:version)
38
+
39
+ spec = specs.last
40
+ return unless spec
41
+
42
+ spec.require_paths.each do |lib|
43
+ file = "#{spec.full_gem_path}/#{lib}/#{path}"
44
+ if File.exist?("#{file}.rb")
45
+ require file
46
+ break
47
+ end
48
+ end
49
+ end
50
+ # rubocop:enable Metrics/AbcSize
51
+ # rubocop:enable Metrics/CyclomaticComplexity
52
+ end
53
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Boa
4
+ VERSION = "0.1.0"
5
+ end
data/lib/boa.rb ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "boa/plugin"
4
+ require_relative "boa/config"
5
+ require_relative "boa/version"
6
+
7
+ module Boa
8
+ class BoaConfigError < StandardError; end
9
+ class BoaPluginError < StandardError; end
10
+ end
11
+
12
+ $boa = Boa::Config.instance
metadata ADDED
@@ -0,0 +1,63 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: boa-config
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Gregory Schofield
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2022-12-31 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description:
14
+ email:
15
+ - greg.c.schofield@gmail.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - ".rubocop.yml"
21
+ - CHANGELOG.md
22
+ - CODE_OF_CONDUCT.md
23
+ - Gemfile
24
+ - Gemfile.lock
25
+ - LICENSE.txt
26
+ - README.md
27
+ - Rakefile
28
+ - boa-config.gemspec
29
+ - lib/boa.rb
30
+ - lib/boa/config.rb
31
+ - lib/boa/plugin.rb
32
+ - lib/boa/plugin/base.rb
33
+ - lib/boa/plugin/boa_json.rb
34
+ - lib/boa/plugin/boa_yaml.rb
35
+ - lib/boa/version.rb
36
+ homepage: https://github.com/gscho/boa
37
+ licenses:
38
+ - MIT
39
+ metadata:
40
+ homepage_uri: https://github.com/gscho/boa
41
+ source_code_uri: https://github.com/gscho/boa
42
+ changelog_uri: https://github.com/gscho/boa/CHANGELOG.md
43
+ rubygems_mfa_required: 'true'
44
+ post_install_message:
45
+ rdoc_options: []
46
+ require_paths:
47
+ - lib
48
+ required_ruby_version: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: 2.6.0
53
+ required_rubygems_version: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: '0'
58
+ requirements: []
59
+ rubygems_version: 3.3.7
60
+ signing_key:
61
+ specification_version: 4
62
+ summary: A configuration library inspired by spf13/viper.
63
+ test_files: []