envv 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: f51800a6356a7766694b0a25b348583de55aceb3bf34b51d4850059797ca9a00
4
+ data.tar.gz: 73c33f10f4c7d0605e45bc5399bed13c6b6a7330cc12ab2ae4218f9ef2be0bbd
5
+ SHA512:
6
+ metadata.gz: bdae295b1e06c306c52b98e922873124b12dae3e140e321a9b1d5277d4d1a0a81de282afe32cde3856e2dacf8fb90efd544e54eb56b89fcef6baef5d84c5b1e7
7
+ data.tar.gz: a1f9c6c53f317c69984d887937d5e9d125ff3a415dd3d360b4dcef6fe755a0e704a6ed2046686eb36d2ca25eee743178f4d92c5c56a92b033c242927d48a175d
data/.standard.yml ADDED
@@ -0,0 +1,3 @@
1
+ # For available configuration options, see:
2
+ # https://github.com/testdouble/standard
3
+ ruby_version: 2.6
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2023-09-19
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 16@asciiland.net. 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/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2023 Fabrice Luraine
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,72 @@
1
+ ![ENVV banner](doc/banner.svg)
2
+
3
+ # ENVV
4
+
5
+ ENVV provides a ENV like accessor with schema validation and coerced values.
6
+
7
+ * By providing an explicit schema of required environments variables, it will facilitate collaborative development and deployment.
8
+ * It will inform you during the boot process of your application if you miss to provide some valid environment variables, avoiding bugs during execution.
9
+ * Schema and coercition are handled by [dry-rb](https://dry-rb.org/) libraries, with the benefits of the powerful DSL of [Dry::Schema](https://dry-rb.org/gems/dry-schema), its built-in [predicates](https://dry-rb.org/gems/dry-schema/1.13/basics/built-in-predicates/) and [types](https://dry-rb.org/gems/dry-schema/1.13/basics/type-specs/).
10
+
11
+
12
+ ## Installation
13
+
14
+ Install the gem and add to the application's Gemfile by executing:
15
+
16
+ $ bundle add envv
17
+
18
+ If bundler is not being used to manage dependencies, install the gem by executing:
19
+
20
+ $ gem install envv
21
+
22
+ **Requirements**: this library officially supports the following Ruby versions
23
+
24
+ * MRI `>= 3.0.0`
25
+
26
+
27
+ ## Usage
28
+
29
+ Build your ENVV with [Dry::Schema.Params](https://dry-rb.org/gems/dry-schema/1.13/params/) rules to describe your env vars requirements.
30
+
31
+ ```ruby
32
+ ENVV.build! do
33
+ required(:MY_STRING_VAR).filled(:string)
34
+ required(:MY_INT_VAR).filled(:integer, gt?: 3000)
35
+ required(:MY_BOOLEAN_VAR).filled(:bool)
36
+ end
37
+ ```
38
+
39
+ If requirements are not satisfied, it will **raise an exception**. So be sure this validation occurs as soon as possible in the boot process of your application.
40
+ In a Ruby On Rails application, you can place it in an initializer and ensure it will be executed first by naming it `app/initializers/01-envv.rb` for example, since initializers are run in alphabetical order.
41
+
42
+ If environment variables are validated, you can now access their coerced value with `ENVV#fetch` method:
43
+
44
+ ```ruby
45
+ # With ENV
46
+ #
47
+ # MY_STRING_VAR=hello
48
+ # MY_INT_VAR=4000
49
+ # MY_BOOLEAN_VAR=True
50
+
51
+ ENVV.fetch("MY_STRING_VAR") # ⇒ "Hello"
52
+ ENVV.fetch("MY_INT_VAR") # ⇒ 4000
53
+ ENVV.fetch("MY_BOOLEAN_VAR") # ⇒ true
54
+ ```
55
+
56
+
57
+ ## Development
58
+
59
+ 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.
60
+
61
+ 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).
62
+
63
+
64
+ ## Contributing
65
+
66
+ Bug reports and pull requests are welcome on GitHub at https://github.com/16/envv. 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/16/envv/blob/master/CODE_OF_CONDUCT.md).
67
+
68
+
69
+ ## License
70
+
71
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). See the separate [LICENSE.txt](LICENSE.txt) file. © Copyright 2023 Fabrice Luraine aka asciilander with spacedotspace collective.
72
+
data/Rakefile ADDED
@@ -0,0 +1,14 @@
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 "standard/rake"
13
+
14
+ task default: %i[test standard]
@@ -0,0 +1,121 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <!-- Created with Inkscape (http://www.inkscape.org/) -->
3
+
4
+ <svg
5
+ width="1080"
6
+ height="608"
7
+ viewBox="0 0 1080 608"
8
+ version="1.1"
9
+ id="svg-envv-banner"
10
+ sodipodi:docname="banner.svg"
11
+ inkscape:version="1.3 (1:1.3+202307231459+0e150ed6c4)"
12
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
13
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
14
+ xmlns="http://www.w3.org/2000/svg"
15
+ xmlns:svg="http://www.w3.org/2000/svg">
16
+ <sodipodi:namedview
17
+ id="namedview1"
18
+ pagecolor="#ffffff"
19
+ bordercolor="#666666"
20
+ borderopacity="1.0"
21
+ inkscape:showpageshadow="2"
22
+ inkscape:pageopacity="0.0"
23
+ inkscape:pagecheckerboard="0"
24
+ inkscape:deskcolor="#d1d1d1"
25
+ inkscape:document-units="px"
26
+ showguides="true"
27
+ inkscape:zoom="1"
28
+ inkscape:cx="407"
29
+ inkscape:cy="456"
30
+ inkscape:window-width="2560"
31
+ inkscape:window-height="1413"
32
+ inkscape:window-x="1920"
33
+ inkscape:window-y="27"
34
+ inkscape:window-maximized="1"
35
+ inkscape:current-layer="layer1" />
36
+ <defs
37
+ id="defs1" />
38
+ <g
39
+ inkscape:label="ENVV-banner"
40
+ inkscape:groupmode="layer"
41
+ id="layer1">
42
+ <rect
43
+ style="fill:none;stroke:none;stroke-width:0;stroke-dasharray:none;stroke-opacity:1;fill-opacity:1"
44
+ id="rect4"
45
+ width="1072.0311"
46
+ height="600.03107"
47
+ x="3.9844661"
48
+ y="3.9844661"
49
+ inkscape:label="bg" />
50
+ <rect
51
+ style="fill:none;stroke:#ff0000;stroke-width:7.96893;stroke-dasharray:none;stroke-opacity:1"
52
+ id="rect2"
53
+ width="1072.0311"
54
+ height="600.03107"
55
+ x="3.9844661"
56
+ y="3.9844661"
57
+ inkscape:label="frame" />
58
+ <text
59
+ xml:space="preserve"
60
+ style="font-weight:900;font-size:48px;line-height:1.05;font-family:'Noir Pro';-inkscape-font-specification:'Noir Pro Heavy';text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;white-space:pre;inline-size:812.2;display:inline;fill:#ff0000"
61
+ x="132.60391"
62
+ y="364.42175"
63
+ id="text2"
64
+ transform="translate(429.11311,73.697957)"
65
+ inkscape:label="baseline"><tspan
66
+ x="132.60391"
67
+ y="364.42175"
68
+ id="tspan5"><tspan
69
+ style="font-weight:normal;-inkscape-font-specification:'Noir Pro';text-align:start;text-anchor:start"
70
+ id="tspan4">environment variables with schema</tspan><tspan
71
+ y="364.42175"
72
+ id="tspan6"> </tspan></tspan><tspan
73
+ x="132.60391"
74
+ y="414.82175"
75
+ id="tspan8"><tspan
76
+ style="font-weight:normal;-inkscape-font-specification:'Noir Pro';text-align:start;text-anchor:start"
77
+ id="tspan7">validation and coerced values</tspan></tspan></text>
78
+ <g
79
+ id="g2"
80
+ transform="matrix(1.5896931,0,0,1.5896931,-424.0721,-129.24581)"
81
+ inkscape:label="ENVV">
82
+ <text
83
+ xml:space="preserve"
84
+ style="font-weight:900;font-size:193.452px;line-height:1.25;font-family:'Noir Pro';-inkscape-font-specification:'Noir Pro Heavy';text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ff0000;stroke-width:1.00756"
85
+ x="535.13391"
86
+ y="299.73889"
87
+ id="text1"
88
+ inkscape:label="ENV"><tspan
89
+ sodipodi:role="line"
90
+ id="tspan1"
91
+ x="535.13391"
92
+ y="299.73889"
93
+ style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:193.452px;font-family:'Noir Pro';-inkscape-font-specification:'Noir Pro Medium';fill:#ff0000;stroke-width:1.00756">ENV</tspan></text>
94
+ <text
95
+ xml:space="preserve"
96
+ style="font-weight:900;font-size:185.68px;line-height:1.25;font-family:'Noir Pro';-inkscape-font-specification:'Noir Pro Heavy';text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:none;stroke:#ff0000;stroke-width:5.22315;stroke-dasharray:none;stroke-opacity:1"
97
+ x="-716.51025"
98
+ y="-288.57489"
99
+ id="text1-5"
100
+ transform="matrix(-0.70710678,-0.70710678,-0.70710678,0.70710678,0,0)"
101
+ inkscape:label="V"><tspan
102
+ sodipodi:role="line"
103
+ id="tspan1-3"
104
+ x="-716.51025"
105
+ y="-288.57489"
106
+ style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:185.68px;font-family:'Noir Pro';-inkscape-font-specification:'Noir Pro Medium';fill:none;stroke:#ff0000;stroke-width:5.22315;stroke-dasharray:none;stroke-opacity:1">V</tspan></text>
107
+ </g>
108
+ <text
109
+ xml:space="preserve"
110
+ style="font-weight:900;font-size:47.8904px;line-height:1.25;font-family:'Noir Pro';-inkscape-font-specification:'Noir Pro Heavy';text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;display:inline;fill:#ff0000;stroke:none;stroke-width:0.997717"
111
+ x="122.60444"
112
+ y="426.60248"
113
+ id="text3"
114
+ inkscape:label="ruby-icon"><tspan
115
+ sodipodi:role="line"
116
+ id="tspan3"
117
+ x="122.60444"
118
+ y="426.60248"
119
+ style="fill:#ff0000;stroke:none;stroke-width:0.997717;stroke-opacity:1"></tspan></text>
120
+ </g>
121
+ </svg>
data/doc/banner.svg ADDED
@@ -0,0 +1,100 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <!-- Created with Inkscape (http://www.inkscape.org/) -->
3
+
4
+ <svg
5
+ width="1080"
6
+ height="608"
7
+ viewBox="0 0 1080 608"
8
+ version="1.1"
9
+ id="svg-envv-banner"
10
+ sodipodi:docname="banner.svg"
11
+ inkscape:version="1.3 (1:1.3+202307231459+0e150ed6c4)"
12
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
13
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
14
+ xmlns="http://www.w3.org/2000/svg"
15
+ xmlns:svg="http://www.w3.org/2000/svg">
16
+ <sodipodi:namedview
17
+ id="namedview1"
18
+ pagecolor="#ffffff"
19
+ bordercolor="#666666"
20
+ borderopacity="1.0"
21
+ inkscape:showpageshadow="2"
22
+ inkscape:pageopacity="0.0"
23
+ inkscape:pagecheckerboard="0"
24
+ inkscape:deskcolor="#d1d1d1"
25
+ inkscape:document-units="px"
26
+ showguides="true"
27
+ inkscape:zoom="1"
28
+ inkscape:cx="407"
29
+ inkscape:cy="456"
30
+ inkscape:window-width="2560"
31
+ inkscape:window-height="1413"
32
+ inkscape:window-x="1920"
33
+ inkscape:window-y="27"
34
+ inkscape:window-maximized="1"
35
+ inkscape:current-layer="layer1" />
36
+ <defs
37
+ id="defs1" />
38
+ <g
39
+ inkscape:label="ENVV-banner"
40
+ inkscape:groupmode="layer"
41
+ id="layer1">
42
+ <rect
43
+ style="fill:none;stroke:none;stroke-width:0;stroke-dasharray:none;stroke-opacity:1;fill-opacity:1"
44
+ id="rect4"
45
+ width="1072.0311"
46
+ height="600.03107"
47
+ x="3.9844661"
48
+ y="3.9844661"
49
+ inkscape:label="bg" />
50
+ <rect
51
+ style="fill:none;stroke:#ff0000;stroke-width:7.96893;stroke-dasharray:none;stroke-opacity:1"
52
+ id="rect2"
53
+ width="1072.0311"
54
+ height="600.03107"
55
+ x="3.9844661"
56
+ y="3.9844661"
57
+ inkscape:label="frame" />
58
+ <g
59
+ id="text2"
60
+ style="font-weight:900;font-size:48px;line-height:1.05;font-family:'Noir Pro';-inkscape-font-specification:'Noir Pro Heavy';text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;white-space:pre;inline-size:812.2;fill:#ff0000"
61
+ inkscape:label="baseline"
62
+ transform="translate(429.11311,73.697957)"
63
+ aria-label="environment variables with schema validation and coerced values">
64
+ <path
65
+ style="font-weight:normal;-inkscape-font-specification:'Noir Pro';text-align:start;text-anchor:start"
66
+ d="m -249.30409,352.99775 c 0,-7.488 -4.704,-12 -10.8,-12 -7.056,0 -11.472,5.328 -11.472,11.904 0,6.48 4.032,11.904 12.096,11.904 4.992,0 8.016,-2.256 8.64,-2.784 l -1.536,-4.128 c -1.824,1.296 -4.272,2.304 -7.008,2.304 -3.648,0 -6.768,-1.584 -7.488,-5.184 h 17.424 c 0.096,-0.624 0.144,-1.536 0.144,-2.016 z m -17.568,-2.208 c 0.096,-2.256 2.352,-5.184 6.576,-5.184 4.368,0 6.192,2.928 6.288,5.184 z m 33.9839,-9.792 c -3.6,0 -5.856,1.536 -7.2,3.072 v -2.688 h -4.608 v 23.04 h 4.608 v -12.672 c 0,-3.936 3.552,-6.144 6.336,-6.144 3.936,0 5.184,2.256 5.184,5.952 v 12.864 h 4.608 v -13.248 c 0,-6.816 -3.456,-10.176 -8.928,-10.176 z m 23.13597,24.192 11.136,-23.808 h -4.992 l -6.144,13.44 -6.144,-13.44 h -4.992 z m 16.89592,-27.648 c 1.92,0 3.456,-1.536 3.456,-3.456 0,-1.92 -1.536,-3.456 -3.456,-3.456 -1.92,0 -3.456,1.536 -3.456,3.456 0,1.92 1.536,3.456 3.456,3.456 z m -2.304,26.88 h 4.608 v -23.04 h -4.608 z m 15.74392,-18.096 v -4.944 h -4.608 v 23.04 h 4.608 v -10.272 c 0,-4.224 1.968,-6.768 4.992,-7.92 1.44,-0.528 3.12,-0.528 4.224,-0.192 v -5.04 c -4.32,0 -7.632,2.016 -9.216,5.328 z m 23.42391,-5.328 c -6.576,0 -11.904,5.328 -11.904,11.904 0,6.576 5.328,11.904 11.904,11.904 6.576,0 11.904,-5.328 11.904,-11.904 0,-6.576 -5.328,-11.904 -11.904,-11.904 z m 0,19.2 c -3.984,0 -7.296,-3.312 -7.296,-7.296 0,-3.984 3.312,-7.296 7.296,-7.296 3.984,0 7.296,3.312 7.296,7.296 0,3.984 -3.312,7.296 -7.296,7.296 z m 28.31989,-19.2 c -3.6,0 -5.856,1.536 -7.2,3.072 v -2.688 h -4.608 v 23.04 h 4.608 v -12.672 c 0,-3.936 3.552,-6.144 6.336,-6.144 3.936,0 5.184,2.256 5.184,5.952 v 12.864 h 4.608 v -13.248 c 0,-6.816 -3.456,-10.176 -8.928,-10.176 z m 40.319906,0 c -3.264,0 -5.52,1.008 -7.968,3.648 -1.392,-2.4 -3.648,-3.648 -6.623996,-3.648 -3.6,0 -5.088,1.536 -6.432,3.072 v -2.688 h -4.608 v 23.04 h 4.608 v -12.672 c 0,-3.936 2.784,-6.144 5.568,-6.144 3.167996,0 4.415996,2.256 4.415996,5.952 v 12.864 h 4.608 v -12.672 c 0,-3.936 2.784,-6.144 5.568,-6.144 3.168,0 4.416,2.256 4.416,5.952 v 12.864 h 4.608 v -12.864 c 0,-6.816 -3.072,-10.56 -8.16,-10.56 z m 35.039944,12 c 0,-7.488 -4.704,-12 -10.8,-12 -7.056,0 -11.472,5.328 -11.472,11.904 0,6.48 4.032,11.904 12.096,11.904 4.992,0 8.016,-2.256 8.64,-2.784 l -1.536,-4.128 c -1.824,1.296 -4.272,2.304 -7.008,2.304 -3.648,0 -6.768,-1.584 -7.488,-5.184 h 17.424 c 0.096,-0.624 0.144,-1.536 0.144,-2.016 z m -17.568,-2.208 c 0.096,-2.256 2.352,-5.184 6.576,-5.184 4.368,0 6.192,2.928 6.288,5.184 z m 33.983902,-9.792 c -3.6,0 -5.856,1.536 -7.2,3.072 v -2.688 h -4.608 v 23.04 h 4.608 v -12.672 c 0,-3.936 3.552,-6.144 6.336,-6.144 3.936,0 5.184,2.256 5.184,5.952 v 12.864 h 4.608 v -13.248 c 0,-6.816 -3.456,-10.176 -8.928,-10.176 z m 16.223911,15.888 c 0,4.416 1.44,7.92 5.808,7.92 1.296,0 2.4,-0.192 3.408,-0.672 v -4.656 c -1.056,0.528 -2.592,0.912 -3.696,0.096 -0.912,-0.672 -0.912,-2.352 -0.912,-3.984 v -9.6 h 4.608 v -4.608 h -4.608 v -9.216 h -4.608 v 9.216 h -3.072 v 4.608 h 3.072 z m 38.783951,8.304 11.136,-23.808 h -4.992 l -6.144,13.44 -6.144,-13.44 H 7.9750339 Z m 32.255914,-23.808 v 3.36 c -1.872,-2.448 -4.56,-3.744 -7.68,-3.744 -6.72,0 -11.52,5.328 -11.52,11.904 0,6.576 4.8,11.904 11.52,11.904 3.12,0 5.808,-1.296 7.68,-3.744 v 3.36 h 4.608 v -23.04 z m -7.296,18.816 c -4.032,0 -7.296,-3.264 -7.296,-7.296 0,-4.032 3.264,-7.296 7.296,-7.296 4.032,0 7.296,3.264 7.296,7.296 0,4.032 -3.264,7.296 -7.296,7.296 z m 23.039927,-13.872 v -4.944 h -4.608 v 23.04 h 4.608 v -10.272 c 0,-4.224 1.968,-6.768 4.992,-7.92 1.44,-0.528 3.12,-0.528 4.224,-0.192 v -5.04 c -4.32,0 -7.632,2.016 -9.216,5.328 z m 16.511918,-8.784 c 1.92,0 3.456,-1.536 3.456,-3.456 0,-1.92 -1.536,-3.456 -3.456,-3.456 -1.92,0 -3.456,1.536 -3.456,3.456 0,1.92 1.536,3.456 3.456,3.456 z m -2.304,26.88 h 4.608 v -23.04 h -4.608 z m 28.799927,-23.04 v 3.36 c -1.872,-2.448 -4.56,-3.744 -7.68,-3.744 -6.720002,0 -11.520002,5.328 -11.520002,11.904 0,6.576 4.8,11.904 11.520002,11.904 3.12,0 5.808,-1.296 7.68,-3.744 v 3.36 h 4.608 v -23.04 z m -7.296,18.816 c -4.032002,0 -7.296002,-3.264 -7.296002,-7.296 0,-4.032 3.264,-7.296 7.296002,-7.296 4.032,0 7.296,3.264 7.296,7.296 0,4.032 -3.264,7.296 -7.296,7.296 z m 23.03993,-29.568 h -4.608 v 33.792 h 4.608 v -3.36 c 1.872,2.448 4.56,3.744 7.68,3.744 6.72,0 11.52,-5.328 11.52,-11.904 0,-6.576 -4.8,-11.904 -11.52,-11.904 -3.12,0 -5.808,1.296 -7.68,3.744 z m 7.296,29.568 c -4.032,0 -7.296,-3.264 -7.296,-7.296 0,-4.032 3.264,-7.296 7.296,-7.296 4.032,0 7.296,3.264 7.296,7.296 0,4.032 -3.264,7.296 -7.296,7.296 z m 16.89592,-29.568 v 33.792 h 4.608 v -33.792 z m 31.48795,22.368 c 0,-7.488 -4.704,-12 -10.8,-12 -7.056,0 -11.472,5.328 -11.472,11.904 0,6.48 4.032,11.904 12.096,11.904 4.992,0 8.016,-2.256 8.64,-2.784 l -1.536,-4.128 c -1.824,1.296 -4.272,2.304 -7.008,2.304 -3.648,0 -6.768,-1.584 -7.488,-5.184 h 17.424 c 0.096,-0.624 0.144,-1.536 0.144,-2.016 z m -17.568,-2.208 c 0.096,-2.256 2.352,-5.184 6.576,-5.184 4.368,0 6.192,2.928 6.288,5.184 z m 32.20794,-0.576 c -2.688,-0.528 -5.424,-0.864 -5.424,-2.592 0,-1.584 2.496,-2.064 4.752,-2.016 2.832,0.048 5.712,1.152 6.768,1.92 l 1.584,-4.32 c -3.12,-1.68 -6.288,-2.208 -8.352,-2.208 -5.664,0 -9.36,2.736 -9.36,6.576 0,3.696 1.776,5.904 9.312,7.248 2.832,0.528 4.512,1.2 4.512,2.928 0,1.392 -1.776,2.496 -4.752,2.448 -2.592,-0.048 -6.192,-1.344 -8.016,-3.168 l -1.824,4.512 c 1.056,1.008 4.896,3.264 9.984,3.264 6,0 9.216,-3.024 9.216,-7.584 0,-2.832 -1.632,-5.712 -8.4,-7.008 z m 56.01597,-8.832 -5.376,13.728 -6.912,-14.496 -6.912,14.496 -5.376,-13.728 h -4.992 l 9.984,23.808 7.296,-14.784 7.296,14.784 9.984,-23.808 z m 11.13591,-3.84 c 1.92,0 3.456,-1.536 3.456,-3.456 0,-1.92 -1.536,-3.456 -3.456,-3.456 -1.92,0 -3.456,1.536 -3.456,3.456 0,1.92 1.536,3.456 3.456,3.456 z m -2.304,26.88 h 4.608 v -23.04 h -4.608 z m 13.05596,-7.536 c 0,4.416 1.44,7.92 5.808,7.92 1.296,0 2.4,-0.192 3.408,-0.672 v -4.656 c -1.056,0.528 -2.592,0.912 -3.696,0.096 -0.912,-0.672 -0.912,-2.352 -0.912,-3.984 v -9.6 h 4.608 v -4.608 h -4.608 v -9.216 h -4.608 v 9.216 h -3.072 v 4.608 h 3.072 z m 27.16793,-15.888 c -3.6,0 -5.856,1.536 -7.2,3.072 v -13.44 h -4.608 v 33.792 h 4.608 v -12.672 c 0,-3.936 3.552,-6.144 6.336,-6.144 3.936,0 5.184,2.256 5.184,5.952 v 12.864 h 4.608 v -12.864 c 0,-6.816 -3.072,-10.56 -8.928,-10.56 z m 39.69599,9.216 c -2.688,-0.528 -5.424,-0.864 -5.424,-2.592 0,-1.584 2.496,-2.064 4.752,-2.016 2.832,0.048 5.712,1.152 6.768,1.92 l 1.584,-4.32 c -3.12,-1.68 -6.288,-2.208 -8.352,-2.208 -5.664,0 -9.36,2.736 -9.36,6.576 0,3.696 1.776,5.904 9.312,7.248 2.832,0.528 4.512,1.2 4.512,2.928 0,1.392 -1.776,2.496 -4.752,2.448 -2.592,-0.048 -6.192,-1.344 -8.016,-3.168 l -1.824,4.512 c 1.056,1.008 4.896,3.264 9.984,3.264 6,0 9.216,-3.024 9.216,-7.584 0,-2.832 -1.632,-5.712 -8.4,-7.008 z m 11.85589,2.688 c 0,6.576 4.56,11.904 12.288,11.904 2.784,0 5.856,-0.912 7.68,-2.64 l -1.968,-4.32 c -1.44,1.44 -3.456,2.352 -5.664,2.352 -4.272,0 -7.728,-3.312 -7.728,-7.344 0,-3.936 3.456,-7.248 7.728,-7.248 2.208,0 4.224,0.912 5.664,2.304 l 1.968,-4.272 c -2.016,-1.824 -4.896,-2.64 -7.68,-2.64 -7.632,0 -12.288,5.328 -12.288,11.904 z m 36.76789,-11.904 c -3.6,0 -5.856,1.536 -7.2,3.072 v -13.44 h -4.608 v 33.792 h 4.608 v -12.672 c 0,-3.936 3.552,-6.144 6.336,-6.144 3.936,0 5.184,2.256 5.184,5.952 v 12.864 h 4.608 v -12.864 c 0,-6.816 -3.072,-10.56 -8.928,-10.56 z m 35.80794,12 c 0,-7.488 -4.704,-12 -10.8,-12 -7.056,0 -11.472,5.328 -11.472,11.904 0,6.48 4.032,11.904 12.096,11.904 4.992,0 8.016,-2.256 8.64,-2.784 l -1.536,-4.128 c -1.824,1.296 -4.272,2.304 -7.008,2.304 -3.648,0 -6.768,-1.584 -7.488,-5.184 h 17.424 c 0.096,-0.624 0.144,-1.536 0.144,-2.016 z m -17.568,-2.208 c 0.096,-2.256 2.352,-5.184 6.576,-5.184 4.368,0 6.192,2.928 6.288,5.184 z m 47.80793,-9.792 c -3.264,0 -5.52,1.008 -7.968,3.648 -1.392,-2.4 -3.648,-3.648 -6.624,-3.648 -3.6,0 -5.088,1.536 -6.432,3.072 v -2.688 h -4.608 v 23.04 h 4.608 v -12.672 c 0,-3.936 2.784,-6.144 5.568,-6.144 3.168,0 4.416,2.256 4.416,5.952 v 12.864 h 4.608 v -12.672 c 0,-3.936 2.784,-6.144 5.568,-6.144 3.168,0 4.416,2.256 4.416,5.952 v 12.864 h 4.608 v -12.864 c 0,-6.816 -3.072,-10.56 -8.16,-10.56 z m 31.96798,0.384 v 3.36 c -1.872,-2.448 -4.56,-3.744 -7.68,-3.744 -6.72,0 -11.52,5.328 -11.52,11.904 0,6.576 4.8,11.904 11.52,11.904 3.12,0 5.808,-1.296 7.68,-3.744 v 3.36 h 4.608 v -23.04 z m -7.296,18.816 c -4.032,0 -7.296,-3.264 -7.296,-7.296 0,-4.032 3.264,-7.296 7.296,-7.296 4.032,0 7.296,3.264 7.296,7.296 0,4.032 -3.264,7.296 -7.296,7.296 z"
67
+ id="path1"
68
+ inkscape:label="validation and coerced values" />
69
+ <path
70
+ style="font-weight:normal;-inkscape-font-specification:'Noir Pro';text-align:start;text-anchor:start"
71
+ d="m -261.97609,415.58975 11.136,-23.808 h -4.992 l -6.144,13.44 -6.144,-13.44 h -4.992 z m 32.25591,-23.808 v 3.36 c -1.872,-2.448 -4.56,-3.744 -7.68,-3.744 -6.72,0 -11.52,5.328 -11.52,11.904 0,6.576 4.8,11.904 11.52,11.904 3.12,0 5.808,-1.296 7.68,-3.744 v 3.36 h 4.608 v -23.04 z m -7.296,18.816 c -4.032,0 -7.296,-3.264 -7.296,-7.296 0,-4.032 3.264,-7.296 7.296,-7.296 4.032,0 7.296,3.264 7.296,7.296 0,4.032 -3.264,7.296 -7.296,7.296 z m 18.43193,-29.568 v 33.792 h 4.608 v -33.792 z m 13.43992,6.912 c 1.92,0 3.456,-1.536 3.456,-3.456 0,-1.92 -1.536,-3.456 -3.456,-3.456 -1.92,0 -3.456,1.536 -3.456,3.456 0,1.92 1.536,3.456 3.456,3.456 z m -2.304,26.88 h 4.608 v -23.04 h -4.608 z m 28.79993,-33.792 v 14.112 c -1.872,-2.448 -4.56,-3.744 -7.68,-3.744 -6.72,0 -11.52,5.328 -11.52,11.904 0,6.576 4.8,11.904 11.52,11.904 3.12,0 5.808,-1.296 7.68,-3.744 v 3.36 h 4.608 v -33.792 z m -7.296,29.568 c -4.032,0 -7.296,-3.264 -7.296,-7.296 0,-4.032 3.264,-7.296 7.296,-7.296 4.032,0 7.296,3.264 7.296,7.296 0,4.032 -3.264,7.296 -7.296,7.296 z m 36.09592,-18.816 v 3.36 c -1.872,-2.448 -4.56,-3.744 -7.68,-3.744 -6.72,0 -11.52,5.328 -11.52,11.904 0,6.576 4.8,11.904 11.52,11.904 3.12,0 5.808,-1.296 7.68,-3.744 v 3.36 h 4.608 v -23.04 z m -7.296,18.816 c -4.032,0 -7.296,-3.264 -7.296,-7.296 0,-4.032 3.264,-7.296 7.296,-7.296 4.032,0 7.296,3.264 7.296,7.296 0,4.032 -3.264,7.296 -7.296,7.296 z m 20.352,-3.312 c 0,4.416 1.44,7.92 5.808,7.92 1.296,0 2.4,-0.192 3.408,-0.672 v -4.656 c -1.056,0.528 -2.592,0.912 -3.696,0.096 -0.912,-0.672 -0.912,-2.352 -0.912,-3.984 v -9.6 h 4.608 v -4.608 h -4.608 v -9.216 h -4.608 v 9.216 h -3.072 v 4.608 h 3.072 z m 17.66396,-19.344 c 1.92,0 3.456,-1.536 3.456,-3.456 0,-1.92 -1.536,-3.456 -3.456,-3.456 -1.92,0 -3.456,1.536 -3.456,3.456 0,1.92 1.536,3.456 3.456,3.456 z m -2.304,26.88 h 4.608 v -23.04 h -4.608 z m 21.11995,-23.424 c -6.576,0 -11.904,5.328 -11.904,11.904 0,6.576 5.328,11.904 11.904,11.904 6.576004,0 11.904004,-5.328 11.904004,-11.904 0,-6.576 -5.328,-11.904 -11.904004,-11.904 z m 0,19.2 c -3.984,0 -7.296,-3.312 -7.296,-7.296 0,-3.984 3.312,-7.296 7.296,-7.296 3.984004,0 7.296004,3.312 7.296004,7.296 0,3.984 -3.312,7.296 -7.296004,7.296 z m 28.319887,-19.2 c -3.6,0 -5.856,1.536 -7.2,3.072 v -2.688 h -4.608 v 23.04 h 4.608 v -12.672 c 0,-3.936 3.552,-6.144 6.336,-6.144 3.936,0 5.184,2.256 5.184,5.952 v 12.864 h 4.608 v -13.248 c 0,-6.816 -3.456,-10.176 -8.928,-10.176 z m 48.095959,0.384 v 3.36 c -1.872,-2.448 -4.56,-3.744 -7.68,-3.744 -6.72,0 -11.52,5.328 -11.52,11.904 0,6.576 4.8,11.904 11.52,11.904 3.12,0 5.808,-1.296 7.68,-3.744 v 3.36 h 4.608 v -23.04 z m -7.296,18.816 c -4.032,0 -7.296,-3.264 -7.296,-7.296 0,-4.032 3.264,-7.296 7.296,-7.296 4.032,0 7.296,3.264 7.296,7.296 0,4.032 -3.264,7.296 -7.296,7.296 z m 30.23992712,-19.2 c -3.60000002,0 -5.85600002,1.536 -7.20000002,3.072 v -2.688 h -4.6080001 v 23.04 h 4.6080001 v -12.672 c 0,-3.936 3.552,-6.144 6.336,-6.144 3.936,0 5.184,2.256 5.184,5.952 v 12.864 h 4.608 v -13.248 c 0,-6.816 -3.456,-10.176 -8.92799998,-10.176 z m 32.73597388,-10.368 v 14.112 c -1.872,-2.448 -4.56,-3.744 -7.68,-3.744 -6.72,0 -11.52,5.328 -11.52,11.904 0,6.576 4.8,11.904 11.52,11.904 3.12,0 5.808,-1.296 7.68,-3.744 v 3.36 h 4.608 v -33.792 z m -7.296,29.568 c -4.032,0 -7.296,-3.264 -7.296,-7.296 0,-4.032 3.264,-7.296 7.296,-7.296 4.032,0 7.296,3.264 7.296,7.296 0,4.032 -3.264,7.296 -7.296,7.296 z m 32.639976,-7.296 c 0,6.576 4.56,11.904 12.288,11.904 2.784,0 5.856,-0.912 7.68,-2.64 l -1.968,-4.32 c -1.44,1.44 -3.456,2.352 -5.664,2.352 -4.272,0 -7.728,-3.312 -7.728,-7.344 0,-3.936 3.456,-7.248 7.728,-7.248 2.208,0 4.224,0.912 5.664,2.304 l 1.968,-4.272 c -2.016,-1.824 -4.896,-2.64 -7.68,-2.64 -7.632,0 -12.288,5.328 -12.288,11.904 z m 34.943887,-11.904 c -6.576,0 -11.904,5.328 -11.904,11.904 0,6.576 5.328,11.904 11.904,11.904 6.576,0 11.904,-5.328 11.904,-11.904 0,-6.576 -5.328,-11.904 -11.904,-11.904 z m 0,19.2 c -3.984,0 -7.296,-3.312 -7.296,-7.296 0,-3.984 3.312,-7.296 7.296,-7.296 3.984,0 7.296,3.312 7.296,7.296 0,3.984 -3.312,7.296 -7.296,7.296 z m 38.01592,-7.2 c 0,-7.488 -4.704,-12 -10.8,-12 -7.056,0 -11.472,5.328 -11.472,11.904 0,6.48 4.032,11.904 12.096,11.904 4.992,0 8.016,-2.256 8.64,-2.784 l -1.536,-4.128 c -1.824,1.296 -4.272,2.304 -7.008,2.304 -3.648,0 -6.768,-1.584 -7.488,-5.184 h 17.424 c 0.096,-0.624 0.144,-1.536 0.144,-2.016 z m -17.568,-2.208 c 0.096,-2.256 2.352,-5.184 6.576,-5.184 4.368,0 6.192,2.928 6.288,5.184 z m 26.7839,-4.464 v -4.944 h -4.608 v 23.04 h 4.608 v -10.272 c 0,-4.224 1.968,-6.768 4.992,-7.92 1.44,-0.528 3.12,-0.528 4.224,-0.192 v -5.04 c -4.32,0 -7.632,2.016 -9.216,5.328 z m 11.51991,6.576 c 0,6.576 4.56,11.904 12.288,11.904 2.784,0 5.856,-0.912 7.68,-2.64 l -1.968,-4.32 c -1.44,1.44 -3.456,2.352 -5.664,2.352 -4.272,0 -7.728,-3.312 -7.728,-7.344 0,-3.936 3.456,-7.248 7.728,-7.248 2.208,0 4.224,0.912 5.664,2.304 l 1.968,-4.272 c -2.016,-1.824 -4.896,-2.64 -7.68,-2.64 -7.632,0 -12.288,5.328 -12.288,11.904 z m 45.31189,0.096 c 0,-7.488 -4.704,-12 -10.8,-12 -7.056,0 -11.472,5.328 -11.472,11.904 0,6.48 4.032,11.904 12.096,11.904 4.992,0 8.016,-2.256 8.64,-2.784 l -1.536,-4.128 c -1.824,1.296 -4.272,2.304 -7.008,2.304 -3.648,0 -6.768,-1.584 -7.488,-5.184 h 17.424 c 0.096,-0.624 0.144,-1.536 0.144,-2.016 z m -17.568,-2.208 c 0.096,-2.256 2.352,-5.184 6.576,-5.184 4.368,0 6.192,2.928 6.288,5.184 z m 40.60794,-20.16 v 14.112 c -1.872,-2.448 -4.56,-3.744 -7.68,-3.744 -6.72,0 -11.52,5.328 -11.52,11.904 0,6.576 4.8,11.904 11.52,11.904 3.12,0 5.808,-1.296 7.68,-3.744 v 3.36 h 4.608 v -33.792 z m -7.296,29.568 c -4.032,0 -7.296,-3.264 -7.296,-7.296 0,-4.032 3.264,-7.296 7.296,-7.296 4.032,0 7.296,3.264 7.296,7.296 0,4.032 -3.264,7.296 -7.296,7.296 z m 42.23997,4.992 11.136,-23.808 h -4.992 l -6.144,13.44 -6.144,-13.44 h -4.992 z m 32.25595,-23.808 v 3.36 c -1.872,-2.448 -4.56,-3.744 -7.68,-3.744 -6.72,0 -11.52,5.328 -11.52,11.904 0,6.576 4.8,11.904 11.52,11.904 3.12,0 5.808,-1.296 7.68,-3.744 v 3.36 h 4.608 v -23.04 z m -7.296,18.816 c -4.032,0 -7.296,-3.264 -7.296,-7.296 0,-4.032 3.264,-7.296 7.296,-7.296 4.032,0 7.296,3.264 7.296,7.296 0,4.032 -3.264,7.296 -7.296,7.296 z m 18.43192,-29.568 v 33.792 h 4.608 v -33.792 z m 19.29587,34.176 c 3.6,0 5.856,-1.536 7.2,-3.072 v 2.688 h 4.608 v -23.04 h -4.608 v 12.672 c 0,3.936 -3.552,6.144 -6.336,6.144 -3.936,0 -5.184,-2.256 -5.184,-5.952 v -12.864 h -4.608 v 13.248 c 0,6.816 3.456,10.176 8.928,10.176 z m 38.68794,-11.808 c 0,-7.488 -4.704,-12 -10.8,-12 -7.056,0 -11.472,5.328 -11.472,11.904 0,6.48 4.032,11.904 12.096,11.904 4.992,0 8.016,-2.256 8.64,-2.784 l -1.536,-4.128 c -1.824,1.296 -4.272,2.304 -7.008,2.304 -3.648,0 -6.768,-1.584 -7.488,-5.184 h 17.424 c 0.096,-0.624 0.144,-1.536 0.144,-2.016 z m -17.568,-2.208 c 0.096,-2.256 2.352,-5.184 6.576,-5.184 4.368,0 6.192,2.928 6.288,5.184 z m 32.20793,-0.576 c -2.688,-0.528 -5.424,-0.864 -5.424,-2.592 0,-1.584 2.496,-2.064 4.752,-2.016 2.832,0.048 5.712,1.152 6.768,1.92 l 1.584,-4.32 c -3.12,-1.68 -6.288,-2.208 -8.352,-2.208 -5.664,0 -9.36,2.736 -9.36,6.576 0,3.696 1.776,5.904 9.312,7.248 2.832,0.528 4.512,1.2 4.512,2.928 0,1.392 -1.776,2.496 -4.752,2.448 -2.592,-0.048 -6.192,-1.344 -8.016,-3.168 l -1.824,4.512 c 1.056,1.008 4.896,3.264 9.984,3.264 6,0 9.216,-3.024 9.216,-7.584 0,-2.832 -1.632,-5.712 -8.4,-7.008 z"
72
+ id="path2"
73
+ inkscape:label="environment variables with schema" />
74
+ </g>
75
+ <g
76
+ id="g2"
77
+ transform="matrix(1.5896931,0,0,1.5896931,-424.0721,-129.24581)"
78
+ inkscape:label="ENVV">
79
+ <path
80
+ style="font-weight:500;font-size:193.452px;line-height:1.25;font-family:'Noir Pro';-inkscape-font-specification:'Noir Pro Medium';text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ff0000;stroke-width:1.00756"
81
+ d="m 445.37232,194.50101 v -24.76186 h -80.47603 v 129.99974 h 80.47603 v -24.76185 h -55.71417 v -27.85709 h 46.42848 v -24.76186 h -46.42848 v -27.85708 z m 111.42833,-24.76186 v 89.76173 l -64.99987,-89.76173 h -24.76186 v 129.99974 h 24.76186 v -89.76172 l 64.99987,89.76172 h 24.76186 V 169.73915 Z m 89.76161,129.99974 h 18.57139 L 717.75259,169.73915 H 689.8955 l -34.04755,86.66649 -34.04755,-86.66649 h -27.85709 z"
82
+ id="text1"
83
+ inkscape:label="ENV"
84
+ aria-label="ENV" />
85
+ <path
86
+ style="font-weight:500;font-size:185.68px;line-height:1.25;font-family:'Noir Pro';-inkscape-font-specification:'Noir Pro Medium';text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:none;stroke:#ff0000;stroke-width:5.22315"
87
+ d="m -725.42284,-288.57489 h 17.82528 l 50.50496,-124.77696 h -26.73792 l -32.67968,83.18464 -32.67968,-83.18464 h -26.73791 z"
88
+ id="text1-5"
89
+ inkscape:label="V"
90
+ transform="matrix(-0.70710678,-0.70710678,-0.70710678,0.70710678,0,0)"
91
+ aria-label="V" />
92
+ </g>
93
+ <path
94
+ d="m 155.9362,404.14188 v -0.0958 q -0.0958,-0.0958 -0.0958,-0.19156 l -0.0958,-0.0958 q 0,-0.0958 -0.0958,-0.19156 l -8.90761,-11.68526 -0.0958,-0.0958 -0.0958,-0.0958 -0.0958,-0.0958 q -0.0958,0 -0.0958,-0.0479 0,-0.0479 -0.0958,-0.0479 -0.0479,0 -0.0479,-0.0958 h -0.19156 l -0.0958,-0.0479 h -0.28734 -24.51989 q -0.76624,0 -1.10148,0.5268 l -9.09917,11.68526 q -0.0958,0 -0.0958,0.19156 l -0.0958,0.0958 q 0,0.0958 -0.0958,0.28734 v 0.0958 0.28734 0.19157 0.0958 q 0.0958,0.0958 0.0958,0.19156 0.0958,0.19156 0.28734,0.33523 l 21.59857,23.51419 q 0.19156,0.19156 0.28734,0.19156 0.19156,0.19156 0.28734,0.19156 h 0.0958 q 0.0958,0.0958 0.38313,0.0479 0.28734,0 0.38312,-0.0479 h 0.0958 q 0.0958,0 0.0958,0 l 0.14367,-0.0958 q 0,-0.0958 0.0958,-0.0958 l 0.19157,-0.19156 20.97599,-23.51419 q 0,-0.0958 0.0958,-0.14367 0,-0.0958 0.0958,-0.19156 0,-0.0958 0.0958,-0.19156 v -0.19157 -0.0958 -0.28734 z m -12.06838,-10.10487 -1.67616,7.4709 -5.84263,-7.4709 z m -10.29643,0.9578 6.27364,8.04559 h -11.9726 z m -2.72976,-0.9578 -5.31583,7.56668 -2.44241,-7.56668 z m -10.20065,1.4846 2.44241,7.51879 h -8.23715 z m -5.5074,10.29643 h 8.90762 l 5.89052,15.9954 z m 18.62937,18.24625 -6.84833,-18.24625 h 14.03189 z m 4.02279,-2.87343 6.08208,-15.37282 h 7.66247 z m 6.89622,-18.15046 1.58038,-7.13567 5.55529,7.13567 z"
95
+ id="text3"
96
+ style="font-weight:900;font-size:47.8904px;line-height:1.25;font-family:'Noir Pro';-inkscape-font-specification:'Noir Pro Heavy';text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ff0000;stroke-width:0.997717"
97
+ inkscape:label="ruby-icon"
98
+ aria-label="" />
99
+ </g>
100
+ </svg>
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "dry-initializer"
4
+ require "dry/schema"
5
+
6
+ module ENVV
7
+ class Builder
8
+ attr_reader :env, :schema
9
+
10
+ class << self
11
+ def call(env, schema = nil)
12
+ new(env, schema).call
13
+ end
14
+
15
+ def to_proc
16
+ method(:call).to_proc
17
+ end
18
+ end
19
+
20
+ def initialize(env, schema)
21
+ @env = env
22
+ @schema = schema
23
+ end
24
+
25
+ def call
26
+ validate_params!
27
+ result = @schema.call(extract_env_vars)
28
+
29
+ if result.failure?
30
+ raise ValidationError, result.errors(full: true).to_h.values.flatten
31
+ else
32
+ ENVV::Registry[result.to_h.transform_keys(&:to_s)].freeze
33
+ end
34
+ end
35
+
36
+ private
37
+
38
+ def validate_params!
39
+ raise InvalidSchemaError unless schema.is_a?(::Dry::Schema::Params)
40
+ raise InvalidEnvError unless env.is_a?(::Enumerable)
41
+ end
42
+
43
+ def extract_env_vars
44
+ keys = @schema.key_map.map { |key| key.name }
45
+ @env.select { |name, value| keys.include?(name) }
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ENVV
4
+ class Error < ::StandardError; end
5
+
6
+ class InvalidSchemaError < Error
7
+ def initialize
8
+ super("A ::Dry::Schema::Params is expected. See https://github.com/16/envv#schema.")
9
+ end
10
+ end
11
+
12
+ class InvalidEnvError < Error
13
+ def initialize
14
+ super("ENV or an an enumerable is expected.")
15
+ end
16
+ end
17
+
18
+ class ValidationError < Error
19
+ ERROR_MESSAGE_TITLE = "Environment variables validation failed:"
20
+
21
+ attr_reader :error_messages
22
+
23
+ def initialize(error_messages)
24
+ @error_messages = error_messages
25
+ super(full_error_message.join("\n"))
26
+ end
27
+
28
+ private
29
+
30
+ def full_error_message
31
+ messages = [ERROR_MESSAGE_TITLE]
32
+ messages.concat(@error_messages.map { |v| "\t* #{v}" })
33
+ messages << " "
34
+ end
35
+ end
36
+
37
+ class NotBuilt < Error
38
+ def initialize
39
+ super("Undefined registry. You must build ENVV first. See https://github.com/16/envv. ")
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ENVV
4
+ class Registry < ::Hash
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ENVV
4
+ VERSION = "0.1.0"
5
+ end
data/lib/envv.rb ADDED
@@ -0,0 +1,70 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "singleton"
4
+ require "dry/schema"
5
+ require_relative "envv/version"
6
+ require_relative "envv/errors"
7
+ require_relative "envv/registry"
8
+ require_relative "envv/builder"
9
+
10
+ module ENVV
11
+ module_function
12
+
13
+ # Validates ENV vars with schema rules and store coerced values in ENVV registry
14
+ # @param [Proc] A block with Dry::Schema.Params rules
15
+ # @raise [ENVV::InvalidSchemaError] if env vars requirements are not validated
16
+ # @return [ENVV]
17
+ def build!(&rules)
18
+ rules or raise ArgumentError, <<~MESSAGE
19
+ A block of schema rules is required to build ENVV.
20
+ Example:
21
+
22
+ ENVV.build! do
23
+ required(:MY_STRING_VAR).filled(:string)
24
+ required(:MY_INT_VAR).filled(:integer, gt?: 3000)
25
+ required(:MY_BOOLEAN_VAR).filled(:bool)
26
+ end
27
+
28
+ More info:
29
+
30
+ - https://dry-rb.org/gems/dry-schema
31
+ - https://github.com/16/envv
32
+
33
+ MESSAGE
34
+
35
+ @schema = ::Dry::Schema.Params(&rules)
36
+ @registry = Builder.call(ENV, @schema)
37
+ freeze
38
+ end
39
+
40
+ # @raise [ENVV::NotBuilt] error if called before ENVV built (see #build!)
41
+ # @return [Dry::Schema.Params] used to validate environment variables
42
+ def schema
43
+ @schema
44
+ end
45
+
46
+ # @raise [ENVV::NotBuilt] error if called before ENVV built (see #build!)
47
+ # @return [ENVV::Registry] Hash-like instance created at build
48
+ def registry
49
+ @registry or raise(NotBuilt)
50
+ end
51
+
52
+ # Fetch a coerced environment variable.
53
+ # This method use the same signature as Hash#fetch.
54
+ # @raise [KeyError] if `key` is not found and neither `default_value` nor a block was given.
55
+ # @overload fetch(key)
56
+ # @param key [String, Symbol]
57
+ # @return the value of the given `key` if found.
58
+ # @overload fetch(key, default_value)
59
+ # @param key [String, Symbol]
60
+ # @param default_value
61
+ # @return `default_value` if `key` is not found and no block was given
62
+ # @overload fetch(key, &block)
63
+ # @yields `key` to the block if `key` is not found and a block was given
64
+ # @return the block's return value.
65
+ def fetch(key, default_value = nil, &block)
66
+ registry.fetch(key.to_s, default_value, &block)
67
+ end
68
+
69
+ public :build!, :schema, :registry, :fetch
70
+ end
data/sig/envv.rbs ADDED
@@ -0,0 +1,4 @@
1
+ module Envv
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
metadata ADDED
@@ -0,0 +1,145 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: envv
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Fabrice Luraine
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2023-09-19 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: dry-schema
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.13'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.13'
27
+ - !ruby/object:Gem::Dependency
28
+ name: dry-initializer
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '3.1'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '3.1'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '2.4'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '2.4'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '13.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '13.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: minitest
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '5.19'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '5.19'
83
+ - !ruby/object:Gem::Dependency
84
+ name: standard
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '1.31'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '1.31'
97
+ description: ''
98
+ email:
99
+ - 16@asciiland.net
100
+ executables: []
101
+ extensions: []
102
+ extra_rdoc_files: []
103
+ files:
104
+ - ".standard.yml"
105
+ - CHANGELOG.md
106
+ - CODE_OF_CONDUCT.md
107
+ - LICENSE.txt
108
+ - README.md
109
+ - Rakefile
110
+ - doc/banner.inkscape.svg
111
+ - doc/banner.svg
112
+ - lib/envv.rb
113
+ - lib/envv/builder.rb
114
+ - lib/envv/errors.rb
115
+ - lib/envv/registry.rb
116
+ - lib/envv/version.rb
117
+ - sig/envv.rbs
118
+ homepage: https://github.com/16/envv
119
+ licenses:
120
+ - MIT
121
+ metadata:
122
+ homepage_uri: https://github.com/16/envv
123
+ source_code_uri: https://github.com/16/envv
124
+ changelog_uri: https://github.com/CHANGELOG.md
125
+ post_install_message:
126
+ rdoc_options: []
127
+ require_paths:
128
+ - lib
129
+ required_ruby_version: !ruby/object:Gem::Requirement
130
+ requirements:
131
+ - - ">="
132
+ - !ruby/object:Gem::Version
133
+ version: 3.0.0
134
+ required_rubygems_version: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ requirements: []
140
+ rubygems_version: 3.3.5
141
+ signing_key:
142
+ specification_version: 4
143
+ summary: Validates environment variables requirements with a schema and gives access
144
+ to their coerced values.
145
+ test_files: []