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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dca817403e895fd00e7d95e54d278f19e13f0941960b276b501d637c9330f588
4
- data.tar.gz: 93e27ca7cbd491413e0fc9199c7ba259d05c2d6bef11403ee7feaf403b00453a
3
+ metadata.gz: 3877289696f65588095dc677e305c54af7a55e8145b7608a4c41a2ee9d12555d
4
+ data.tar.gz: 1ec2de10405c6b42e72a50e9a20d466dec9da666a9047451d421084c9fa51baf
5
5
  SHA512:
6
- metadata.gz: b6079c6cb3bc70d79e4cc576f7e358bb1043bf996700c073147155bb7c27178836a7f23a67bf1cae51c0a4665838f440c7b39bea64104c5978eb8a9f7eef7375
7
- data.tar.gz: 6d12f8ffd73af744fd61d3620fc955a310a3b78b4bbf6f06b6070dae9c43f782b1cea0c12e158284e97af8a38ad0f5e34e7d1a16bbfff74edcb09ccc75334228
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 |body = nil, interrupt: true|
27
+ define_method(name) do |*args|
28
+ interrupt = (args[1] ? args[1][:interrupt] : true)
28
29
  response.status = code
29
- response.body = 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
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Open `Fleck` module to set `VERSION` constant.
4
4
  module Fleck
5
- VERSION = '2.1.0'
5
+ VERSION = '2.1.1'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fleck
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Groza Sergiu