smart_ioc 0.2.4 → 0.2.5

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: 81383d74ab85a917a839bd753f21154948881011
4
- data.tar.gz: 7d0e016b96264f7e48e42f94ec592109f9309fb4
3
+ metadata.gz: faf1a687610d2cc6e25623650bb6ff881938bd28
4
+ data.tar.gz: 34208f444623db8654a9ff4501ef2c70b581aa5a
5
5
  SHA512:
6
- metadata.gz: 0fb8b1b59d3a435c7e675c49365f52edcd7eaf845aeb222c210a92236369c6ec7f5f31e911c5d87532e246337cf205ac45b94f62bac24bfcea87e6006ee54f23
7
- data.tar.gz: b74b9a016020a0e0d0ca23adb4055b117827f1b59ca3ac8af7b0604307fa8679116c769f0a2a72398902c65c988111ce97397ac0142da4778fc2513589b2e5d4
6
+ metadata.gz: bdf1e74fcc8965d8ccd77c106cebca346200d49d9419b5530d3964c5048d76e6b6798da6cadd9ab656614c340bd7657cbbb96a141b425e1e77ff6a89331a0b8a
7
+ data.tar.gz: 34933c3ad8765c8e9dd94fa6b80539a9c4b2c4227f1d344f413c0fec5fe55ae602db8e3e5017d87ebd9c7c07a846a0127833323e31b60ef082e36c9d4b3ea9eb
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- smart_ioc (0.2.4)
4
+ smart_ioc (0.2.5)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,6 +1,6 @@
1
1
  class SmartIoC::BeanLocator
2
2
  include SmartIoC::Args
3
-
3
+
4
4
  BEAN_PATTERN = /bean\s+(:[a-zA-z0-9\-\_]+)/
5
5
 
6
6
  # @param package_name [Symbol] package name for bean (ex: :repository)
@@ -10,21 +10,18 @@ class SmartIoC::BeanLocator
10
10
  check_arg(package_name, :package_name, Symbol)
11
11
 
12
12
  Dir.glob(File.join(dir, '**/*.rb')).each do |file_path|
13
- source_str = File.read(file_path)
14
-
15
- beans = find_package_beans(source_str)
13
+ File.readlines(file_path).each do |line|
14
+ match_data = line.match(BEAN_PATTERN)
16
15
 
17
- beans.each do |bean_name|
18
- SmartIoC::BeanLocations.add_bean(package_name, bean_name, file_path)
16
+ if match_data
17
+ SmartIoC::BeanLocations.add_bean(
18
+ package_name, match_data.captures.first.gsub(':', '').to_sym, file_path
19
+ )
20
+ break
21
+ end
19
22
  end
20
23
  end
21
- nil
22
- end
23
-
24
- private
25
24
 
26
- def find_package_beans(source_str)
27
- tokens = source_str.scan(BEAN_PATTERN)
28
- tokens.flatten.uniq.map {|token| token.gsub(':', '').to_sym}
25
+ nil
29
26
  end
30
27
  end
@@ -1,3 +1,3 @@
1
1
  module SmartIoC
2
- VERSION = "0.2.4"
2
+ VERSION = "0.2.5"
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.4
4
+ version: 0.2.5
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-03-12 00:00:00.000000000 Z
11
+ date: 2018-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler