legion-transport 1.1.4 → 1.1.5
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff91b1e257e5a3be9580e01bb3517deab0f5f912f031e081469034643e7b1f7a
|
4
|
+
data.tar.gz: f940e2c6821e2015fb29e7d32746d53deaf36ad2fdc8c238c0ee519852b0710c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 379c26d17de282b5342a4300197658ce222a822c2bbe10cffc4f459b7bb13689fe1b145e60237c9579bef58005e37ee60d85c9f18e23292791bfdbddb608604b
|
7
|
+
data.tar.gz: d25558b9a4e10049ba187b4174bebf0e198e1914f08422db97ae79090a67e1150b8b9e5f1b795f55030bf3e2a4a0386ae10b67c1c9a19cddcf83fc67ddc6bba3
|
@@ -11,9 +11,7 @@ module Legion
|
|
11
11
|
def publish(options = @options) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity
|
12
12
|
raise unless @valid
|
13
13
|
|
14
|
-
|
15
|
-
$exchanges[exchange.to_s] = exchange.new unless $exchanges.key?(exchange.to_s)
|
16
|
-
exchange_dest = $exchanges[exchange.to_s]
|
14
|
+
exchange_dest = exchange.respond_to?(:new) ? exchange.new : exchange
|
17
15
|
exchange_dest.publish(encode_message,
|
18
16
|
routing_key: routing_key || '',
|
19
17
|
content_type: options[:content_type] || content_type,
|
@@ -16,6 +16,17 @@ module Legion
|
|
16
16
|
}
|
17
17
|
end
|
18
18
|
|
19
|
+
def routing_key # rubocop:disable Metrics/AbcSize
|
20
|
+
if @options[:conditions].is_a?(String) && @options[:conditions].length > 2
|
21
|
+
'task.subtask.conditioner'
|
22
|
+
elsif @options[:transformation].is_a?(String) && @options[:transformation].length > 2
|
23
|
+
'task.subtask.transform'
|
24
|
+
elsif @options[:function_id].is_a? Integer
|
25
|
+
function = Legion::Data::Model::Function[@options[:function_id]]
|
26
|
+
"#{function.runner.extension.values[:exchange]}.#{function.runner.values[:queue]}.#{function.values[:name]}"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
19
30
|
def validate
|
20
31
|
raise TypeError unless @options[:function].is_a? String
|
21
32
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: legion-transport
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Esity
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-10-
|
11
|
+
date: 2020-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|