dry-configurable 1.0.0 → 1.1.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: 5d067b9cb78be3e3904b22ab5e73a6903cecb387c241d08c875f2a1eaf1002a4
4
- data.tar.gz: c7f9be3367d11ea23c10a8a73d0a63d0fab54a1cf6cd2f5053e8845b808bd801
3
+ metadata.gz: 4690042ec201916af0a26a6b54969369f071e387766a67c3feaaaf48dcd8d78c
4
+ data.tar.gz: bea78a7c2151680295cd815f20e83942c9d4e3ff0e9d2246f507fdd9b0cffe35
5
5
  SHA512:
6
- metadata.gz: 45d5b855ac62fa249080b1c40ed9faf0644cf9daa3d3a18c8c3cc0780723006dd510d3b0cb156d2251962775f95396b591e96136d951e08e4679dd684118601d
7
- data.tar.gz: fc7420686647324a2c671f183aff7b1fc69131f80db292d0847e53dc5744e16904f56dc74a35b6dadb6cce1f4927409a632d026d7127ccb5844d9b8ba67b4e98
6
+ metadata.gz: 63bc9c6e501d2ab9e1163458375caccb3da12954c79c52f0a81484386781df4d23569767b7b4484a639189d825b1ff4da809af22274e99f69537f06dad54b1b7
7
+ data.tar.gz: b313d3f0eea05075a50e578bb8a90e6cc58fd7e3cd98ce9c095e3a490851a2be855e8d05795f94c45764172aa67c18a0e88c74811f21735450e846a24b3889c0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  <!--- DO NOT EDIT THIS FILE - IT'S AUTOMATICALLY GENERATED VIA DEVTOOLS --->
2
2
 
