dry-auto_inject 0.9.0 → 1.0.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 +10 -0
- data/LICENSE +1 -1
- data/README.md +1 -1
- data/dry-auto_inject.gemspec +3 -2
- data/lib/dry/auto_inject/builder.rb +0 -3
- data/lib/dry/auto_inject/strategies/args.rb +0 -5
- data/lib/dry/auto_inject/strategies/constructor.rb +3 -5
- data/lib/dry/auto_inject/strategies/hash.rb +0 -5
- data/lib/dry/auto_inject/strategies/kwargs.rb +0 -5
- data/lib/dry/auto_inject/strategies.rb +5 -7
- data/lib/dry/auto_inject/version.rb +1 -1
- data/lib/dry/auto_inject.rb +20 -2
- metadata +28 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d360da0539f06319e2e74cd1d24dc8b5cf946a0390f0257e41e4d8f6dbf91540
|
4
|
+
data.tar.gz: 5d095923d9dfd059a58b91af09c7afe7047ed69b7c8f3dee3f6055073da7d0ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eeacadf98f186011fd02faa49b353a290158cbb815b1b4bf6b9f41154fa0041dc08c4c4cf6e903ef8ca2b8c99467aecc02c2b3f3fcb3cdb4b9683ad90d72808f
|
7
|
+
data.tar.gz: d3370290dc82a3dcf1ff95489c0ab91f6813847e55158f1729a664a4644c3fb81643e9e89527f5c9265f090733f6f5ae044b1d3662b020c4b51363cc1caac762
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
<!--- DO NOT EDIT THIS FILE - IT'S AUTOMATICALLY GENERATED VIA DEVTOOLS --->
|
2
2
|
|
3
|
+
## 1.0.0 2022-11-18
|
4
|
+
|
5
|
+
|
6
|
+
### Changed
|
7
|
+
|
8
|
+
- This version is compatible with recently released dry-rb dependencies (@flash-gordon)
|
9
|
+
- This version uses zeitwerk for autoloading (@flash-gordon)
|
10
|
+
|
11
|
+
[Compare v0.9.0...v1.0.0](https://github.com/dry-rb/dry-auto_inject/compare/v0.9.0...v1.0.0)
|
12
|
+
|
3
13
|
## 0.9.0 2022-01-26
|
4
14
|
|
5
15
|
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
[![CI Status](https://github.com/dry-rb/dry-auto_inject/workflows/ci/badge.svg)][actions]
|
12
12
|
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/d869ec8dc92e46b6a6eafa551f68c3f4)][codacy]
|
13
13
|
[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/d869ec8dc92e46b6a6eafa551f68c3f4)][codacy]
|
14
|
-
[![Inline docs](http://inch-ci.org/github/dry-rb/dry-auto_inject.svg?branch=
|
14
|
+
[![Inline docs](http://inch-ci.org/github/dry-rb/dry-auto_inject.svg?branch=main)][inchpages]
|
15
15
|
|
16
16
|
## Links
|
17
17
|
|
data/dry-auto_inject.gemspec
CHANGED
@@ -22,14 +22,15 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.require_paths = ["lib"]
|
23
23
|
|
24
24
|
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
25
|
-
spec.metadata["changelog_uri"] = "https://github.com/dry-rb/dry-auto_inject/blob/
|
25
|
+
spec.metadata["changelog_uri"] = "https://github.com/dry-rb/dry-auto_inject/blob/main/CHANGELOG.md"
|
26
26
|
spec.metadata["source_code_uri"] = "https://github.com/dry-rb/dry-auto_inject"
|
27
27
|
spec.metadata["bug_tracker_uri"] = "https://github.com/dry-rb/dry-auto_inject/issues"
|
28
28
|
|
29
29
|
spec.required_ruby_version = ">= 2.7.0"
|
30
30
|
|
31
31
|
# to update dependencies edit project.yml
|
32
|
-
spec.add_runtime_dependency "dry-
|
32
|
+
spec.add_runtime_dependency "dry-core", "~> 1.0", "< 2"
|
33
|
+
spec.add_runtime_dependency "zeitwerk", "~> 2.6"
|
33
34
|
|
34
35
|
spec.add_development_dependency "bundler"
|
35
36
|
spec.add_development_dependency "rake"
|
@@ -1,8 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "dry/auto_inject/strategies/constructor"
|
4
|
-
require "dry/auto_inject/method_parameters"
|
5
|
-
|
6
3
|
module Dry
|
7
4
|
module AutoInject
|
8
5
|
class Strategies
|
@@ -68,8 +65,6 @@ module Dry
|
|
68
65
|
RUBY
|
69
66
|
end
|
70
67
|
end
|
71
|
-
|
72
|
-
register :args, Args
|
73
68
|
end
|
74
69
|
end
|
75
70
|
end
|
@@ -1,13 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "dry/auto_inject/dependency_map"
|
4
|
-
|
5
3
|
module Dry
|
6
4
|
module AutoInject
|
7
5
|
class Strategies
|
8
|
-
class Constructor < Module
|
9
|
-
ClassMethods = Class.new(Module)
|
10
|
-
InstanceMethods = Class.new(Module)
|
6
|
+
class Constructor < ::Module
|
7
|
+
ClassMethods = ::Class.new(::Module)
|
8
|
+
InstanceMethods = ::Class.new(::Module)
|
11
9
|
|
12
10
|
attr_reader :container
|
13
11
|
attr_reader :dependency_map
|
@@ -1,8 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "dry/auto_inject/strategies/constructor"
|
4
|
-
require "dry/auto_inject/method_parameters"
|
5
|
-
|
6
3
|
module Dry
|
7
4
|
module AutoInject
|
8
5
|
class Strategies
|
@@ -44,8 +41,6 @@ module Dry
|
|
44
41
|
RUBY
|
45
42
|
end
|
46
43
|
end
|
47
|
-
|
48
|
-
register :hash, Hash
|
49
44
|
end
|
50
45
|
end
|
51
46
|
end
|
@@ -1,8 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "dry/auto_inject/strategies/constructor"
|
4
|
-
require "dry/auto_inject/method_parameters"
|
5
|
-
|
6
3
|
module Dry
|
7
4
|
module AutoInject
|
8
5
|
class Strategies
|
@@ -99,8 +96,6 @@ module Dry
|
|
99
96
|
end
|
100
97
|
end
|
101
98
|
end
|
102
|
-
|
103
|
-
register_default :kwargs, Kwargs
|
104
99
|
end
|
105
100
|
end
|
106
101
|
end
|
@@ -1,21 +1,19 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "dry-container"
|
4
|
-
|
5
3
|
module Dry
|
6
4
|
module AutoInject
|
7
5
|
class Strategies
|
8
|
-
extend
|
6
|
+
extend Core::Container::Mixin
|
9
7
|
|
10
8
|
# @api public
|
11
9
|
def self.register_default(name, strategy)
|
12
10
|
register name, strategy
|
13
11
|
register :default, strategy
|
14
12
|
end
|
13
|
+
|
14
|
+
register :args, proc { Args }
|
15
|
+
register :hash, proc { Strategies::Hash }
|
16
|
+
register_default :kwargs, proc { Kwargs }
|
15
17
|
end
|
16
18
|
end
|
17
19
|
end
|
18
|
-
|
19
|
-
require "dry/auto_inject/strategies/args"
|
20
|
-
require "dry/auto_inject/strategies/hash"
|
21
|
-
require "dry/auto_inject/strategies/kwargs"
|
data/lib/dry/auto_inject.rb
CHANGED
@@ -1,14 +1,32 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "
|
3
|
+
require "zeitwerk"
|
4
|
+
require "dry/core"
|
4
5
|
|
5
6
|
module Dry
|
7
|
+
module AutoInject
|
8
|
+
def self.loader
|
9
|
+
@loader ||= Zeitwerk::Loader.new.tap do |loader|
|
10
|
+
root = File.expand_path("..", __dir__)
|
11
|
+
loader.tag = "dry-auto_inject"
|
12
|
+
loader.inflector = Zeitwerk::GemInflector.new("#{root}/dry-auto_inject.rb")
|
13
|
+
loader.push_dir(root)
|
14
|
+
loader.ignore(
|
15
|
+
"#{root}/dry-auto_inject.rb",
|
16
|
+
"#{root}/dry/auto_inject/version.rb"
|
17
|
+
)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
loader.setup
|
22
|
+
end
|
23
|
+
|
6
24
|
# Configure an auto-injection module
|
7
25
|
#
|
8
26
|
# @example
|
9
27
|
# module MyApp
|
10
28
|
# # set up your container
|
11
|
-
# container = Dry::Container.new
|
29
|
+
# container = Dry::Core::Container.new
|
12
30
|
#
|
13
31
|
# container.register(:data_store, -> { DataStore.new })
|
14
32
|
# container.register(:user_repository, -> { container[:data_store][:users] })
|
metadata
CHANGED
@@ -1,29 +1,49 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dry-auto_inject
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.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: 2022-
|
11
|
+
date: 2022-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: dry-
|
14
|
+
name: dry-core
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.0'
|
20
|
+
- - "<"
|
18
21
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
22
|
+
version: '2'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- - "
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '1.0'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '2'
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: zeitwerk
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '2.6'
|
40
|
+
type: :runtime
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
25
45
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
46
|
+
version: '2.6'
|
27
47
|
- !ruby/object:Gem::Dependency
|
28
48
|
name: bundler
|
29
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -94,7 +114,7 @@ licenses:
|
|
94
114
|
- MIT
|
95
115
|
metadata:
|
96
116
|
allowed_push_host: https://rubygems.org
|
97
|
-
changelog_uri: https://github.com/dry-rb/dry-auto_inject/blob/
|
117
|
+
changelog_uri: https://github.com/dry-rb/dry-auto_inject/blob/main/CHANGELOG.md
|
98
118
|
source_code_uri: https://github.com/dry-rb/dry-auto_inject
|
99
119
|
bug_tracker_uri: https://github.com/dry-rb/dry-auto_inject/issues
|
100
120
|
post_install_message:
|