fleck 2.1.0 → 2.1.1
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 +4 -4
- data/examples/actions.rb +3 -3
- data/lib/fleck/core/consumer/helpers_definers.rb +3 -2
- data/lib/fleck/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3877289696f65588095dc677e305c54af7a55e8145b7608a4c41a2ee9d12555d
|
4
|
+
data.tar.gz: 1ec2de10405c6b42e72a50e9a20d466dec9da666a9047451d421084c9fa51baf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96433348361bb72b516fb5c0c102ed71bc83b97c3db3bcd60535801c32435c42a37ab47f39b6a105e14ab424b6a7869009d7bb018d169e58e3bf81a3a7aa61e4
|
7
|
+
data.tar.gz: a33cf55738d71a88386da96867304783bf0ff0839e750d47033854322a72442f3563019f134b119287fc01a2ded13ba773a8d8bac87122dcf141ec461261a68e
|
data/examples/actions.rb
CHANGED
@@ -24,7 +24,7 @@ class MyConsumer < Fleck::Consumer
|
|
24
24
|
|
25
25
|
action 'hello', "An action which returns 'Hello'"
|
26
26
|
def hello
|
27
|
-
ok! 'Hello
|
27
|
+
ok! result: 'Hello', message: 'Ciao'
|
28
28
|
end
|
29
29
|
|
30
30
|
action 'ciao', "An action which returns 'Ciao'"
|
@@ -52,9 +52,9 @@ SAMPLES.to_i.times do |num|
|
|
52
52
|
name = ['John Doe', 'Willie Wonka', 'Billie Smith'].sample
|
53
53
|
client.request(action: action, params: { num: num, name: name, number: rand * 100, world: %w[yes no].sample }, timeout: 5) do |_, response|
|
54
54
|
if response.status == 200
|
55
|
-
Fleck.logger.info "ACTION: (#{action.inspect}) #{response.body}"
|
55
|
+
Fleck.logger.info "ACTION: (#{action.inspect}) #{response.body.inspect}"
|
56
56
|
else
|
57
|
-
Fleck.logger.error "ACTION: (#{action.inspect}) #{response.errors.join(', ')} --- #{response.body}"
|
57
|
+
Fleck.logger.error "ACTION: (#{action.inspect}) #{response.errors.join(', ')} --- #{response.body.inspect}"
|
58
58
|
end
|
59
59
|
end
|
60
60
|
end
|
@@ -24,9 +24,10 @@ module Fleck
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def success_method(name, code)
|
27
|
-
define_method(name) do |
|
27
|
+
define_method(name) do |*args|
|
28
|
+
interrupt = (args[1] ? args[1][:interrupt] : true)
|
28
29
|
response.status = code
|
29
|
-
response.body =
|
30
|
+
response.body = args[0]
|
30
31
|
throw INTERRUPT_NAME if interrupt
|
31
32
|
end
|
32
33
|
end
|
data/lib/fleck/version.rb
CHANGED