dry-dependency-injection 0.1.1 → 0.2.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/example/plugins/ignore.rb +1 -0
- data/example/setup.rb +3 -1
- data/lib/dry/dependency_injection/importer.rb +1 -0
- data/lib/dry/dependency_injection/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f9e22dd0411e1b77e8b843b73d7f59bbb0761d4dbc94f72ff13ceb4faf7d612
|
4
|
+
data.tar.gz: f7146b15a486012afa0cc776a124ed094913c8dfa8e9c99b02173d74d29fe740
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17eedbeb6dc7c2d65a8dfa5197ac0f5a076d1d50594d800ce11ca277317ca19df11646dbe53553cf070a46e7386116d5bbcbb3f05b72acd45118bdf222ae8927
|
7
|
+
data.tar.gz: d31efa7d54fbd7bddcabec2b7be613cdf27341aa77bbbee7299f72930c4be107e117a14f0ff71638e1d77b7ad6bdfabce096d623b106f61925ab0c38213ccef8
|
@@ -0,0 +1 @@
|
|
1
|
+
raise 'error'
|
data/example/setup.rb
CHANGED
@@ -4,7 +4,9 @@ require 'dry-auto_inject'
|
|
4
4
|
class Singletons; extend Dry::DependencyInjection::Singletons; end
|
5
5
|
Dependency = Dry::AutoInject(Singletons)
|
6
6
|
path = File.join(File.dirname(File.expand_path(__FILE__)), 'plugins')
|
7
|
-
Dry::DependencyInjection::Importer.new(Singletons).import(path)
|
7
|
+
Dry::DependencyInjection::Importer.new(Singletons).import(path) do |file|
|
8
|
+
!file.include?('ignore')
|
9
|
+
end.finalize
|
8
10
|
|
9
11
|
class App
|
10
12
|
include Dependency['registry']
|
@@ -14,6 +14,7 @@ module Dry
|
|
14
14
|
end
|
15
15
|
full = File.expand_path(path)
|
16
16
|
Dir[File.join(full, prefix, '**', '*.rb')].each do |file|
|
17
|
+
next if block_given? && !yield(file)
|
17
18
|
require file
|
18
19
|
subpath = file.gsub(/#{full}\/|\.rb/, '')
|
19
20
|
class_name = Dry::Core::Inflector.camelize(subpath)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dry-dependency-injection
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ''
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-06-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -138,6 +138,7 @@ files:
|
|
138
138
|
- dry-dependency-injection.gemspec
|
139
139
|
- example/plugins/books.rb
|
140
140
|
- example/plugins/first.rb
|
141
|
+
- example/plugins/ignore.rb
|
141
142
|
- example/plugins/ng/third.rb
|
142
143
|
- example/plugins/registry.rb
|
143
144
|
- example/plugins/second.rb
|