environment_config 2.0.0 → 2.0.2
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/.gitlab-ci.yml +18 -31
- data/CHANGELOG.md +15 -6
- data/Gemfile +5 -1
- data/LICENSE.md +1 -1
- data/README.md +1 -1
- data/environment_config.gemspec +1 -5
- data/lib/environment_config/typed_env.rb +6 -3
- data/lib/environment_config/version.rb +1 -1
- metadata +5 -51
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cead2d32a3ead8966b4fe65da45a7601730facaa9683edb36c9a1ff21fd0e1c9
|
|
4
|
+
data.tar.gz: 629c196c747a8ab71bb49957831ef94acb049a1d414962a90f625c6cec899beb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b9a70141087dd53270a30675b27ba9a0350827de9ab08a0789b0f59af822c558c37db32992a051c6da1f8a012fc598eb1e7172e18e2ab3c6ae1d0f0db8169fbd
|
|
7
|
+
data.tar.gz: b6e16147c17b01e4226177d21e329aef67fa81b60030c70a8dce20b7279aea424cdf367304ee2d12c2a2a6a2c537150b10336c18334e8ab0ebcef0e0969bf46f
|
data/.gitlab-ci.yml
CHANGED
|
@@ -1,47 +1,34 @@
|
|
|
1
|
-
image: ruby:
|
|
1
|
+
image: $CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX/ruby:4.0
|
|
2
2
|
|
|
3
3
|
stages:
|
|
4
4
|
- test
|
|
5
5
|
- publish
|
|
6
6
|
|
|
7
7
|
before_script:
|
|
8
|
-
- bundle
|
|
9
|
-
- bundle install --path=/tmp/bundler --quiet
|
|
8
|
+
- bundle install --quiet
|
|
10
9
|
|
|
11
10
|
rubocop:
|
|
12
11
|
stage: test
|
|
13
|
-
script:
|
|
14
|
-
- bundle exec rubocop
|
|
15
|
-
|
|
16
|
-
rspec_3.0:
|
|
17
|
-
image: ruby:3.1
|
|
18
|
-
stage: test
|
|
19
|
-
script:
|
|
20
|
-
- bundle exec rspec
|
|
12
|
+
script: bundle exec rubocop
|
|
21
13
|
|
|
22
|
-
|
|
23
|
-
image: ruby:3.1
|
|
14
|
+
rspec:
|
|
24
15
|
stage: test
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
16
|
+
image: $CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX/ruby:$RUBY_VERSION
|
|
17
|
+
script: bundle exec rspec
|
|
18
|
+
parallel:
|
|
19
|
+
matrix:
|
|
20
|
+
- RUBY_VERSION:
|
|
21
|
+
- "3.0"
|
|
22
|
+
- "3.1"
|
|
23
|
+
- "3.2"
|
|
24
|
+
- "3.3"
|
|
25
|
+
- "3.4"
|
|
26
|
+
- "4.0"
|
|
33
27
|
|
|
34
28
|
publish_gem:
|
|
35
29
|
stage: publish
|
|
36
30
|
script:
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
cat << EOF > ~/.gem/credentials
|
|
40
|
-
---
|
|
41
|
-
:rubygems_api_key: ${RUBYGEMS_API_KEY}
|
|
42
|
-
EOF
|
|
43
|
-
- chmod 0600 ~/.gem/credentials
|
|
44
|
-
- gem build environment_config.gemspec
|
|
45
|
-
- gem push $(find `pwd` -name "environment_config-*.gem")
|
|
31
|
+
- gem build -o release.gem
|
|
32
|
+
- gem push release.gem
|
|
46
33
|
only:
|
|
47
|
-
-
|
|
34
|
+
- main
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
## 2.0.2 (2025-01-05)
|
|
2
|
+
|
|
3
|
+
* Add support for Ruby 4
|
|
4
|
+
* Make `base64` an optional dependency
|
|
5
|
+
|
|
6
|
+
## 2.0.1 (2024-06-12)
|
|
7
|
+
|
|
8
|
+
* Add `base64` as a dependency, since it's being removed from the standard Ruby library
|
|
9
|
+
|
|
1
10
|
## 2.0.0
|
|
2
11
|
|
|
3
12
|
* Breaking: Dropped support for Ruby versions below 3
|
|
@@ -7,16 +16,16 @@
|
|
|
7
16
|
|
|
8
17
|
* Add support for a new datatype `integer_list`
|
|
9
18
|
|
|
10
|
-
## 1.4.0
|
|
19
|
+
## 1.4.0 - YANKED
|
|
11
20
|
|
|
12
21
|
* Allow passing Base64 encoded variables
|
|
13
22
|
|
|
14
|
-
## 1.3.0
|
|
23
|
+
## 1.3.0 - YANKED
|
|
15
24
|
|
|
16
25
|
* Fix a bug where it was possible to overwrite values
|
|
17
26
|
* Add a ?-version to retrieve boolean values
|
|
18
27
|
|
|
19
|
-
## 1.2.1
|
|
28
|
+
## 1.2.1 - YANKED
|
|
20
29
|
|
|
21
30
|
* Switch from defining methods using `method_missing` to `define_method`
|
|
22
31
|
(to increase compatibility with gems that rely on `method_missing` on a global level)
|
|
@@ -25,7 +34,7 @@
|
|
|
25
34
|
|
|
26
35
|
* Add support for complex datatypes via `json` and `yaml` parsers
|
|
27
36
|
|
|
28
|
-
## 1.1.0
|
|
37
|
+
## 1.1.0 - YANKED
|
|
29
38
|
|
|
30
39
|
* Add `EnvironmentConfig.ensure`, which is a more expressive way to
|
|
31
40
|
check the presence of environment variables without using them
|
|
@@ -33,13 +42,13 @@
|
|
|
33
42
|
environment variable expecting the given type (e.g. `fetch_string`).
|
|
34
43
|
* Improve error readout for unparsable integer
|
|
35
44
|
|
|
36
|
-
## 1.0.1
|
|
45
|
+
## 1.0.1 - YANKED
|
|
37
46
|
|
|
38
47
|
* Make method private that should never have been public
|
|
39
48
|
* The `store` and `fetch` methods are not really part of the public interface
|
|
40
49
|
of the config, however since `fetch` is equal to a method on hashes,
|
|
41
50
|
it is quite likely to be called by accident
|
|
42
51
|
|
|
43
|
-
## 1.0.0
|
|
52
|
+
## 1.0.0 - YANKED
|
|
44
53
|
|
|
45
54
|
* Initial release
|
data/Gemfile
CHANGED
data/LICENSE.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Copyright 2017-
|
|
1
|
+
Copyright 2017-2024 be Around GmbH
|
|
2
2
|
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
4
|
|
data/README.md
CHANGED
|
@@ -48,7 +48,7 @@ EnvironmentConfig.load do |c|
|
|
|
48
48
|
end
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
This works regardless of the chosen type for the variable.
|
|
51
|
+
This works regardless of the chosen type for the variable. On Ruby versions >= 3.4 you need to add the base64 gem to your Gemfile, because it is no longer part of Ruby itself.
|
|
52
52
|
|
|
53
53
|
### Accessing values
|
|
54
54
|
|
data/environment_config.gemspec
CHANGED
|
@@ -21,9 +21,5 @@ Gem::Specification.new do |spec|
|
|
|
21
21
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
22
22
|
spec.require_paths = ['lib']
|
|
23
23
|
|
|
24
|
-
spec.required_ruby_version = '
|
|
25
|
-
|
|
26
|
-
spec.add_development_dependency 'aroundhome_cops', '~> 5.0'
|
|
27
|
-
spec.add_development_dependency 'pry'
|
|
28
|
-
spec.add_development_dependency 'rspec', '~> 3.6'
|
|
24
|
+
spec.required_ruby_version = '>= 3.0'
|
|
29
25
|
end
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
require 'environment_config/types'
|
|
4
4
|
|
|
5
|
-
require 'base64'
|
|
6
|
-
|
|
7
5
|
class EnvironmentConfig
|
|
8
6
|
class TypedEnv
|
|
9
7
|
class << self
|
|
@@ -15,12 +13,17 @@ class EnvironmentConfig
|
|
|
15
13
|
|
|
16
14
|
def fetch_raw(key, *options, base64: false)
|
|
17
15
|
result = ENV.fetch(key, *options)
|
|
18
|
-
|
|
16
|
+
if base64
|
|
17
|
+
require 'base64'
|
|
18
|
+
return Base64.decode64(result)
|
|
19
|
+
end
|
|
19
20
|
|
|
20
21
|
result
|
|
21
22
|
rescue KeyError => e
|
|
22
23
|
raise e,
|
|
23
24
|
"Expected environment variable #{key} to be set, but was missing."
|
|
25
|
+
rescue LoadError
|
|
26
|
+
raise 'Base64 could not be loaded. Please add the base64 gem to your Gemfile.'
|
|
24
27
|
end
|
|
25
28
|
end
|
|
26
29
|
end
|
metadata
CHANGED
|
@@ -1,58 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: environment_config
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- be Around GmbH
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
12
|
-
dependencies:
|
|
13
|
-
- !ruby/object:Gem::Dependency
|
|
14
|
-
name: aroundhome_cops
|
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
|
16
|
-
requirements:
|
|
17
|
-
- - "~>"
|
|
18
|
-
- !ruby/object:Gem::Version
|
|
19
|
-
version: '5.0'
|
|
20
|
-
type: :development
|
|
21
|
-
prerelease: false
|
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
-
requirements:
|
|
24
|
-
- - "~>"
|
|
25
|
-
- !ruby/object:Gem::Version
|
|
26
|
-
version: '5.0'
|
|
27
|
-
- !ruby/object:Gem::Dependency
|
|
28
|
-
name: pry
|
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
|
30
|
-
requirements:
|
|
31
|
-
- - ">="
|
|
32
|
-
- !ruby/object:Gem::Version
|
|
33
|
-
version: '0'
|
|
34
|
-
type: :development
|
|
35
|
-
prerelease: false
|
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
-
requirements:
|
|
38
|
-
- - ">="
|
|
39
|
-
- !ruby/object:Gem::Version
|
|
40
|
-
version: '0'
|
|
41
|
-
- !ruby/object:Gem::Dependency
|
|
42
|
-
name: rspec
|
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
|
44
|
-
requirements:
|
|
45
|
-
- - "~>"
|
|
46
|
-
- !ruby/object:Gem::Version
|
|
47
|
-
version: '3.6'
|
|
48
|
-
type: :development
|
|
49
|
-
prerelease: false
|
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
-
requirements:
|
|
52
|
-
- - "~>"
|
|
53
|
-
- !ruby/object:Gem::Version
|
|
54
|
-
version: '3.6'
|
|
55
|
-
description:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
+
dependencies: []
|
|
56
12
|
email:
|
|
57
13
|
- oss@aroundhome.de
|
|
58
14
|
executables: []
|
|
@@ -88,13 +44,12 @@ homepage: https://github.com/aroundhome/environment_config
|
|
|
88
44
|
licenses:
|
|
89
45
|
- MIT
|
|
90
46
|
metadata: {}
|
|
91
|
-
post_install_message:
|
|
92
47
|
rdoc_options: []
|
|
93
48
|
require_paths:
|
|
94
49
|
- lib
|
|
95
50
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
96
51
|
requirements:
|
|
97
|
-
- - "
|
|
52
|
+
- - ">="
|
|
98
53
|
- !ruby/object:Gem::Version
|
|
99
54
|
version: '3.0'
|
|
100
55
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
@@ -103,8 +58,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
103
58
|
- !ruby/object:Gem::Version
|
|
104
59
|
version: '0'
|
|
105
60
|
requirements: []
|
|
106
|
-
rubygems_version:
|
|
107
|
-
signing_key:
|
|
61
|
+
rubygems_version: 4.0.3
|
|
108
62
|
specification_version: 4
|
|
109
63
|
summary: Gem to unify reading configuration from env variables.
|
|
110
64
|
test_files: []
|