smart_ioc 0.2.2 → 0.2.3

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: aeab800e2e18812c2d25fe456a4e9d434e3ca63c
4
- data.tar.gz: a7a3247fe3174be4e45453af569bc631cb81eae6
3
+ metadata.gz: 9fed2bdfde8077422805026c8afccee8b937231c
4
+ data.tar.gz: d4a46ba3cc771a31d53c9dd54bb765ffb970365e
5
5
  SHA512:
6
- metadata.gz: 317128788531e93c88f58e866322151c79f8af17e229f28ef1e8b641152e91d813ffc2d44d2fb80dbf986c65ec658059245472b1343d57e3ba32238e76c77752
7
- data.tar.gz: e07b6743d555dc82ed0a1b18252771747f91f463adfce06b57dc91f32dcf7522851bd4f772a32df32bd7f1f188fadfa639c1c85828c219d2eba6dd8d0c110b83
6
+ metadata.gz: f7066d58c7038bf888345be96706247f174df43a0b14c5ef74c49eb0819122a0a4ccd647577a28392d26895ea7c690eb453cac90b9ed79163cb6a2330257d33b
7
+ data.tar.gz: 91600210f0c6226193a3b14fbc5aa7b141422afd94b1df913da625c9189f2d8ff972427dad72c0bd127bb1c5341eb50633b6cf6d0bd715492ac31f3985561582
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- smart_ioc (0.2.2)
4
+ smart_ioc (0.2.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -40,7 +40,9 @@ module SmartIoC
40
40
 
41
41
  # Load all beans (usually required for production env)
42
42
  def load_all_beans
43
- BeanLocations.load_all
43
+ BeanLocations.all_bean_names.each do |bean|
44
+ container.require_bean(bean)
45
+ end
44
46
  end
45
47
 
46
48
  # Full clear of data (mostly for tests)
@@ -32,6 +32,11 @@ class SmartIoC::BeanLocations
32
32
  nil
33
33
  end
34
34
 
35
+ # @return names of all found beans
36
+ def all_bean_names
37
+ @data.keys
38
+ end
39
+
35
40
  def get_bean_by_path(path)
36
41
  @paths[path]
37
42
  end
@@ -51,16 +56,6 @@ class SmartIoC::BeanLocations
51
56
  locations
52
57
  end
53
58
 
54
- def load_all
55
- @data.each do |package, bean_locations|
56
- bean_locations.each do |bean, paths|
57
- paths.each do |path|
58
- load(path)
59
- end
60
- end
61
- end
62
- end
63
-
64
59
  def clear
65
60
  @data = {}
66
61
  end
@@ -131,8 +131,14 @@ module SmartIoC
131
131
  bean_factory.bean_file_loader.clear_locations
132
132
  end
133
133
 
134
+ # @param bean_name [Symbol] bean name
135
+ # @return [Any]
136
+ def require_bean(bean_name)
137
+ bean_factory.bean_file_loader.require_bean(bean_name)
138
+ end
139
+
134
140
  private
135
-
141
+
136
142
  def bean_factory
137
143
  @bean_factory ||= SmartIoC::BeanFactory.new(bean_definitions_storage, extra_package_contexts)
138
144
  end
@@ -1,3 +1,3 @@
1
1
  module SmartIoC
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  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.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ruslan Gatiyatov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-12 00:00:00.000000000 Z
11
+ date: 2018-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler