Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package rubygem-dry-configurable for
openSUSE:Factory checked in at 2022-08-09 15:26:26
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-dry-configurable (Old)
and /work/SRC/openSUSE:Factory/.rubygem-dry-configurable.new.1521 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-dry-configurable"
Tue Aug 9 15:26:26 2022 rev:5 rq:993474 version:0.15.0
Changes:
--------
---
/work/SRC/openSUSE:Factory/rubygem-dry-configurable/rubygem-dry-configurable.changes
2022-02-07 23:38:36.358232784 +0100
+++
/work/SRC/openSUSE:Factory/.rubygem-dry-configurable.new.1521/rubygem-dry-configurable.changes
2022-08-09 15:26:35.461323227 +0200
@@ -1,0 +2,41 @@
+Thu Aug 4 13:07:48 UTC 2022 - Stephan Kulow <[email protected]>
+
+updated to version 0.15.0
+ see installed CHANGELOG.md
+
+ ## 0.15.0 2022-04-21
+
+
+ ### Changed
+
+ - The `finalize!` method (as class or instance method, depending on whether
you extend or include `Dry::Configurable` respectively) now accepts a boolean
`freeze_values:` argument, which if true, will recursively freeze all config
values in addition to the `config` itself. (#105 by @ojab)
+
+ ```ruby
+ class MyConfigurable
+ include Dry::Configurable
+
+ setting :db, default: "postgre"
+ end
+
+ my_obj = MyConfigurable.new
+ my_obj.finalize!(freeze_values: true)
+ my_obj.config.db << "sql" # Will raise FrozenError
+ ```
+ - `Dry::Configurable::Config#update` will set hashes as values for
non-nested settings (#131 by @ojab)
+
+ ```ruby
+ class MyConfigurable
+ extend Dry::Configurable
+
+ setting :sslcert, constructor: ->(v) { v&.values_at(:pem, :pass)&.join }
+ end
+
+ MyConfigurable.config.update(sslcert: {pem: "cert", pass: "qwerty"})
+ MyConfigurable.config.sslcert # => "certqwerty"
+ ```
+ - `Dry::Configurable::Config#update` will accept any values implicitly
convertible to hash via `#to_hash` (#133 by @timriley)
+
+ [Compare
v0.14.0...v0.15.0](https://github.com/dry-rb/dry-configurable/compare/v0.14.0...v0.15.0)
+
+
+-------------------------------------------------------------------
Old:
----
dry-configurable-0.14.0.gem
New:
----
dry-configurable-0.15.0.gem
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ rubygem-dry-configurable.spec ++++++
--- /var/tmp/diff_new_pack.DeNZsp/_old 2022-08-09 15:26:35.885324439 +0200
+++ /var/tmp/diff_new_pack.DeNZsp/_new 2022-08-09 15:26:35.893324461 +0200
@@ -24,7 +24,7 @@
#
Name: rubygem-dry-configurable
-Version: 0.14.0
+Version: 0.15.0
Release: 0
%define mod_name dry-configurable
%define mod_full_name %{mod_name}-%{version}
++++++ dry-configurable-0.14.0.gem -> dry-configurable-0.15.0.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/CHANGELOG.md new/CHANGELOG.md
--- old/CHANGELOG.md 2022-01-14 01:14:31.000000000 +0100
+++ new/CHANGELOG.md 2022-04-21 09:30:01.000000000 +0200
@@ -1,5 +1,39 @@
<!--- DO NOT EDIT THIS FILE - IT'S AUTOMATICALLY GENERATED VIA DEVTOOLS --->
+## 0.15.0 2022-04-21
+
+
+### Changed
+
+- The `finalize!` method (as class or instance method, depending on whether
you extend or include `Dry::Configurable` respectively) now accepts a boolean
`freeze_values:` argument, which if true, will recursively freeze all config
values in addition to the `config` itself. (#105 by @ojab)
+
+ ```ruby
+ class MyConfigurable
+ include Dry::Configurable
+
+ setting :db, default: "postgre"
+ end
+
+ my_obj = MyConfigurable.new
+ my_obj.finalize!(freeze_values: true)
+ my_obj.config.db << "sql" # Will raise FrozenError
+ ```
+- `Dry::Configurable::Config#update` will set hashes as values for non-nested
settings (#131 by @ojab)
+
+ ```ruby
+ class MyConfigurable
+ extend Dry::Configurable
+
+ setting :sslcert, constructor: ->(v) { v&.values_at(:pem, :pass)&.join }
+ end
+
+ MyConfigurable.config.update(sslcert: {pem: "cert", pass: "qwerty"})
+ MyConfigurable.config.sslcert # => "certqwerty"
+ ```
+- `Dry::Configurable::Config#update` will accept any values implicitly
convertible to hash via `#to_hash` (#133 by @timriley)
+
+[Compare
v0.14.0...v0.15.0](https://github.com/dry-rb/dry-configurable/compare/v0.14.0...v0.15.0)
+
## 0.14.0 2022-01-14
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/README.md new/README.md
--- old/README.md 2022-01-14 01:14:31.000000000 +0100
+++ new/README.md 2022-04-21 09:30:01.000000000 +0200
@@ -11,7 +11,7 @@
[][actions]
[][codacy]
[][codacy]
-[][inchpages]
+[][inchpages]
## Links
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/dry-configurable.gemspec new/dry-configurable.gemspec
--- old/dry-configurable.gemspec 2022-01-14 01:14:31.000000000 +0100
+++ new/dry-configurable.gemspec 2022-04-21 09:30:01.000000000 +0200
@@ -22,7 +22,7 @@
spec.require_paths = ["lib"]
spec.metadata["allowed_push_host"] = "https://rubygems.org"
- spec.metadata["changelog_uri"] =
"https://github.com/dry-rb/dry-configurable/blob/master/CHANGELOG.md"
+ spec.metadata["changelog_uri"] =
"https://github.com/dry-rb/dry-configurable/blob/main/CHANGELOG.md"
spec.metadata["source_code_uri"] =
"https://github.com/dry-rb/dry-configurable"
spec.metadata["bug_tracker_uri"] =
"https://github.com/dry-rb/dry-configurable/issues"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/dry/configurable/config.rb
new/lib/dry/configurable/config.rb
--- old/lib/dry/configurable/config.rb 2022-01-14 01:14:31.000000000 +0100
+++ new/lib/dry/configurable/config.rb 2022-04-21 09:30:01.000000000 +0200
@@ -50,16 +50,19 @@
# Update config with new values
#
- # @param values [Hash] A hash with new values
+ # @param values [Hash, #to_hash] A hash with new values
#
# @return [Config]
#
# @api public
def update(values)
values.each do |key, value|
- case value
- when Hash
- self[key].update(value)
+ if self[key].is_a?(self.class)
+ unless value.respond_to?(:to_hash)
+ raise ArgumentError, "#{value.inspect} is not a valid setting
value"
+ end
+
+ self[key].update(value.to_hash)
else
self[key] = value
end
@@ -81,8 +84,8 @@
alias_method :to_h, :values
# @api private
- def finalize!
- _settings.freeze
+ def finalize!(freeze_values: false)
+ _settings.finalize!(freeze_values: freeze_values)
freeze
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/dry/configurable/instance_methods.rb
new/lib/dry/configurable/instance_methods.rb
--- old/lib/dry/configurable/instance_methods.rb 2022-01-14
01:14:31.000000000 +0100
+++ new/lib/dry/configurable/instance_methods.rb 2022-04-21
09:30:01.000000000 +0200
@@ -38,9 +38,7 @@
# Finalize the config and freeze the object
#
# @api public
- def finalize!
- return self if frozen?
-
+ def finalize!(freeze_values: false)
super
freeze
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/dry/configurable/methods.rb
new/lib/dry/configurable/methods.rb
--- old/lib/dry/configurable/methods.rb 2022-01-14 01:14:31.000000000 +0100
+++ new/lib/dry/configurable/methods.rb 2022-04-21 09:30:01.000000000 +0200
@@ -21,10 +21,8 @@
# @return [Dry::Configurable::Config]
#
# @api public
- def finalize!
- return self if config.frozen?
-
- config.finalize!
+ def finalize!(freeze_values: false)
+ config.finalize!(freeze_values: freeze_values)
self
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/dry/configurable/setting.rb
new/lib/dry/configurable/setting.rb
--- old/lib/dry/configurable/setting.rb 2022-01-14 01:14:31.000000000 +0100
+++ new/lib/dry/configurable/setting.rb 2022-04-21 09:30:01.000000000 +0200
@@ -84,8 +84,12 @@
# @api private
def value
- @value ||= evaluate
+ return @value if evaluated?
+
+ @value = constructor[Undefined.coalesce(input, default, nil)]
end
+ alias_method :evaluate, :value
+ private :evaluate
# @api private
def evaluated?
@@ -103,6 +107,16 @@
end
# @api private
+ def finalize!(freeze_values: false)
+ if value.is_a?(Config)
+ value.finalize!(freeze_values: freeze_values)
+ elsif freeze_values
+ value.freeze
+ end
+ freeze
+ end
+
+ # @api private
def with(new_opts)
self.class.new(name, input: input, default: default, **options,
**new_opts)
end
@@ -149,11 +163,6 @@
@value = source.value.dup if source.evaluated?
end
end
-
- # @api private
- def evaluate
- @value = constructor[Undefined.coalesce(input, default, nil)]
- end
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/dry/configurable/settings.rb
new/lib/dry/configurable/settings.rb
--- old/lib/dry/configurable/settings.rb 2022-01-14 01:14:31.000000000
+0100
+++ new/lib/dry/configurable/settings.rb 2022-04-21 09:30:01.000000000
+0200
@@ -54,6 +54,12 @@
self.class.new(map(&:pristine))
end
+ # @api private
+ def finalize!(freeze_values: false)
+ each { |element| element.finalize!(freeze_values: freeze_values) }
+ freeze
+ end
+
private
# @api private
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/dry/configurable/version.rb
new/lib/dry/configurable/version.rb
--- old/lib/dry/configurable/version.rb 2022-01-14 01:14:31.000000000 +0100
+++ new/lib/dry/configurable/version.rb 2022-04-21 09:30:01.000000000 +0200
@@ -3,6 +3,6 @@
module Dry
module Configurable
# @api public
- VERSION = "0.14.0"
+ VERSION = "0.15.0"
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata 2022-01-14 01:14:31.000000000 +0100
+++ new/metadata 2022-04-21 09:30:01.000000000 +0200
@@ -1,14 +1,14 @@
--- !ruby/object:Gem::Specification
name: dry-configurable
version: !ruby/object:Gem::Version
- version: 0.14.0
+ version: 0.15.0
platform: ruby
authors:
- Andy Holland
autorequire:
bindir: bin
cert_chain: []
-date: 2022-01-14 00:00:00.000000000 Z
+date: 2022-04-21 00:00:00.000000000 Z
dependencies:
- !ruby/object:Gem::Dependency
name: concurrent-ruby
@@ -111,7 +111,7 @@
- MIT
metadata:
allowed_push_host: https://rubygems.org
- changelog_uri:
https://github.com/dry-rb/dry-configurable/blob/master/CHANGELOG.md
+ changelog_uri:
https://github.com/dry-rb/dry-configurable/blob/main/CHANGELOG.md
source_code_uri: https://github.com/dry-rb/dry-configurable
bug_tracker_uri: https://github.com/dry-rb/dry-configurable/issues
post_install_message: