configurable_from_env 0.2.2 → 0.3.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/README.md +0 -1
- data/lib/configurable_from_env/version.rb +1 -1
- data/lib/configurable_from_env.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7416049cb3147ca0f5411cf8d207f9929f099f3613574fb40da63d5ba584f117
|
4
|
+
data.tar.gz: fc4f931acd43adf9d011426913ea70f0a31745d6d3139586931940be28e98a44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9a24d92dfa95a7b65f0fa4cfbcc5704fca1199e90b2ffeaf285cf9c1c6aba8b1e2cdc435017e9cab8efe604b35e287212e173d9f16e026358c3c3db1a9d60b5
|
7
|
+
data.tar.gz: cdcbb63e1b1c41b3930a28b0905b5f360b8c6e46608389794bb6726daa94619526e2f82a5c36e1d2bd5cb364963b9bc44f98b3db80042e1c387c5ab86a40352a
|
data/README.md
CHANGED
@@ -3,7 +3,6 @@
|
|
3
3
|
[](https://rubygems.org/gems/configurable_from_env)
|
4
4
|
[](https://www.ruby-toolbox.com/projects/configurable_from_env)
|
5
5
|
[](https://github.com/mattbrictson/configurable_from_env/actions/workflows/ci.yml)
|
6
|
-
[](https://codeclimate.com/github/mattbrictson/configurable_from_env)
|
7
6
|
|
8
7
|
The `configurable_from_env` gem allows you to define accessors that automatically populate via environment variables. It brings back Active Support's [`config_accessor`](https://github.com/rails/rails/blob/819a94934966eafb6bee6990b18372e1eb91159d/activesupport/lib/active_support/configurable.rb#L111) – which was [deprecated](https://github.com/rails/rails/pull/53970) in Rails 8.1 – and enhances it with a new `:from_env` option.
|
9
8
|
|
@@ -12,13 +12,13 @@ module ConfigurableFromEnv
|
|
12
12
|
include Configurable
|
13
13
|
|
14
14
|
module ClassMethods
|
15
|
-
def config_accessor(*attributes, from_env: nil, **options, &
|
15
|
+
def config_accessor(*attributes, from_env: nil, **options, &)
|
16
16
|
if from_env && attributes.many?
|
17
17
|
raise ArgumentError, "Only one accessor at a time can be created using the :from_env option"
|
18
18
|
end
|
19
19
|
|
20
20
|
env_value = EnvironmentValue.from(from_env)
|
21
|
-
accessor = super(*attributes, **options, &
|
21
|
+
accessor = super(*attributes, **options, &)
|
22
22
|
default_provided = options.key?(:default) || block_given?
|
23
23
|
|
24
24
|
env_value&.read(required: !default_provided) do |value|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: configurable_from_env
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Brictson
|
@@ -51,7 +51,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
51
51
|
requirements:
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '3.
|
54
|
+
version: '3.2'
|
55
55
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
56
56
|
requirements:
|
57
57
|
- - ">="
|