environment_config 2.0.1 → 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 +17 -30
- data/CHANGELOG.md +6 -1
- data/Gemfile +5 -1
- data/LICENSE.md +1 -1
- data/README.md +1 -1
- data/environment_config.gemspec +1 -7
- data/lib/environment_config/typed_env.rb +6 -3
- data/lib/environment_config/version.rb +1 -1
- metadata +5 -65
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,6 +1,11 @@
|
|
|
1
|
+
## 2.0.2 (2025-01-05)
|
|
2
|
+
|
|
3
|
+
* Add support for Ruby 4
|
|
4
|
+
* Make `base64` an optional dependency
|
|
5
|
+
|
|
1
6
|
## 2.0.1 (2024-06-12)
|
|
2
7
|
|
|
3
|
-
|
|
8
|
+
* Add `base64` as a dependency, since it's being removed from the standard Ruby library
|
|
4
9
|
|
|
5
10
|
## 2.0.0
|
|
6
11
|
|
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,11 +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_dependency 'base64', '~> 0.2.0'
|
|
27
|
-
|
|
28
|
-
spec.add_development_dependency 'aroundhome_cops', '~> 5.0'
|
|
29
|
-
spec.add_development_dependency 'pry'
|
|
30
|
-
spec.add_development_dependency 'rspec', '~> 3.6'
|
|
24
|
+
spec.required_ruby_version = '>= 3.0'
|
|
31
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,72 +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: base64
|
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
|
16
|
-
requirements:
|
|
17
|
-
- - "~>"
|
|
18
|
-
- !ruby/object:Gem::Version
|
|
19
|
-
version: 0.2.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.2.0
|
|
27
|
-
- !ruby/object:Gem::Dependency
|
|
28
|
-
name: aroundhome_cops
|
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
|
30
|
-
requirements:
|
|
31
|
-
- - "~>"
|
|
32
|
-
- !ruby/object:Gem::Version
|
|
33
|
-
version: '5.0'
|
|
34
|
-
type: :development
|
|
35
|
-
prerelease: false
|
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
-
requirements:
|
|
38
|
-
- - "~>"
|
|
39
|
-
- !ruby/object:Gem::Version
|
|
40
|
-
version: '5.0'
|
|
41
|
-
- !ruby/object:Gem::Dependency
|
|
42
|
-
name: pry
|
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
|
44
|
-
requirements:
|
|
45
|
-
- - ">="
|
|
46
|
-
- !ruby/object:Gem::Version
|
|
47
|
-
version: '0'
|
|
48
|
-
type: :development
|
|
49
|
-
prerelease: false
|
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
-
requirements:
|
|
52
|
-
- - ">="
|
|
53
|
-
- !ruby/object:Gem::Version
|
|
54
|
-
version: '0'
|
|
55
|
-
- !ruby/object:Gem::Dependency
|
|
56
|
-
name: rspec
|
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
|
58
|
-
requirements:
|
|
59
|
-
- - "~>"
|
|
60
|
-
- !ruby/object:Gem::Version
|
|
61
|
-
version: '3.6'
|
|
62
|
-
type: :development
|
|
63
|
-
prerelease: false
|
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
-
requirements:
|
|
66
|
-
- - "~>"
|
|
67
|
-
- !ruby/object:Gem::Version
|
|
68
|
-
version: '3.6'
|
|
69
|
-
description:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
+
dependencies: []
|
|
70
12
|
email:
|
|
71
13
|
- oss@aroundhome.de
|
|
72
14
|
executables: []
|
|
@@ -102,13 +44,12 @@ homepage: https://github.com/aroundhome/environment_config
|
|
|
102
44
|
licenses:
|
|
103
45
|
- MIT
|
|
104
46
|
metadata: {}
|
|
105
|
-
post_install_message:
|
|
106
47
|
rdoc_options: []
|
|
107
48
|
require_paths:
|
|
108
49
|
- lib
|
|
109
50
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
110
51
|
requirements:
|
|
111
|
-
- - "
|
|
52
|
+
- - ">="
|
|
112
53
|
- !ruby/object:Gem::Version
|
|
113
54
|
version: '3.0'
|
|
114
55
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
@@ -117,8 +58,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
117
58
|
- !ruby/object:Gem::Version
|
|
118
59
|
version: '0'
|
|
119
60
|
requirements: []
|
|
120
|
-
rubygems_version:
|
|
121
|
-
signing_key:
|
|
61
|
+
rubygems_version: 4.0.3
|
|
122
62
|
specification_version: 4
|
|
123
63
|
summary: Gem to unify reading configuration from env variables.
|
|
124
64
|
test_files: []
|