dry-system 0.19.2 → 0.20.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +25 -1
- data/README.md +5 -4
- data/dry-system.gemspec +16 -15
- data/lib/dry/system/config/component_dir.rb +4 -4
- data/lib/dry/system/container.rb +14 -14
- data/lib/dry/system/identifier.rb +2 -1
- data/lib/dry/system/loader.rb +1 -1
- data/lib/dry/system/plugins/bootsnap.rb +1 -1
- data/lib/dry/system/plugins/dependency_graph.rb +4 -4
- data/lib/dry/system/plugins/env.rb +1 -1
- data/lib/dry/system/plugins/logging.rb +7 -3
- data/lib/dry/system/stubs.rb +1 -1
- data/lib/dry/system/version.rb +1 -1
- metadata +11 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed86f20c6700f29644fe61cc3bd215f50b93177963eb67076523cbf295f18051
|
4
|
+
data.tar.gz: b7ec3d205804cc17033450f7585c809f6a9942ea89fea906799cb02c94e2b64b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b422ce21011d20c5fedd6eab5cae91c0f03e7ee42d2f7e279b915fbba6826477bfa3393933f4e56417a6f284a2782f56ec184843cae8364a69e1073199d70c05
|
7
|
+
data.tar.gz: f2ded5f38dd0fffc72f6262f0c844b430e26f5b411ffd576284c02ec379bbd4b0638c83cae4070d283891f99376b1a6c5700fe453ba938ae4ef17e26cdbf47c5
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,20 @@
|
|
1
1
|
<!--- DO NOT EDIT THIS FILE - IT'S AUTOMATICALLY GENERATED VIA DEVTOOLS --->
|
2
2
|
|
3
|
+
## 0.20.0 2021-09-12
|
4
|
+
|
5
|
+
|
6
|
+
### Fixed
|
7
|
+
|
8
|
+
- Fixed dependency graph plugin to work with internal changes introduced in 0.19.0 (@wuarmin in #173)
|
9
|
+
- Fixed behavior of `Dry::System::Identifier#start_with?` for components identified by a single segment, or if all matching segments are provided (@wuarmin in #177)
|
10
|
+
- Fixed compatibility of `finalize!` signature provided in `Container::Stubs` (@mpokrywka in #178)
|
11
|
+
|
12
|
+
### Changed
|
13
|
+
|
14
|
+
- [internal] Upgraded to new `setting` API provided in dry-configurable 0.13.0 (@timriley in #179)
|
15
|
+
|
16
|
+
[Compare v0.19.2...v0.20.0](https://github.com/dry-rb/dry-system/compare/v0.19.2...v0.20.0)
|
17
|
+
|
3
18
|
## 0.19.2 2021-08-30
|
4
19
|
|
5
20
|
|
@@ -7,7 +22,16 @@
|
|
7
22
|
|
8
23
|
- [internal] Improved compatibility with upcoming dry-configurable 0.13.0 release (@timriley in #186)
|
9
24
|
|
10
|
-
[Compare v0.
|
25
|
+
[Compare v0.18.2...v0.19.2](https://github.com/dry-rb/dry-system/compare/v0.18.2...v0.19.2)
|
26
|
+
|
27
|
+
## 0.18.2 2021-08-30
|
28
|
+
|
29
|
+
|
30
|
+
### Changed
|
31
|
+
|
32
|
+
- [internal] Improved compatibility with upcoming dry-configurable 0.13.0 release (@timriley in #187)
|
33
|
+
|
34
|
+
[Compare v0.19.1...v0.18.2](https://github.com/dry-rb/dry-system/compare/v0.19.1...v0.18.2)
|
11
35
|
|
12
36
|
## 0.19.1 2021-07-11
|
13
37
|
|
data/README.md
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
<!--- this file is synced from dry-rb/template-gem project -->
|
1
2
|
[gem]: https://rubygems.org/gems/dry-system
|
2
3
|
[actions]: https://github.com/dry-rb/dry-system/actions
|
3
4
|
[codacy]: https://www.codacy.com/gh/dry-rb/dry-system
|
@@ -7,22 +8,22 @@
|
|
7
8
|
# dry-system [![Join the chat at https://dry-rb.zulipchat.com](https://img.shields.io/badge/dry--rb-join%20chat-%23346b7a.svg)][chat]
|
8
9
|
|
9
10
|
[![Gem Version](https://badge.fury.io/rb/dry-system.svg)][gem]
|
10
|
-
[![CI Status](https://github.com/dry-rb/dry-system/workflows/
|
11
|
+
[![CI Status](https://github.com/dry-rb/dry-system/workflows/CI/badge.svg)][actions]
|
11
12
|
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/3a0e30d0ae2542c7ba047ba5f923c0bb)][codacy]
|
12
13
|
[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/3a0e30d0ae2542c7ba047ba5f923c0bb)][codacy]
|
13
14
|
[![Inline docs](http://inch-ci.org/github/dry-rb/dry-system.svg?branch=master)][inchpages]
|
14
15
|
|
15
16
|
## Links
|
16
17
|
|
17
|
-
* [User documentation](
|
18
|
+
* [User documentation](https://dry-rb.org/gems/dry-system)
|
18
19
|
* [API documentation](http://rubydoc.info/gems/dry-system)
|
19
20
|
|
20
21
|
## Supported Ruby versions
|
21
22
|
|
22
23
|
This library officially supports the following Ruby versions:
|
23
24
|
|
24
|
-
* MRI
|
25
|
-
* jruby
|
25
|
+
* MRI `>= 2.6.0`
|
26
|
+
* ~~jruby~~ `>= 9.3` (we are waiting for [2.6 support](https://github.com/jruby/jruby/issues/6161))
|
26
27
|
|
27
28
|
## License
|
28
29
|
|
data/dry-system.gemspec
CHANGED
@@ -1,37 +1,38 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
# this file is managed by dry-rb/devtools project
|
3
2
|
|
4
|
-
|
3
|
+
# this file is synced from dry-rb/template-gem project
|
4
|
+
|
5
|
+
lib = File.expand_path("lib", __dir__)
|
5
6
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
6
|
-
require
|
7
|
+
require "dry/system/version"
|
7
8
|
|
8
9
|
Gem::Specification.new do |spec|
|
9
|
-
spec.name =
|
10
|
+
spec.name = "dry-system"
|
10
11
|
spec.authors = ["Piotr Solnica"]
|
11
12
|
spec.email = ["piotr.solnica@gmail.com"]
|
12
|
-
spec.license =
|
13
|
+
spec.license = "MIT"
|
13
14
|
spec.version = Dry::System::VERSION.dup
|
14
15
|
|
15
16
|
spec.summary = "Organize your code into reusable components"
|
16
17
|
spec.description = spec.summary
|
17
|
-
spec.homepage =
|
18
|
+
spec.homepage = "https://dry-rb.org/gems/dry-system"
|
18
19
|
spec.files = Dir["CHANGELOG.md", "LICENSE", "README.md", "dry-system.gemspec", "lib/**/*"]
|
19
|
-
spec.bindir =
|
20
|
+
spec.bindir = "bin"
|
20
21
|
spec.executables = []
|
21
|
-
spec.require_paths = [
|
22
|
+
spec.require_paths = ["lib"]
|
22
23
|
|
23
|
-
spec.metadata[
|
24
|
-
spec.metadata[
|
25
|
-
spec.metadata[
|
26
|
-
spec.metadata[
|
24
|
+
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
25
|
+
spec.metadata["changelog_uri"] = "https://github.com/dry-rb/dry-system/blob/master/CHANGELOG.md"
|
26
|
+
spec.metadata["source_code_uri"] = "https://github.com/dry-rb/dry-system"
|
27
|
+
spec.metadata["bug_tracker_uri"] = "https://github.com/dry-rb/dry-system/issues"
|
27
28
|
|
28
|
-
spec.required_ruby_version = ">= 2.
|
29
|
+
spec.required_ruby_version = ">= 2.6.0"
|
29
30
|
|
30
31
|
# to update dependencies edit project.yml
|
31
32
|
spec.add_runtime_dependency "concurrent-ruby", "~> 1.0"
|
32
33
|
spec.add_runtime_dependency "dry-auto_inject", ">= 0.4.0"
|
33
|
-
spec.add_runtime_dependency "dry-configurable", "~> 0.
|
34
|
-
spec.add_runtime_dependency "dry-container", "~> 0.
|
34
|
+
spec.add_runtime_dependency "dry-configurable", "~> 0.13", ">= 0.13.0"
|
35
|
+
spec.add_runtime_dependency "dry-container", "~> 0.9", ">= 0.9.0"
|
35
36
|
spec.add_runtime_dependency "dry-core", "~> 0.5", ">= 0.5"
|
36
37
|
spec.add_runtime_dependency "dry-inflector", "~> 0.1", ">= 0.1.2"
|
37
38
|
spec.add_runtime_dependency "dry-struct", "~> 1.0"
|
@@ -40,7 +40,7 @@ module Dry
|
|
40
40
|
# @return [Boolean, Proc] the configured policy
|
41
41
|
#
|
42
42
|
# @see auto_register=
|
43
|
-
setting :auto_register, true
|
43
|
+
setting :auto_register, default: true
|
44
44
|
|
45
45
|
# @!method add_to_load_path=(policy)
|
46
46
|
#
|
@@ -63,7 +63,7 @@ module Dry
|
|
63
63
|
# @return [Boolean]
|
64
64
|
#
|
65
65
|
# @see add_to_load_path=
|
66
|
-
setting :add_to_load_path, true
|
66
|
+
setting :add_to_load_path, default: true
|
67
67
|
|
68
68
|
# @!method default_namespace=(leading_namespace)
|
69
69
|
#
|
@@ -117,7 +117,7 @@ module Dry
|
|
117
117
|
# @return [#call]
|
118
118
|
#
|
119
119
|
# @see loader=
|
120
|
-
setting :loader, Dry::System::Loader
|
120
|
+
setting :loader, default: Dry::System::Loader
|
121
121
|
|
122
122
|
# @!method memoize=(policy)
|
123
123
|
#
|
@@ -151,7 +151,7 @@ module Dry
|
|
151
151
|
# @return [Boolean, Proc] the configured memoization policy
|
152
152
|
#
|
153
153
|
# @see memoize=
|
154
|
-
setting :memoize, false
|
154
|
+
setting :memoize, default: false
|
155
155
|
|
156
156
|
# @!endgroup
|
157
157
|
|
data/lib/dry/system/container.rb
CHANGED
@@ -7,6 +7,7 @@ require "dry-configurable"
|
|
7
7
|
require "dry-container"
|
8
8
|
require "dry/inflector"
|
9
9
|
|
10
|
+
require "dry/core/constants"
|
10
11
|
require "dry/core/deprecations"
|
11
12
|
|
12
13
|
require "dry/system"
|
@@ -73,17 +74,17 @@ module Dry
|
|
73
74
|
extend Dry::System::Plugins
|
74
75
|
|
75
76
|
setting :name
|
76
|
-
setting
|
77
|
-
setting :system_dir, "system"
|
78
|
-
setting :bootable_dirs, ["system/boot"]
|
79
|
-
setting :registrations_dir, "container"
|
80
|
-
setting :component_dirs, Config::ComponentDirs.new, cloneable: true
|
81
|
-
setting :inflector, Dry::Inflector.new
|
82
|
-
setting :booter, Dry::System::Booter
|
83
|
-
setting :auto_registrar, Dry::System::AutoRegistrar
|
84
|
-
setting :manual_registrar, Dry::System::ManualRegistrar
|
85
|
-
setting :importer, Dry::System::Importer
|
86
|
-
setting
|
77
|
+
setting :root, default: Pathname.pwd.freeze, constructor: -> path { Pathname(path) }
|
78
|
+
setting :system_dir, default: "system"
|
79
|
+
setting :bootable_dirs, default: ["system/boot"]
|
80
|
+
setting :registrations_dir, default: "container"
|
81
|
+
setting :component_dirs, default: Config::ComponentDirs.new, cloneable: true
|
82
|
+
setting :inflector, default: Dry::Inflector.new
|
83
|
+
setting :booter, default: Dry::System::Booter
|
84
|
+
setting :auto_registrar, default: Dry::System::AutoRegistrar
|
85
|
+
setting :manual_registrar, default: Dry::System::ManualRegistrar
|
86
|
+
setting :importer, default: Dry::System::Importer
|
87
|
+
setting :components, default: {}, reader: true, constructor: :dup.to_proc
|
87
88
|
|
88
89
|
class << self
|
89
90
|
def strategies(value = nil)
|
@@ -101,13 +102,12 @@ module Dry
|
|
101
102
|
# @see https://dry-rb.org/gems/dry-configurable
|
102
103
|
#
|
103
104
|
# @api public
|
104
|
-
def setting(name,
|
105
|
-
super(name,
|
105
|
+
def setting(name, default = Dry::Core::Constants::Undefined, **options, &block)
|
106
|
+
super(name, default, **options, &block)
|
106
107
|
# TODO: dry-configurable needs a public API for this
|
107
108
|
config._settings << _settings[name]
|
108
109
|
self
|
109
110
|
end
|
110
|
-
ruby2_keywords(:setting) if respond_to?(:ruby2_keywords, true)
|
111
111
|
|
112
112
|
# Configures the container
|
113
113
|
#
|
@@ -99,7 +99,8 @@ module Dry
|
|
99
99
|
# @return [Boolean]
|
100
100
|
# @api public
|
101
101
|
def start_with?(leading_namespaces)
|
102
|
-
identifier.start_with?("#{leading_namespaces}#{separator}")
|
102
|
+
identifier.start_with?("#{leading_namespaces}#{separator}") ||
|
103
|
+
identifier.eql?(leading_namespaces)
|
103
104
|
end
|
104
105
|
|
105
106
|
# Returns a copy of the identifier with the given leading namespaces removed from
|
data/lib/dry/system/loader.rb
CHANGED
@@ -16,7 +16,7 @@ module Dry
|
|
16
16
|
def self.extended(system)
|
17
17
|
super
|
18
18
|
system.use(:env)
|
19
|
-
system.before(:configure) { setting :bootsnap, DEFAULT_OPTIONS }
|
19
|
+
system.before(:configure) { setting :bootsnap, default: DEFAULT_OPTIONS }
|
20
20
|
system.after(:configure, &:setup_bootsnap)
|
21
21
|
end
|
22
22
|
|
@@ -15,7 +15,7 @@ module Dry
|
|
15
15
|
system.use(:notifications)
|
16
16
|
|
17
17
|
system.before(:configure) do
|
18
|
-
setting :ignored_dependencies, []
|
18
|
+
setting :ignored_dependencies, default: []
|
19
19
|
end
|
20
20
|
|
21
21
|
system.after(:configure) do
|
@@ -34,10 +34,10 @@ module Dry
|
|
34
34
|
# @api private
|
35
35
|
def register(key, contents = nil, options = {}, &block)
|
36
36
|
super
|
37
|
-
|
38
|
-
unless config.ignored_dependencies.include?(
|
37
|
+
dependency_key = key.to_s
|
38
|
+
unless config.ignored_dependencies.include?(dependency_key)
|
39
39
|
self[:notifications].instrument(
|
40
|
-
:registered_dependency, key:
|
40
|
+
:registered_dependency, key: dependency_key, class: self[dependency_key].class
|
41
41
|
)
|
42
42
|
end
|
43
43
|
|
@@ -11,11 +11,15 @@ module Dry
|
|
11
11
|
system.before(:configure) do
|
12
12
|
setting :logger, reader: true
|
13
13
|
|
14
|
-
setting :log_dir, "log"
|
14
|
+
setting :log_dir, default: "log"
|
15
15
|
|
16
|
-
setting :log_levels,
|
16
|
+
setting :log_levels, default: {
|
17
|
+
development: Logger::DEBUG,
|
18
|
+
test: Logger::DEBUG,
|
19
|
+
production: Logger::ERROR
|
20
|
+
}
|
17
21
|
|
18
|
-
setting :logger_class, ::Logger, reader: true
|
22
|
+
setting :logger_class, default: ::Logger, reader: true
|
19
23
|
end
|
20
24
|
|
21
25
|
system.after(:configure, &:register_logger)
|
data/lib/dry/system/stubs.rb
CHANGED
data/lib/dry/system/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dry-system
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.20.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Solnica
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-09-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -44,40 +44,40 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0.
|
47
|
+
version: '0.13'
|
48
48
|
- - ">="
|
49
49
|
- !ruby/object:Gem::Version
|
50
|
-
version: 0.
|
50
|
+
version: 0.13.0
|
51
51
|
type: :runtime
|
52
52
|
prerelease: false
|
53
53
|
version_requirements: !ruby/object:Gem::Requirement
|
54
54
|
requirements:
|
55
55
|
- - "~>"
|
56
56
|
- !ruby/object:Gem::Version
|
57
|
-
version: '0.
|
57
|
+
version: '0.13'
|
58
58
|
- - ">="
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: 0.
|
60
|
+
version: 0.13.0
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: dry-container
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
65
|
- - "~>"
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: '0.
|
67
|
+
version: '0.9'
|
68
68
|
- - ">="
|
69
69
|
- !ruby/object:Gem::Version
|
70
|
-
version: 0.
|
70
|
+
version: 0.9.0
|
71
71
|
type: :runtime
|
72
72
|
prerelease: false
|
73
73
|
version_requirements: !ruby/object:Gem::Requirement
|
74
74
|
requirements:
|
75
75
|
- - "~>"
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
version: '0.
|
77
|
+
version: '0.9'
|
78
78
|
- - ">="
|
79
79
|
- !ruby/object:Gem::Version
|
80
|
-
version: 0.
|
80
|
+
version: 0.9.0
|
81
81
|
- !ruby/object:Gem::Dependency
|
82
82
|
name: dry-core
|
83
83
|
requirement: !ruby/object:Gem::Requirement
|
@@ -240,7 +240,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
240
240
|
requirements:
|
241
241
|
- - ">="
|
242
242
|
- !ruby/object:Gem::Version
|
243
|
-
version: 2.
|
243
|
+
version: 2.6.0
|
244
244
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
245
245
|
requirements:
|
246
246
|
- - ">="
|