smart_ioc 0.1.28 → 0.1.29

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
  SHA1:
3
- metadata.gz: 241dbe4a31d95181db8b2604a570f5e0f244894e
4
- data.tar.gz: 08434ffb62dd2727da1d82fa6919f69263593117
3
+ metadata.gz: 2c643b23f10b8d4ab31f241f8705fac4cb4abb7d
4
+ data.tar.gz: d77b6c7528997f199c2dbdc144a95ca76c59e6a5
5
5
  SHA512:
6
- metadata.gz: 164dde71578f2399b63af9af1fc173bc261c0ac19d4c2eccfb44a300e5cacbd1ce9e7f76ae3843a79734cae1333ba0a03fb0cbb599c08302af1c7122ea0443ff
7
- data.tar.gz: a4d77468cfed50a70dbeecd23366ac05e4f7ac93a76ba8453336a298ea9e2ef9d8885a00b059500464a1c691133f87d54d9f685cbc88ec0768c6272dfafb4bad
6
+ metadata.gz: 1b118126120252e9dc398c40063f8dfbea966fc70b450318677366a8d4111456d96f18bfd452fa39ded0df02cfdc90863dc3658b6f6725f3d69d7ccbd7d2fc4e
7
+ data.tar.gz: b9be1f2e720ca0cb179b1ab64aeeeab706774def06716abc025f20febc6b808b15f56d678f250061ef267a804aa01ecc1e51f94abd5a03eb8d425ef977e1d19c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- smart_ioc (0.1.28)
4
+ smart_ioc (0.1.29)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -50,7 +50,7 @@ class SmartIoC::BeanFactory
50
50
 
51
51
  history << bean_name
52
52
 
53
- if scope_bean
53
+ if scope_bean && scope_bean.loaded
54
54
  update_dependencies(scope_bean.bean, bean_definition)
55
55
  scope_bean.bean
56
56
  else
@@ -1,3 +1,3 @@
1
1
  module SmartIoC
2
- VERSION = "0.1.28"
2
+ VERSION = "0.1.29"
3
3
  end
@@ -62,8 +62,16 @@ describe 'Factory Method' do
62
62
 
63
63
  inject :singleton_bean
64
64
 
65
+ class Config
66
+ attr_reader :singleton_bean
67
+
68
+ def initialize(singleton_bean)
69
+ @singleton_bean = singleton_bean
70
+ end
71
+ end
72
+
65
73
  def build
66
- Object.new
74
+ Config.new(singleton_bean)
67
75
  end
68
76
  end
69
77
 
@@ -74,18 +82,28 @@ describe 'Factory Method' do
74
82
 
75
83
  inject :factory_config
76
84
 
85
+ class Logger
86
+ attr_reader :factory_config
87
+
88
+ def initialize(factory_config)
89
+ @factory_config = factory_config
90
+ end
91
+ end
92
+
77
93
  def build
78
- Object.new
94
+ Logger.new(factory_config)
79
95
  end
80
96
  end
81
97
  end
82
98
 
83
99
  it 'creates factory_logger bean' do
84
- expect(SmartIoC.get_bean(:factory_logger, package: :cross_refference)).to be_a(Object)
100
+ expect(SmartIoC.get_bean(:factory_logger, package: :cross_refference)).to be_a(FactoryLogger::Logger)
85
101
  end
86
102
 
87
103
  it 'creates factory_config bean' do
88
- expect(SmartIoC.get_bean(:factory_config, package: :cross_refference)).to be_a(Object)
104
+ config = SmartIoC.get_bean(:factory_config, package: :cross_refference)
105
+ expect(config).to be_a(FactoryConfig::Config)
106
+ expect(config.singleton_bean).to be_a(SingletonBean)
89
107
  end
90
108
  end
91
109
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smart_ioc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.28
4
+ version: 0.1.29
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ruslan Gatiyatov