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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: af7756f20e176d4b6747bd7cfad9d9dc9a7015d00071f6a0fdd352828df9c980
4
- data.tar.gz: 07cf567fd1d97d1ac94b558e17598ee513734cd807781177a2b827a5c3701749
3
+ metadata.gz: 7416049cb3147ca0f5411cf8d207f9929f099f3613574fb40da63d5ba584f117
4
+ data.tar.gz: fc4f931acd43adf9d011426913ea70f0a31745d6d3139586931940be28e98a44
5
5
  SHA512:
6
- metadata.gz: e4973bde3cf88e1df97ad9a13742364a9426c8e75bd8b84dcb80fcfe52e783613a7c143034f63dc70d1eb66eeeb37600b304b07581a4748868949cabea0c03f7
7
- data.tar.gz: a2ae935da9d184a33a0e8e1d7fd95928c08819188bcb184c7915ed063b7921f220b5ae0ca63a56887877364a10d0a80637caff7cadfc8d1a82bd4204739f2a35
6
+ metadata.gz: e9a24d92dfa95a7b65f0fa4cfbcc5704fca1199e90b2ffeaf285cf9c1c6aba8b1e2cdc435017e9cab8efe604b35e287212e173d9f16e026358c3c3db1a9d60b5
7
+ data.tar.gz: cdcbb63e1b1c41b3930a28b0905b5f360b8c6e46608389794bb6726daa94619526e2f82a5c36e1d2bd5cb364963b9bc44f98b3db80042e1c387c5ab86a40352a
data/README.md CHANGED
@@ -3,7 +3,6 @@
3
3
  [![Gem Version](https://img.shields.io/gem/v/configurable_from_env)](https://rubygems.org/gems/configurable_from_env)
4
4
  [![Gem Downloads](https://img.shields.io/gem/dt/configurable_from_env)](https://www.ruby-toolbox.com/projects/configurable_from_env)
5
5
  [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/mattbrictson/configurable_from_env/ci.yml)](https://github.com/mattbrictson/configurable_from_env/actions/workflows/ci.yml)
6
- [![Code Climate maintainability](https://img.shields.io/codeclimate/maintainability/mattbrictson/configurable_from_env)](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
 
@@ -1,3 +1,3 @@
1
1
  module ConfigurableFromEnv
2
- VERSION = "0.2.2".freeze
2
+ VERSION = "0.3.0".freeze
3
3
  end
@@ -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, &block)
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, &block)
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.2.2
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.1'
54
+ version: '3.2'
55
55
  required_rubygems_version: !ruby/object:Gem::Requirement
56
56
  requirements:
57
57
  - - ">="