3
+ ## 1.0.2 2022-07-16
4
+
5
+
6
+ ### Fixed
7
+
8
+ - Allow nested settings to default to `Undefined` (fixes #158 via #161) (@emptyflask)
9
+
10
+
11
+ [Compare v1.0.1...v1.0.2](https://github.com/dry-rb/dry-configurable/compare/v1.0.1...v1.0.2)
12
+
13
+ ## 1.0.1 2022-11-16
14
+
15
+
16
+ ### Changed
17
+
18
+ - Renamed `@config` and `@_settings` internal instance variables to `@__config__` and `@__settings__` in order to avoid clashes with user-defined instance variables (#159 by @timriley)
19
+
20
+ [Compare v1.0.0...v1.0.1](https://github.com/dry-rb/dry-configurable/compare/v1.0.0...v1.0.1)
21
+
22
+ ## 1.0.0 2022-11-04
23
+
24
+
25
+ ### Changed
26
+
27
+ - Dependency on `dry-core` was updated to ~> 1.0 (@solnic)
28
+
29
+ [Compare v0.16.1...v1.0.0](https://github.com/dry-rb/dry-configurable/compare/v0.16.1...v1.0.0)
30
+
3
31
  ## 0.16.1 2022-10-13
4
32
 
5
33
 
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2015-2022 dry-rb team
3
+ Copyright (c) 2015-2023 dry-rb team
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of
6
6
  this software and associated documentation files (the "Software"), to deal in
data/README.md CHANGED
@@ -1,29 +1,21 @@
1
1
  <!--- this file is synced from dry-rb/template-gem project -->
2
2
  [gem]: https://rubygems.org/gems/dry-configurable
3
3
  [actions]: https://github.com/dry-rb/dry-configurable/actions
4
- [codacy]: https://www.codacy.com/gh/dry-rb/dry-configurable
5
- [chat]: https://dry-rb.zulipchat.com
6
- [inchpages]: http://inch-ci.org/github/dry-rb/dry-configurable
7
4
 
8
- # dry-configurable [![Join the chat at https://dry-rb.zulipchat.com](https://img.shields.io/badge/dry--rb-join%20chat-%23346b7a.svg)][chat]
9
-
10
- [![Gem Version](https://badge.fury.io/rb/dry-configurable.svg)][gem]
11
- [![CI Status](https://github.com/dry-rb/dry-configurable/workflows/ci/badge.svg)][actions]
12
- [![Codacy Badge](https://api.codacy.com/project/badge/Grade/0276a97990e04eb0ac722b3e7f3620b5)][codacy]
13
- [![Codacy Badge](https://api.codacy.com/project/badge/Coverage/0276a97990e04eb0ac722b3e7f3620b5)][codacy]
14
- [![Inline docs](http://inch-ci.org/github/dry-rb/dry-configurable.svg?branch=main)][inchpages]
5
+ # dry-configurable [![Gem Version](https://badge.fury.io/rb/dry-configurable.svg)][gem] [![CI Status](https://github.com/dry-rb/dry-configurable/workflows/ci/badge.svg)][actions]
15
6
 
16
7
  ## Links
17
8
 
18
9
  * [User documentation](https://dry-rb.org/gems/dry-configurable)
19
10
  * [API documentation](http://rubydoc.info/gems/dry-configurable)
11
+ * [Forum](https://discourse.dry-rb.org)
20
12
 
21
13
  ## Supported Ruby versions
22
14
 
23
15
  This library officially supports the following Ruby versions:
24
16
 
25
- * MRI `>= 2.7.0`
26
- * jruby `>= 9.3` (postponed until 2.7 is supported)
17
+ * MRI `>= 3.0.0`
18
+ * jruby `>= 9.4` (not tested on CI)
27
19
 
28
20
  ## License
29
21
 
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.metadata["source_code_uri"] = "https://github.com/dry-rb/dry-configurable"
27
27
  spec.metadata["bug_tracker_uri"] = "https://github.com/dry-rb/dry-configurable/issues"
28
28
 
29
- spec.required_ruby_version = ">= 2.7.0"
29
+ spec.required_ruby_version = ">= 3.0.0"
30
30
 
31
31
  # to update dependencies edit project.yml
32
32
  spec.add_runtime_dependency "dry-core", "~> 1.0", "< 2"
@@ -14,13 +14,13 @@ module Dry
14
14
  subclass.instance_variable_set(:@__config_extension__, __config_extension__)
15
15
 
16
16
  new_settings = settings.dup
17
- subclass.instance_variable_set(:@_settings, new_settings)
17
+ subclass.instance_variable_set(:@__settings__, new_settings)
18
18
 
19
19
  # Only classes **extending** Dry::Configurable have class-level config. When
20
20
  # Dry::Configurable is **included**, the class-level config method is undefined because it
21
21
  # resides at the instance-level instead (see `Configurable.included`).
22
22
  if respond_to?(:config)
23
- subclass.instance_variable_set(:@config, config.dup_for_settings(new_settings))
23
+ subclass.instance_variable_set(:@__config__, config.dup_for_settings(new_settings))
24
24
  end
25
25
  end
26
26
 
@@ -56,7 +56,7 @@ module Dry
56
56
  #
57
57
  # @api public
58
58
  def settings
59
- @_settings ||= Settings.new
59
+ @__settings__ ||= Settings.new
60
60
  end
61
61
 
62
62
  # Return configuration
@@ -65,7 +65,7 @@ module Dry
65
65
  #
66
66
  # @api public
67
67
  def config
68
- @config ||= __config_build__
68
+ @__config__ ||= __config_build__
69
69
  end
70
70
 
71
71
  # @api private
@@ -6,7 +6,7 @@ module Dry
6
6
  #
7
7
  # @api private
8
8
  class DSL
9
- VALID_NAME = /\A[a-z_]\w*\z/i.freeze
9
+ VALID_NAME = /\A[a-z_]\w*\z/i
10
10
 
11
11
  attr_reader :compiler
12
12
 
@@ -38,7 +38,7 @@ module Dry
38
38
  node = [:setting, [name.to_sym, options]]
39
39
 
40
40
  if block
41
- ast << [:nested, [node, DSL.new(&block).ast]]
41
+ ast << [:nested, [node, DSL.new(**@options, &block).ast]]
42
42
  else
43
43
  ast << node
44
44
  end
@@ -12,7 +12,7 @@ module Dry
12
12
  module Initializer
13
13
  # @api private
14
14
  def initialize(*)
15
- @config = self.class.__config_build__(self.class.settings)
15
+ @__config__ = self.class.__config_build__(self.class.settings)
16
16
 
17
17
  super
18
18
  end
@@ -30,7 +30,9 @@ module Dry
30
30
  # @return [Config]
31
31
  #
32
32
  # @api public
33
- attr_reader :config
33
+ def config
34
+ @__config__
35
+ end
34
36
 
35
37
  # Finalize the config and freeze the object
36
38
  #
@@ -45,7 +47,7 @@ module Dry
45
47
  # @api public
46
48
  def initialize_copy(source)
47
49
  super
48
- @config = source.config.dup
50
+ @__config__ = source.config.dup
49
51
  end
50
52
  end
51
53
  end
@@ -10,7 +10,7 @@ module Dry
10
10
  #
11
11
  # @api public
12
12
  def reset_config
13
- @config = config.pristine
13
+ @__config__ = config.pristine
14
14
  end
15
15
  end
16
16
 
@@ -3,6 +3,6 @@
3
3
  module Dry
4
4
  module Configurable
5
5
  # @api public
6
- VERSION = "1.0.0"
6
+ VERSION = "1.1.0"
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dry-configurable
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Holland
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-04 00:00:00.000000000 Z
11
+ date: 2023-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-core
@@ -128,14 +128,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - ">="
130
130
  - !ruby/object:Gem::Version
131
- version: 2.7.0
131
+ version: 3.0.0
132
132
  required_rubygems_version: !ruby/object:Gem::Requirement
133
133
  requirements:
134
134
  - - ">="
135
135
  - !ruby/object:Gem::Version
136
136
  version: '0'
137
137
  requirements: []
138
- rubygems_version: 3.1.6
138
+ rubygems_version: 3.3.26
139
139
  signing_key:
140
140
  specification_version: 4
141
141
  summary: A mixin to add configuration functionality to your classes