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 +4 -4
- data/Gemfile.lock +2 -2
- data/lib/smart_ioc/bean_definitions_storage.rb +9 -8
- data/lib/smart_ioc/version.rb +1 -1
- data/spec/smart_ioc/recursive_spec.rb +1 -1
- data/spec/smart_ioc/smart_ioc_spec.rb +4 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a58c5f84034596665181c7a368aa35b2c9ed780e0dce715d538e4e142a921be4
|
4
|
+
data.tar.gz: 462be2bd543accc11130c90f86589247116a4d939c62aaca8e71f57db99cca5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64c18ef92109604e6eef73fec45c2dd8c9b7c84b1e5472b5f3cdf5b3a800490fa7aec50b9de5a508c1c62abf9739f571cf7393a318eec2558d2b6fd1a978211a
|
7
|
+
data.tar.gz: 1705b4a8b407707aaf00016f79c941a68250f52a1ef4e8071ad55c7f4f0c0fee03d786b3acfc40b59d8f6c2635cd7df65c7cb69e2505b07a72f7aac87b8c2ad1
|
data/Gemfile.lock
CHANGED
@@ -20,17 +20,18 @@ class SmartIoC::BeanDefinitionsStorage
|
|
20
20
|
end
|
21
21
|
|
22
22
|
if existing_bd
|
23
|
-
|
24
|
-
%Q(Unable to add bean to definitions storage.
|
25
|
-
Bean definition already exists.
|
23
|
+
@collection.reject! { |bd| bd == existing_bd }
|
26
24
|
|
27
|
-
|
28
|
-
|
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
|
-
|
31
|
-
#{existing_bd.inspect})
|
32
|
+
EOF
|
32
33
|
|
33
|
-
|
34
|
+
puts message
|
34
35
|
end
|
35
36
|
|
36
37
|
@collection.push(bean_definition)
|
data/lib/smart_ioc/version.rb
CHANGED
@@ -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(
|
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.
|
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-
|
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.
|
137
|
+
rubygems_version: 3.1.2
|
138
138
|
signing_key:
|
139
139
|
specification_version: 4
|
140
140
|
summary: Inversion of Control Container
|