dry-system-rails 0.2.0 → 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 +4 -4
- data/.travis.yml +1 -2
- data/CHANGELOG.md +10 -0
- data/README.md +4 -3
- data/dry-system-rails.gemspec +2 -1
- data/lib/dry/system/rails.rb +8 -6
- data/lib/dry/system/rails/version.rb +1 -1
- data/spec/dummy/config/initializers/container.rb +2 -0
- data/spec/integration/container/using_plugins_spec.rb +5 -0
- metadata +8 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e94b8a96ce984b5582bc41385cf819bf608a5001cc410e87cfe9fcf91699379
|
4
|
+
data.tar.gz: 6ef6f4145d23e5d4b66f00fb51e40eae586c43a0aa6020c2e4c329959fe63dca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a9dd12714f79ad6ebbbd180f7022c6a4758cc14ebd2415b73b676e7e99e185dc743f0c5ad21da285a77cb64822ccc71a95af93466f8b1b5a444a8ecbadfa59e
|
7
|
+
data.tar.gz: d32adcc4fb9d57a84884abeb25649068bfddbf763b198f270a486b04258e02f93102b3562bedadb4c667cf03fafeecfa3ba160295d0980f156e49d67b114f1a8
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
# v0.3.0 2019-09-29
|
2
|
+
|
3
|
+
### Changed
|
4
|
+
|
5
|
+
- Depend on dry-system 0.12.x (arielvalentin)
|
6
|
+
- Drop support for Ruby versions earlier than 2.4 (arielvalentin)
|
7
|
+
- Evaluate user-supplied `Dry::System::Rails.container { ... }` block before applying any standard behaviour (which includes accessing the container's config). This change makes it possible for the user to adjust the container's dry-configurable-provided settings, e.g. through using dry-system plugins that add their own settings (timriley)
|
8
|
+
|
9
|
+
[Compare v0.2.0...v0.3.0](https://github.com/dry-rb/dry-system/compare/v0.2.0...v0.3.0)
|
10
|
+
|
1
11
|
# v0.2.0 2019-04-16
|
2
12
|
|
3
13
|
### Added
|
data/README.md
CHANGED
@@ -24,7 +24,7 @@ gem 'dry-system-rails'
|
|
24
24
|
|
25
25
|
## Usage
|
26
26
|
|
27
|
-
To configure auto-registration create `config/
|
27
|
+
To configure auto-registration create `config/initializers/system.rb` with the following content:
|
28
28
|
|
29
29
|
``` ruby
|
30
30
|
Dry::System::Rails.container do
|
@@ -65,8 +65,9 @@ The Rails API is designed around the usage of class methods. If you choose to wr
|
|
65
65
|
E.g. You have an object `CreateWidget` that needs to process widgets asynchronously with an `Widgets:NotificationJob` but you want to leverage dependency injection to decouple the components:
|
66
66
|
|
67
67
|
```ruby
|
68
|
-
# config/
|
69
|
-
Dry::System::Rails.
|
68
|
+
# config/initializers/system.rb
|
69
|
+
Dry::System::Rails.container do
|
70
|
+
# changes `self` to the container
|
70
71
|
config.auto_register << 'lib'
|
71
72
|
end
|
72
73
|
|
data/dry-system-rails.gemspec
CHANGED
@@ -16,8 +16,9 @@ Gem::Specification.new do |spec|
|
|
16
16
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
17
17
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
18
|
spec.require_paths = ['lib']
|
19
|
+
spec.required_ruby_version = '~> 2.4'
|
19
20
|
|
20
|
-
spec.add_runtime_dependency 'dry-system', '~> 0.
|
21
|
+
spec.add_runtime_dependency 'dry-system', '~> 0.12'
|
21
22
|
|
22
23
|
spec.add_development_dependency 'bundler'
|
23
24
|
spec.add_development_dependency 'rake'
|
data/lib/dry/system/rails.rb
CHANGED
@@ -32,16 +32,18 @@ module Dry
|
|
32
32
|
#
|
33
33
|
# @api private
|
34
34
|
def self.create_container(options = {})
|
35
|
-
container = Class.new(Container)
|
36
|
-
|
37
|
-
|
38
|
-
|
35
|
+
container = Class.new(Container)
|
36
|
+
|
37
|
+
container.class_eval(&@container_block) if container_block
|
38
|
+
|
39
|
+
default_options = {
|
40
|
+
root: ::Rails.root,
|
41
|
+
system_dir: ::Rails.root.join('config/system'),
|
39
42
|
}
|
43
|
+
container.config.update(default_options.merge(options))
|
40
44
|
|
41
45
|
container.load_paths!('lib', 'app', 'app/models')
|
42
46
|
|
43
|
-
container.class_eval(&@container_block) if container_block
|
44
|
-
|
45
47
|
container
|
46
48
|
end
|
47
49
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dry-system-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.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: 2019-
|
11
|
+
date: 2019-09-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-system
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.12'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0.
|
26
|
+
version: '0.12'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -119,6 +119,7 @@ files:
|
|
119
119
|
- spec/dummy/config/system/boot/persistence.rb
|
120
120
|
- spec/dummy/lib/mailer.rb
|
121
121
|
- spec/dummy/log/.keep
|
122
|
+
- spec/integration/container/using_plugins_spec.rb
|
122
123
|
- spec/integration/container_spec.rb
|
123
124
|
- spec/integration/environments_spec.rb
|
124
125
|
- spec/integration/models/user_repo_spec.rb
|
@@ -134,9 +135,9 @@ require_paths:
|
|
134
135
|
- lib
|
135
136
|
required_ruby_version: !ruby/object:Gem::Requirement
|
136
137
|
requirements:
|
137
|
-
- - "
|
138
|
+
- - "~>"
|
138
139
|
- !ruby/object:Gem::Version
|
139
|
-
version: '
|
140
|
+
version: '2.4'
|
140
141
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
141
142
|
requirements:
|
142
143
|
- - ">="
|
@@ -177,6 +178,7 @@ test_files:
|
|
177
178
|
- spec/dummy/config/system/boot/persistence.rb
|
178
179
|
- spec/dummy/lib/mailer.rb
|
179
180
|
- spec/dummy/log/.keep
|
181
|
+
- spec/integration/container/using_plugins_spec.rb
|
180
182
|
- spec/integration/container_spec.rb
|
181
183
|
- spec/integration/environments_spec.rb
|
182
184
|
- spec/integration/models/user_repo_spec.rb
|