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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9fed2bdfde8077422805026c8afccee8b937231c
4
- data.tar.gz: d4a46ba3cc771a31d53c9dd54bb765ffb970365e
3
+ metadata.gz: 81383d74ab85a917a839bd753f21154948881011
4
+ data.tar.gz: 7d0e016b96264f7e48e42f94ec592109f9309fb4
5
5
  SHA512:
6
- metadata.gz: f7066d58c7038bf888345be96706247f174df43a0b14c5ef74c49eb0819122a0a4ccd647577a28392d26895ea7c690eb453cac90b9ed79163cb6a2330257d33b
7
- data.tar.gz: 91600210f0c6226193a3b14fbc5aa7b141422afd94b1df913da625c9189f2d8ff972427dad72c0bd127bb1c5341eb50633b6cf6d0bd715492ac31f3985561582
6
+ metadata.gz: 0fb8b1b59d3a435c7e675c49365f52edcd7eaf845aeb222c210a92236369c6ec7f5f31e911c5d87532e246337cf205ac45b94f62bac24bfcea87e6006ee54f23
7
+ data.tar.gz: b74b9a016020a0e0d0ca23adb4055b117827f1b59ca3ac8af7b0604307fa8679116c769f0a2a72398902c65c988111ce97397ac0142da4778fc2513589b2e5d4
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.3.3
data/Gemfile CHANGED
@@ -5,6 +5,5 @@ gemspec
5
5
 
6
6
  group :test do
7
7
  gem 'rspec'
8
- gem 'byebug'
9
8
  gem 'simplecov'
10
9
  end
data/Gemfile.lock CHANGED
@@ -1,12 +1,11 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- smart_ioc (0.2.3)
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.15.4
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
- get_or_build_bean(bean_name, package, context)
40
+ @semaphore.synchronize do
41
+ result = get_or_build_bean(bean_name, package, context)
42
+ end
38
43
  end
39
44
 
40
45
  private
@@ -1,3 +1,3 @@
1
1
  module SmartIoC
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
data/spec/spec_helper.rb CHANGED
@@ -9,12 +9,11 @@ end
9
9
 
10
10
  if ENV['CI']=='true'
11
11
  require 'codecov'
12
-
12
+
13
13
  SimpleCov.formatter = SimpleCov::Formatter::Codecov
14
14
  end
15
15
 
16
16
  require 'smart_ioc'
17
- require 'byebug'
18
17
 
19
18
  RSpec.configure do |config|
20
19
  end
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.3
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-01-17 00:00:00.000000000 Z
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.6.12
136
+ rubygems_version: 2.5.2
136
137
  signing_key:
137
138
  specification_version: 4
138
139
  summary: Inversion of Control Container