smart_ioc 0.3.6 → 0.3.7

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
2
  SHA256:
3
- metadata.gz: 01e3fac1f32289e170915d3251e88d937f970f6396ef7d6a8c7b2163696001f2
4
- data.tar.gz: 15f36e9c706c0cfdb59c86e8f40cf1106361346b0f0def709f9618b3821cc865
3
+ metadata.gz: a58c5f84034596665181c7a368aa35b2c9ed780e0dce715d538e4e142a921be4
4
+ data.tar.gz: 462be2bd543accc11130c90f86589247116a4d939c62aaca8e71f57db99cca5d
5
5
  SHA512:
6
- metadata.gz: 11fae8af77f705ecdbd3a6039dd5c148abd28fc5ef8e584644179f76f23f1c061f4dc4c049a593f308037ef0e1f033c0cd6641e3d761447e51a97c6ea3699efd
7
- data.tar.gz: 82ea8d86866fe7eace9a1db47da5fd87457cd499425387aa977d086ac514525463902e8f4f8261ae91c4ba9e35ddc0b4f25761303552e35c63c05edd34d2ba7a
6
+ metadata.gz: 64c18ef92109604e6eef73fec45c2dd8c9b7c84b1e5472b5f3cdf5b3a800490fa7aec50b9de5a508c1c62abf9739f571cf7393a318eec2558d2b6fd1a978211a
7
+ data.tar.gz: 1705b4a8b407707aaf00016f79c941a68250f52a1ef4e8071ad55c7f4f0c0fee03d786b3acfc40b59d8f6c2635cd7df65c7cb69e2505b07a72f7aac87b8c2ad1
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- smart_ioc (0.3.6)
4
+ smart_ioc (0.3.7)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -47,4 +47,4 @@ DEPENDENCIES
47
47
  smart_ioc!
48
48
 
49
49
  BUNDLED WITH
50
- 1.17.2
50
+ 2.1.2
@@ -20,17 +20,18 @@ class SmartIoC::BeanDefinitionsStorage
20
20
  end
21
21
 
22
22
  if existing_bd
23
- error_msg =
24
- %Q(Unable to add bean to definitions storage.
25
- Bean definition already exists.
23
+ @collection.reject! { |bd| bd == existing_bd }
26
24
 
27
- New bean details:
28
- #{bean_definition.inspect}
25
+ message = <<~EOF
26
+ \nReplacing bean definition...
27
+ - New bean details:
28
+ #{bean_definition.inspect}
29
+ - Existing bean details:
30
+ #{existing_bd.inspect})
29
31
 
30
- Existing bean details:
31
- #{existing_bd.inspect})
32
+ EOF
32
33
 
33
- raise ArgumentError, error_msg
34
+ puts message
34
35
  end
35
36
 
36
37
  @collection.push(bean_definition)
@@ -1,3 +1,3 @@
1
1
  module SmartIoC
2
- VERSION = "0.3.6"
2
+ VERSION = "0.3.7"
3
3
  end
@@ -18,7 +18,7 @@ describe SmartIoC::Container do
18
18
 
19
19
  it 'loads recursive beans' do
20
20
  users_creator = @container.get_bean(:users_creator)
21
- uc2 = users_creator.send(:repository).users_creator
21
+ uc2 = users_creator.send(:repository).send(:users_creator)
22
22
  expect(users_creator).to eq(uc2)
23
23
  end
24
24
  end
@@ -27,14 +27,16 @@ describe SmartIoC do
27
27
  repository = @container.get_bean(:repository, package: :admins)
28
28
 
29
29
  expect(repository.get(1)).to be_a(User)
30
- expect(users_creator.send(:repository)).to be_a(AdminsRepository)
30
+ expect(users_creator.send(:repository)).to be_a(Class)
31
+ expect(users_creator.send(:repository).methods).to include(:put)
32
+ expect(users_creator.send(:repository).methods).to include(:get)
31
33
  expect(users_creator.send(:logger)).to be_a(LoggerFactory::SmartIoCLogger)
32
34
  end
33
35
 
34
36
  it 'sets beans with extra package context' do
35
37
  SmartIoC.set_extra_context_for_package(:admins, :test)
36
38
  SmartIoC.force_clear_scopes
37
-
39
+
38
40
  users_creator = @container.get_bean(:users_creator)
39
41
  users_creator.create(1, 'test@test.com')
40
42
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smart_ioc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ruslan Gatiyatov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-16 00:00:00.000000000 Z
11
+ date: 2020-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -134,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
134
  - !ruby/object:Gem::Version
135
135
  version: '0'
136
136
  requirements: []
137
- rubygems_version: 3.0.3
137
+ rubygems_version: 3.1.2
138
138
  signing_key:
139
139
  specification_version: 4
140
140
  summary: Inversion of Control Container