smart_ioc 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/smart_ioc/bean_locator.rb +10 -13
- data/lib/smart_ioc/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: faf1a687610d2cc6e25623650bb6ff881938bd28
|
4
|
+
data.tar.gz: 34208f444623db8654a9ff4501ef2c70b581aa5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bdf1e74fcc8965d8ccd77c106cebca346200d49d9419b5530d3964c5048d76e6b6798da6cadd9ab656614c340bd7657cbbb96a141b425e1e77ff6a89331a0b8a
|
7
|
+
data.tar.gz: 34933c3ad8765c8e9dd94fa6b80539a9c4b2c4227f1d344f413c0fec5fe55ae602db8e3e5017d87ebd9c7c07a846a0127833323e31b60ef082e36c9d4b3ea9eb
|
data/Gemfile.lock
CHANGED
@@ -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
|
-
|
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
|
-
|
18
|
-
|
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
|
-
|
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
|
data/lib/smart_ioc/version.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.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-
|
11
|
+
date: 2018-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|