slack-ruby-bot-server 0.12.2 → 0.12.3

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: 1ba269cbf5d52a1ec63e186d89860b2d5fd3d2375126e93b0efcfb0db77233d2
4
- data.tar.gz: f79f39c72303c00dcd90adc2229d95b98a8caff43a0cd1cfb2d40fd328e17214
3
+ metadata.gz: 5f3d74ad11628ec28dafca1d0ea2ac2b9119eb2d44aa5d8a9e55bbd07aad4bfa
4
+ data.tar.gz: d7cd58655aae8c5f75ca23d844cdf0820d4fcb874475aad221123473333eef25
5
5
  SHA512:
6
- metadata.gz: 619d8952361de54d239f127891f690460cc3a3e0d85ac69298a0a384d4caa52eb68bbf643e03f035c33723f8c1d3207e9ef7b17af76f0d47e0e0656b5d50fa79
7
- data.tar.gz: 06a7f1c37a6c9ebd2b17aa6733790383c57ffdff9b0ca4b5344cc9701493fcbeb80d532bc134fbea52f69088e4007e0f7ee76a9cb3d2ab7ec1af082cc87024f3
6
+ metadata.gz: 7ec7123d4ab6f0d7a771e473fa7de24baf8ff8d273d136c08bb105ed7088377e650b1cf1bfed821f04cf023e5dcdc24951e33d954e7cdd95af61710cfe09b7fb
7
+ data.tar.gz: ea6c899f378bc4f336fcd06be80a39983ba0795371260c5262501e13dcc1c322565fdcd737acea8e433eaab56509e327ee4147c80d8d1bdc3973cd7f1b6e5bf2
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2020-06-16 16:54:39 -0400 using RuboCop version 0.81.0.
3
+ # on 2020-07-17 08:36:05 -0400 using RuboCop version 0.81.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
@@ -1,5 +1,10 @@
1
1
  ### Changelog
2
2
 
3
+ #### 0.12.3 (2020/11/14)
4
+
5
+ * [#123](https://github.com/slack-ruby/slack-ruby-bot-server/pull/123): Reactivate a team that was disabled from Slack - [@dblock](https://github.com/dblock).
6
+ * [#127](https://github.com/slack-ruby/slack-ruby-bot-server/pull/127): Added a Rails bot example link - [@CrazyOptimist](https://github.com/CrazyOptimist).
7
+
3
8
  #### 0.12.2 (2020/7/26)
4
9
 
5
10
  * [#120](https://github.com/slack-ruby/slack-ruby-bot-server/pull/120): Removed GIFs - [@dblock](https://github.com/dblock).
data/README.md CHANGED
@@ -40,7 +40,7 @@ A library that contains a [Grape](http://github.com/ruby-grape/grape) API servin
40
40
 
41
41
  ### Stable Release
42
42
 
43
- You're reading the documentation for the **stable** release of slack-ruby-bot-server, v0.12.2. See [UPGRADING](UPGRADING.md) when upgrading from an older version.
43
+ You're reading the documentation for the **stable** release of slack-ruby-bot-server, 0.12.3. See [UPGRADING](UPGRADING.md) when upgrading from an older version.
44
44
 
45
45
  ### Try Me
46
46
 
@@ -320,6 +320,7 @@ You can see a sample implementation in [slack-sup#3a497b](https://github.com/dbl
320
320
  * [slack-api-explorer](https://github.com/slack-ruby/slack-api-explorer), see [api-explorer.playplay.io](https://shell.playplay.io)
321
321
  * [slack-strava](https://github.com/dblock/slack-strava), see [slava.playplay.io](https://slava.playplay.io)
322
322
  * [slack-arena](https://github.com/dblock/slack-arena), see [arena.playplay.io](https://arena.playplay.io)
323
+ * [slack-rails-bot-starter](https://github.com/CrazyOptimist/slack-rails-bot-starter), an all-in-one rails starter kit built on top of the slack-ruby-bot-server and the slack-ruby-bot-server-events
323
324
 
324
325
  ### Copyright & License
325
326
 
@@ -54,11 +54,14 @@ module SlackRubyBotServer
54
54
  team ||= Team.where(team_id: rc['team_id']).first
55
55
 
56
56
  if team
57
+ team.ping_if_active!
58
+
57
59
  team.update_attributes!(
58
60
  activated_user_id: user_id,
59
61
  activated_user_access_token: access_token,
60
62
  bot_user_id: bot_user_id
61
63
  )
64
+
62
65
  raise "Team #{team.name} is already registered." if team.active?
63
66
 
64
67
  team.activate!(token)
@@ -38,5 +38,17 @@ module Methods
38
38
  presence: client.users_getPresence(user: auth['user_id'])
39
39
  }
40
40
  end
41
+
42
+ def ping_if_active!
43
+ return unless active?
44
+
45
+ ping!
46
+ rescue Slack::Web::Api::Errors::SlackError => e
47
+ logger.warn "Active team #{self} ping, #{e.message}."
48
+ case e.message
49
+ when 'account_inactive', 'invalid_auth'
50
+ deactivate!
51
+ end
52
+ end
41
53
  end
42
54
  end
@@ -1,3 +1,3 @@
1
1
  module SlackRubyBotServer
2
- VERSION = '0.12.2'.freeze
2
+ VERSION = '0.12.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slack-ruby-bot-server
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.2
4
+ version: 0.12.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Doubrovkine
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-26 00:00:00.000000000 Z
11
+ date: 2020-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async-websocket
@@ -280,7 +280,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
280
280
  - !ruby/object:Gem::Version
281
281
  version: '0'
282
282
  requirements: []
283
- rubygems_version: 3.1.2
283
+ rubygems_version: 3.1.3
284
284
  signing_key:
285
285
  specification_version: 4
286
286
  summary: A Grape API serving a Slack bot to multiple teams.