smart_ioc 0.2.3 → 0.2.4
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/.ruby-version +1 -0
- data/Gemfile +0 -1
- data/Gemfile.lock +2 -4
- data/lib/smart_ioc/bean_factory.rb +6 -1
- data/lib/smart_ioc/version.rb +1 -1
- data/spec/spec_helper.rb +1 -2
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 81383d74ab85a917a839bd753f21154948881011
|
|
4
|
+
data.tar.gz: 7d0e016b96264f7e48e42f94ec592109f9309fb4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0fb8b1b59d3a435c7e675c49365f52edcd7eaf845aeb222c210a92236369c6ec7f5f31e911c5d87532e246337cf205ac45b94f62bac24bfcea87e6006ee54f23
|
|
7
|
+
data.tar.gz: b74b9a016020a0e0d0ca23adb4055b117827f1b59ca3ac8af7b0604307fa8679116c769f0a2a72398902c65c988111ce97397ac0142da4778fc2513589b2e5d4
|
data/.ruby-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.3.3
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
smart_ioc (0.2.
|
|
4
|
+
smart_ioc (0.2.4)
|
|
5
5
|
|
|
6
6
|
GEM
|
|
7
7
|
remote: https://rubygems.org/
|
|
8
8
|
specs:
|
|
9
|
-
byebug (9.0.6)
|
|
10
9
|
codecov (0.1.10)
|
|
11
10
|
json
|
|
12
11
|
simplecov
|
|
@@ -40,7 +39,6 @@ PLATFORMS
|
|
|
40
39
|
|
|
41
40
|
DEPENDENCIES
|
|
42
41
|
bundler (~> 1.3)
|
|
43
|
-
byebug
|
|
44
42
|
codecov
|
|
45
43
|
rake
|
|
46
44
|
rspec
|
|
@@ -48,4 +46,4 @@ DEPENDENCIES
|
|
|
48
46
|
smart_ioc!
|
|
49
47
|
|
|
50
48
|
BUNDLED WITH
|
|
51
|
-
1.
|
|
49
|
+
1.16.1
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
require 'thread'
|
|
2
|
+
|
|
1
3
|
# Instantiates beans according to their scopes
|
|
2
4
|
class SmartIoC::BeanFactory
|
|
3
5
|
include SmartIoC::Errors
|
|
@@ -12,6 +14,7 @@ class SmartIoC::BeanFactory
|
|
|
12
14
|
@singleton_scope = SmartIoC::Scopes::Singleton.new
|
|
13
15
|
@prototype_scope = SmartIoC::Scopes::Prototype.new
|
|
14
16
|
@thread_scope = SmartIoC::Scopes::Request.new
|
|
17
|
+
@semaphore = Mutex.new
|
|
15
18
|
end
|
|
16
19
|
|
|
17
20
|
def clear_scopes
|
|
@@ -34,7 +37,9 @@ class SmartIoC::BeanFactory
|
|
|
34
37
|
check_arg(package, :package, Symbol) if package
|
|
35
38
|
check_arg(context, :context, Symbol) if context
|
|
36
39
|
|
|
37
|
-
|
|
40
|
+
@semaphore.synchronize do
|
|
41
|
+
result = get_or_build_bean(bean_name, package, context)
|
|
42
|
+
end
|
|
38
43
|
end
|
|
39
44
|
|
|
40
45
|
private
|
data/lib/smart_ioc/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
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.2.
|
|
4
|
+
version: 0.2.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ruslan Gatiyatov
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-
|
|
11
|
+
date: 2018-03-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -61,6 +61,7 @@ extra_rdoc_files: []
|
|
|
61
61
|
files:
|
|
62
62
|
- ".gitignore"
|
|
63
63
|
- ".rspec"
|
|
64
|
+
- ".ruby-version"
|
|
64
65
|
- ".travis.yml"
|
|
65
66
|
- ".yardops"
|
|
66
67
|
- Gemfile
|
|
@@ -132,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
132
133
|
version: '0'
|
|
133
134
|
requirements: []
|
|
134
135
|
rubyforge_project:
|
|
135
|
-
rubygems_version: 2.
|
|
136
|
+
rubygems_version: 2.5.2
|
|
136
137
|
signing_key:
|
|
137
138
|
specification_version: 4
|
|
138
139
|
summary: Inversion of Control Container
|