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-10-30 18:28:46
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-dry-configurable (Old)
and /work/SRC/openSUSE:Factory/.rubygem-dry-configurable.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-dry-configurable"
Sun Oct 30 18:28:46 2022 rev:7 rq:1032136 version:0.16.1
Changes:
--------
---
/work/SRC/openSUSE:Factory/rubygem-dry-configurable/rubygem-dry-configurable.changes
2022-10-12 18:26:53.757981019 +0200
+++
/work/SRC/openSUSE:Factory/.rubygem-dry-configurable.new.2275/rubygem-dry-configurable.changes
2022-10-30 18:28:54.338406970 +0100
@@ -1,0 +2,15 @@
+Fri Oct 28 04:55:07 UTC 2022 - Stephan Kulow <[email protected]>
+
+updated to version 0.16.1
+ see installed CHANGELOG.md
+
+ ## 0.16.1 2022-10-13
+
+ ### Changed
+
+ - Restored performance of config value reads (direct reader methods as well
as aggregate methods like `#values` and `#to_h`) to pre-0.16.0 levels (#149 by
@timriley)
+
+ [Compare
v0.16.0...v0.16.1](https://github.com/dry-rb/dry-configurable/compare/v0.16.0...v0.16.1)
+
+
+-------------------------------------------------------------------
Old:
----
dry-configurable-0.16.0.gem
New:
----
dry-configurable-0.16.1.gem
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ rubygem-dry-configurable.spec ++++++
--- /var/tmp/diff_new_pack.juxtPh/_old 2022-10-30 18:28:54.794409434 +0100
+++ /var/tmp/diff_new_pack.juxtPh/_new 2022-10-30 18:28:54.798409455 +0100
@@ -24,7 +24,7 @@
#
Name: rubygem-dry-configurable
-Version: 0.16.0
+Version: 0.16.1
Release: 0
%define mod_name dry-configurable
%define mod_full_name %{mod_name}-%{version}
++++++ dry-configurable-0.16.0.gem -> dry-configurable-0.16.1.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/CHANGELOG.md new/CHANGELOG.md
--- old/CHANGELOG.md 2022-10-08 01:24:53.000000000 +0200
+++ new/CHANGELOG.md 2022-10-12 21:54:12.000000000 +0200
@@ -1,5 +1,13 @@
<!--- DO NOT EDIT THIS FILE - IT'S AUTOMATICALLY GENERATED VIA DEVTOOLS --->
+## 0.16.1 2022-10-13
+
+### Changed
+
+- Restored performance of config value reads (direct reader methods as well as
aggregate methods like `#values` and `#to_h`) to pre-0.16.0 levels (#149 by
@timriley)
+
+[Compare
v0.16.0...v0.16.1](https://github.com/dry-rb/dry-configurable/compare/v0.16.0...v0.16.1)
+
## 0.16.0 2022-10-08
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
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-10-08 01:24:53.000000000 +0200
+++ new/lib/dry/configurable/config.rb 2022-10-12 21:54:12.000000000 +0200
@@ -1,6 +1,7 @@
# frozen_string_literal: true
require "dry/core/constants"
+require "set"
require "dry/core/equalizer"
@@ -19,14 +20,26 @@
attr_reader :_values
# @api private
+ attr_reader :_configured
+ protected :_configured
+
+ # @api private
def initialize(settings, values: {})
@_settings = settings
@_values = values
+ @_configured = Set.new
+ end
+
+ # @api private
+ private def initialize_copy(source)
+ super
+ @_values = source.__send__(:dup_values)
+ @_configured = source._configured.dup
end
# @api private
def dup_for_settings(settings)
- self.class.new(settings, values: dup_values)
+ dup.tap { |config| config.instance_variable_set(:@_settings, settings)
}
end
# Get config value by a key
@@ -42,10 +55,11 @@
end
_values.fetch(name) {
- # When reading values, only capture cloneable (i.e. mutable) values
in local state, making
- # it easier to determine which values have actually been changed vs
just read
+ # Mutable settings may be configured after read
+ _configured.add(name) if setting.cloneable?
+
setting.to_value.tap { |value|
- _values[name] = value if setting.cloneable?
+ _values[name] = value
}
}
end
@@ -64,6 +78,8 @@
raise ArgumentError, "+#{name}+ is not a setting name"
end
+ _configured.add(name)
+
_values[name] = setting.constructor.(value)
end
@@ -101,11 +117,11 @@
#
# @api public
def configured?(key)
- if _settings[key].cloneable? && _values.key?(key)
+ if _configured.include?(key) && _settings[key].cloneable?
return _values[key] != _settings[key].to_value
end
- _values.key?(key)
+ _configured.include?(key)
end
# Returns the current config values.
@@ -116,7 +132,10 @@
#
# @api public
def values
- _settings.to_h { |setting| [setting.name, self[setting.name]] }
+ # Ensure all settings are represented in values
+ _settings.each { |setting| self[setting.name] unless
_values.key?(setting.name) }
+
+ _values
end
# Returns config values as a hash, with nested values also converted
from {Config} instances
@@ -175,11 +194,6 @@
dup_hsh[key] = _settings[key].cloneable? ? val.dup : val
}
end
-
- def initialize_copy(source)
- super
- @_values = source.__send__(:dup_values)
- end
end
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-10-08 01:24:53.000000000 +0200
+++ new/lib/dry/configurable/setting.rb 2022-10-12 21:54:12.000000000 +0200
@@ -25,6 +25,9 @@
attr_reader :default
# @api private
+ attr_reader :cloneable
+
+ # @api private
attr_reader :constructor
# @api private
@@ -48,6 +51,9 @@
)
@name = name
@default = default
+ @cloneable = children.any? || options.fetch(:cloneable) {
+ Setting.cloneable_value?(default)
+ }
@constructor = constructor
@children = children
@options = options
@@ -60,7 +66,7 @@
# @api private
def cloneable?
- children.any? || options.fetch(:cloneable) {
Setting.cloneable_value?(default) }
+ cloneable
end
# @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-10-08 01:24:53.000000000 +0200
+++ new/lib/dry/configurable/version.rb 2022-10-12 21:54:12.000000000 +0200
@@ -3,6 +3,6 @@
module Dry
module Configurable
# @api public
- VERSION = "0.16.0"
+ VERSION = "0.16.1"
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata 2022-10-08 01:24:53.000000000 +0200
+++ new/metadata 2022-10-12 21:54:12.000000000 +0200
@@ -1,14 +1,14 @@
--- !ruby/object:Gem::Specification
name: dry-configurable
version: !ruby/object:Gem::Version
- version: 0.16.0
+ version: 0.16.1
platform: ruby
authors:
- Andy Holland
-autorequire:
+autorequire:
bindir: bin
cert_chain: []
-date: 2022-10-07 00:00:00.000000000 Z
+date: 2022-10-12 00:00:00.000000000 Z
dependencies:
- !ruby/object:Gem::Dependency
name: dry-core
@@ -114,7 +114,7 @@
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:
+post_install_message:
rdoc_options: []
require_paths:
- lib
@@ -129,8 +129,8 @@
- !ruby/object:Gem::Version
version: '0'
requirements: []
-rubygems_version: 3.3.7
-signing_key:
+rubygems_version: 3.1.6
+signing_key:
specification_version: 4
summary: A mixin to add configuration functionality to your classes
test_files: []