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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5edcb4fc459468513005dfcb4aedec7dcfcaf18e600dbc9c65efbdcc1dc3fbdc
4
- data.tar.gz: 9b7c465e99af2e317e39752bd825fd5b7232c6de076bbb8c78204a58be315c8e
3
+ metadata.gz: 0f9e22dd0411e1b77e8b843b73d7f59bbb0761d4dbc94f72ff13ceb4faf7d612
4
+ data.tar.gz: f7146b15a486012afa0cc776a124ed094913c8dfa8e9c99b02173d74d29fe740
5
5
  SHA512:
6
- metadata.gz: 25594f58c381f74371845b86967fb1b3cf784c4c95d6c22bfa6c3333535b69af5495cf2a77a8225e7177eedbf38b5b2065d62bb3b4f302c68a7f29119bb8331f
7
- data.tar.gz: c4bf5229708ef2b13843e93f748328c87e7ef9ba941a23db522ca376cdbbd79725d0259a8aa0b6959ac275eef28c688d71912edd769c7c8db5fbcb12cc496cc0
6
+ metadata.gz: 17eedbeb6dc7c2d65a8dfa5197ac0f5a076d1d50594d800ce11ca277317ca19df11646dbe53553cf070a46e7386116d5bbcbb3f05b72acd45118bdf222ae8927
7
+ data.tar.gz: d31efa7d54fbd7bddcabec2b7be613cdf27341aa77bbbee7299f72930c4be107e117a14f0ff71638e1d77b7ad6bdfabce096d623b106f61925ab0c38213ccef8
@@ -0,0 +1 @@
1
+ raise 'error'
@@ -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).finalize
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)
@@ -1,5 +1,5 @@
1
1
  module Dry
2
2
  module DependencyInjection
3
- VERSION = '0.1.1'.freeze
3
+ VERSION = '0.2.0'.freeze
4
4
  end
5
5
  end
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.1.1
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-03-01 00:00:00.000000000 Z
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