silicon 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/silicon/chain.rb +8 -9
- data/lib/silicon/routing/syntax/command.rb +1 -0
- data/lib/silicon/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: 94b7004646a848bacec46ed80d72dc4cb2cba593
|
4
|
+
data.tar.gz: d0c7e82afa1aaefe8120af198b7783bd58f72759
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5c84117afa38dfd6490f980e7329b4ff5547e1b679cf5f6da7f74e6c7a65545c02691cdde8bb47247f439d23f2cafd3026ab059fb22ccacdcedc11a26511c69
|
7
|
+
data.tar.gz: 071e52fff0c832430029603118d2845231c39cdb4d293318bf637885cea7456a12f005142a2242855c5ee269f022e6c949dac641d9db3f190f460be47a958442
|
data/README.md
CHANGED
data/lib/silicon/chain.rb
CHANGED
@@ -11,10 +11,10 @@ module Silicon
|
|
11
11
|
|
12
12
|
def execute
|
13
13
|
if @catch_command.nil?
|
14
|
-
|
14
|
+
run_commands
|
15
15
|
else
|
16
16
|
begin
|
17
|
-
|
17
|
+
run_commands
|
18
18
|
rescue Exception => error
|
19
19
|
@container
|
20
20
|
.register_instance(error, :silicon_error)
|
@@ -29,7 +29,7 @@ module Silicon
|
|
29
29
|
|
30
30
|
private
|
31
31
|
|
32
|
-
def
|
32
|
+
def run_commands
|
33
33
|
threads = []
|
34
34
|
Thread.abort_on_exception = true
|
35
35
|
@commands.each_with_index do |command, index|
|
@@ -38,11 +38,11 @@ module Silicon
|
|
38
38
|
threads.each {|t| t.join}
|
39
39
|
threads = []
|
40
40
|
|
41
|
-
|
41
|
+
run_command(command)
|
42
42
|
else
|
43
43
|
thread = Thread.new {
|
44
44
|
Timeout::timeout(@async_timeout) {
|
45
|
-
|
45
|
+
run_command(command)
|
46
46
|
}
|
47
47
|
}
|
48
48
|
threads << thread if command.parallel?
|
@@ -55,13 +55,12 @@ module Silicon
|
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
58
|
-
def
|
59
|
-
action = @container.resolve(name.to_sym)
|
58
|
+
def run_command(command)
|
59
|
+
action = @container.resolve(command.name.to_sym)
|
60
60
|
result = action.call
|
61
|
-
result_name = action.respond_to?(:result_name) ? action.result_name : "#{name}_result"
|
62
61
|
|
63
62
|
@container
|
64
|
-
.register_instance(result, result_name.to_sym)
|
63
|
+
.register_instance(result, command.result_name.to_sym)
|
65
64
|
.using_lifetime(:scope)
|
66
65
|
.bound_to(:silicon_request)
|
67
66
|
end
|
data/lib/silicon/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: silicon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vladimir Kalinkin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hypo
|