dry-dependency-injection 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 03f2cafa34e909ca7b5632c44914297b0e00bb28
4
- data.tar.gz: 0102c60c8bb0b49ee385b48d51ef17d244afa2e6
2
+ SHA256:
3
+ metadata.gz: 5edcb4fc459468513005dfcb4aedec7dcfcaf18e600dbc9c65efbdcc1dc3fbdc
4
+ data.tar.gz: 9b7c465e99af2e317e39752bd825fd5b7232c6de076bbb8c78204a58be315c8e
5
5
  SHA512:
6
- metadata.gz: 344d31869f359d01640681d673f2b5920356d90fa3a545a61a48f6b38a86772815b93513d0c1f092b9b294bc5ae1b30519b9ae67360715670280d003b65d55aa
7
- data.tar.gz: c5b80edf5134ff62b4ca2491663a5eff34b41c8dbbe8582b86f0b1fa23763c15f99a2f04319634a665d86321111366a3bb2c89025e2e835e42d9c7866f8b892e
6
+ metadata.gz: 25594f58c381f74371845b86967fb1b3cf784c4c95d6c22bfa6c3333535b69af5495cf2a77a8225e7177eedbf38b5b2065d62bb3b4f302c68a7f29119bb8331f
7
+ data.tar.gz: c4bf5229708ef2b13843e93f748328c87e7ef9ba941a23db522ca376cdbbd79725d0259a8aa0b6959ac275eef28c688d71912edd769c7c8db5fbcb12cc496cc0
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [gem]: https://rubygems.org/gems/dry-dependency-injection
1
+ [gem]: https://badge.fury.io/rb/dry-dependency-injection
2
2
  [travis]: https://travis-ci.org/mkristian/dry-dependency-injection
3
3
  [gemnasium]: https://gemnasium.com/mkristian/dry-dependency-injection
4
4
  [codeclimate]: https://codeclimate.com/github/mkristian/dry-dependency-injection
@@ -0,0 +1,10 @@
1
+ # need a plural class to test the inflection from filename to class constant
2
+ class Books
3
+ extend Dry::DependencyInjection::Eager
4
+ include Dependency['registry']
5
+
6
+ def initialize(**)
7
+ super
8
+ registry.register(Dry::Core::Inflector.underscore(self.class.to_s).sub('/', '.'), self)
9
+ end
10
+ end
@@ -4,6 +4,6 @@ class First
4
4
 
5
5
  def initialize(**)
6
6
  super
7
- registry.register(Dry::Core::Inflector.underscore(self.class).sub('/', '.'), self)
7
+ registry.register(Dry::Core::Inflector.underscore(self.class.to_s).sub('/', '.'), self)
8
8
  end
9
9
  end
@@ -5,7 +5,7 @@ module Ng
5
5
 
6
6
  def initialize(**)
7
7
  super
8
- registry.register(Dry::Core::Inflector.underscore(self.class).sub('/', '.'), self)
8
+ registry.register(Dry::Core::Inflector.underscore(self.class.to_s).sub('/', '.'), self)
9
9
  end
10
10
  end
11
11
  end
@@ -4,6 +4,6 @@ class Second
4
4
 
5
5
  def initialize(**)
6
6
  super
7
- registry.register(Dry::Core::Inflector.underscore(self.class).sub('/', '.'), self)
7
+ registry.register(Dry::Core::Inflector.underscore(self.class.to_s).sub('/', '.'), self)
8
8
  end
9
9
  end
@@ -16,7 +16,7 @@ module Dry
16
16
  Dir[File.join(full, prefix, '**', '*.rb')].each do |file|
17
17
  require file
18
18
  subpath = file.gsub(/#{full}\/|\.rb/, '')
19
- class_name = Dry::Core::Inflector.classify(subpath)
19
+ class_name = Dry::Core::Inflector.camelize(subpath)
20
20
  clazz = Dry::Core::Inflector.constantize(class_name)
21
21
  if clazz.is_a?(Class)
22
22
  key = subpath.gsub('/', '.')
@@ -1,5 +1,5 @@
1
1
  module Dry
2
2
  module DependencyInjection
3
- VERSION = '0.1.0'.freeze
3
+ VERSION = '0.1.1'.freeze
4
4
  end
5
5
  end
@@ -7,7 +7,7 @@ describe Dry::DependencyInjection::Importer do
7
7
  require 'setup'
8
8
 
9
9
  result = App.new.run
10
- expect(result.keys).to match_array ['first', 'second', 'ng.third']
11
- expect(result.values.collect{|v| v.sub(/:0.*/, '')}).to match_array ['#<First', '#<Second', '#<Ng::Third']
10
+ expect(result.keys).to match_array ['books', 'first', 'second', 'ng.third']
11
+ expect(result.values.collect{|v| v.sub(/:0.*/, '')}).to match_array ['#<Books', '#<First', '#<Second', '#<Ng::Third']
12
12
  end
13
13
  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.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-26 00:00:00.000000000 Z
11
+ date: 2018-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -136,6 +136,7 @@ files:
136
136
  - LICENSE
137
137
  - README.md
138
138
  - dry-dependency-injection.gemspec
139
+ - example/plugins/books.rb
139
140
  - example/plugins/first.rb
140
141
  - example/plugins/ng/third.rb
141
142
  - example/plugins/registry.rb
@@ -172,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
172
173
  version: '0'
173
174
  requirements: []
174
175
  rubyforge_project:
175
- rubygems_version: 2.5.1
176
+ rubygems_version: 2.7.5
176
177
  signing_key:
177
178
  specification_version: 4
178
179
  summary: add dependency injection to dry-container