slack-ruby-bot-server-rtm 0.1.0 → 0.1.1

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: 8a105023529b8c8461a6e3cd0c27c28aed730128cc33035d5a6545f4e38c9235
4
- data.tar.gz: a83384ddb9ac372730192f8e7fba3c96d3d8c87610c280e7fa566482ecf0a653
3
+ metadata.gz: 5824cb54023d4ee24f318fe9b455cd4ccc3b450ecaec0ccc893223517e823d87
4
+ data.tar.gz: aca8db91d16aeb611f25bb0784deab2072fbcb777c32b155c6fa8a9bdf8afb31
5
5
  SHA512:
6
- metadata.gz: d9b72617f72ad3efd05b8240988d97199d55aeed0e77a11f1a4131fb80903889669133ed3408f3dd137bdedef00c38b5babadc9567277cb711cf87c94d6bf67b
7
- data.tar.gz: b3aae099e4b071b44ec2f0e8ac705a66538aa8cb57a62e6e30a7ba9e24e488982d94b423adc71f5c74e153ce0f1b152de299e63c1ecfc24fc63402f1b9df2102
6
+ metadata.gz: 9ab696238cbe2b831efc55fc705d3b4d2e06b5e4594fbd5a2694b1bfb4faf8a3415b7292ffdf3bd223ef880f465e7ad6d29137920d6190976a214ec727ea284c
7
+ data.tar.gz: a84c2a77ee1007efeee7114145d539ba8183b43ca38b4650ca5c0a6f422826a973c4b75e47ecb47347e36b46bb014cf1fb4c70948ec6125b690145487db1cb28
@@ -1,5 +1,9 @@
1
1
  ### Changelog
2
2
 
3
+ #### 0.1.1 (2020/11/15)
4
+
5
+ * Fix: error `private method 'run_callbacks' called for #<SlackRubyBotServer::Service>` - [@dblock](https://github.com/dblock).
6
+
3
7
  #### 0.1.0 (2020/11/15)
4
8
 
5
9
  * Initial public release - [@dblock](https://github.com/dblock).
data/README.md CHANGED
@@ -6,9 +6,9 @@ Slack Ruby Bot Server RealTime (RTM) Extension
6
6
 
7
7
  An extension to [slack-ruby-bot-server](https://github.com/slack-ruby/slack-ruby-bot-server) that makes it easy to implement Slack RTM bots.
8
8
 
9
- ### Sample
9
+ ### Samples
10
10
 
11
- See [slack-ruby/slack-ruby-bot-server-rtm-sample](https://github.com/slack-ruby/slack-ruby-bot-server-rtm-sample) for a working sample.
11
+ You can use one of the [sample applications](sample_apps) that use MongoDB or ActiveRecord to bootstrap your project and start adding slack command handlers on top of this code.
12
12
 
13
13
  ### Usage
14
14
 
@@ -21,14 +21,14 @@ module SlackRubyBotServer
21
21
  team.server = server
22
22
  server.start_async
23
23
  rescue StandardError => e
24
- SlackRubyBotServer::Config.service_class.instance.run_callbacks :error, team, e
24
+ SlackRubyBotServer::Config.service_class.instance.send(:run_callbacks, :error, team, e)
25
25
  case e.message
26
26
  when 'account_inactive', 'invalid_auth' then
27
- SlackRubyBotServer::Config.logger.error "#{team.name}: #{e.message}, team will be deactivated."
28
- SlackRubyBotServer::RealTime::Service.instance.deactivate! team
29
- elsef
27
+ SlackRubyBotServer::Config.service_class.instance.logger.error "#{team.name}: #{e.message}, team will be deactivated."
28
+ SlackRubyBotServer::Config.service_class.instance.deactivate! team
29
+ else
30
30
  wait = e.retry_after if e.is_a?(Slack::Web::Api::Errors::TooManyRequestsError)
31
- SlackRubyBotServer::Config.logger.error "#{team.name}: #{e.message}, restarting in #{wait} second(s)."
31
+ SlackRubyBotServer::Config.service_class.instance.logger.error "#{team.name}: #{e.message}, restarting in #{wait} second(s)."
32
32
  sleep(wait)
33
33
  start_server! team, server, [wait * 2, 60].min
34
34
  end
@@ -37,8 +37,8 @@ module SlackRubyBotServer
37
37
  def restart!(_wait = 1)
38
38
  # when an integration is disabled, a live socket is closed, which causes the default behavior of the client to restart
39
39
  # it would keep retrying without checking for account_inactive or such, we want to restart via service which will disable an inactive team
40
- logger.info "#{team.name}: socket closed, restarting ..."
41
- SlackRubyBotServer::RealTime::Service.instance.restart! team
40
+ SlackRubyBotServer::Config.service_class.instance.logger.info "#{team.name}: socket closed, restarting ..."
41
+ SlackRubyBotServer::Config.service_class.instance.restart! team
42
42
  open!
43
43
  end
44
44
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module SlackRubyBotServer
4
4
  module RealTime
5
- VERSION = '0.1.0'
5
+ VERSION = '0.1.1'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slack-ruby-bot-server-rtm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Doubrovkine