slack-ruby-bot-server 0.12.0 → 0.12.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: 6ebd73ca8473ea0f3e86d030538fcfdf3fe54ae9689aee50c24669506ce1b1fe
4
- data.tar.gz: 07471fb459f7dc25e2203a9279e0db2d34650c07792b0b6b1931d71bb4e9f37c
3
+ metadata.gz: bd95fc2a7806d66e49468401dec6f7598ba538d690f79c39a80723b0abd4afc8
4
+ data.tar.gz: 57d542b3799078c57e29914395d20c92735c9f70025471f7ccb3e422a965c437
5
5
  SHA512:
6
- metadata.gz: bde46306261b7eb8088eaa03647672bea884c23f54dee33935fc6eccbb8ed6993cf55ab7791c25cc329b19506ac5aca2e215f5e90e3de0050bff97ac182288ec
7
- data.tar.gz: c060a2835f112300914d70817d4f503e1972dd5cea4a230e7ce13d1faa996e72cbb77d2262df0dfa89020229a0721f5302e644ddeafbf1f4e8a99c9ef66cccf8
6
+ metadata.gz: 7725ccdcda4bc790c8f4a28de21797ee8aaefe698e937be0fb2bc665a487e28f3174960db32d772b75ea0137677a1049dc2ef05b8ea49f192dcd40d1b58502f0
7
+ data.tar.gz: a661c32f29d0685428510700dfed5f3a76614adf924d972cad8bae14570422ab2d131f7db41a28ad378f0c5a0e8c283943ab674e4c70df6d80ed826e12bd126f
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2020-04-26 17:46:16 -0400 using RuboCop version 0.81.0.
3
+ # on 2020-06-16 16:54:39 -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
@@ -44,11 +44,13 @@ Naming/HeredocDelimiterNaming:
44
44
  - 'sample_apps/sample_app_activerecord/commands/help.rb'
45
45
  - 'sample_apps/sample_app_mongoid/commands/help.rb'
46
46
 
47
- # Offense count: 1
47
+ # Offense count: 3
48
48
  # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
49
49
  # AllowedNames: io, id, to, by, on, in, at, ip, db, os, pp
50
50
  Naming/MethodParameterName:
51
51
  Exclude:
52
+ - 'lib/slack-ruby-bot-server/models/team/activerecord.rb'
53
+ - 'lib/slack-ruby-bot-server/models/team/mongoid.rb'
52
54
  - 'lib/slack-ruby-bot-server/service.rb'
53
55
 
54
56
  # Offense count: 1
@@ -1,5 +1,9 @@
1
1
  ### Changelog
2
2
 
3
+ #### 0.12.1 (2020/5/16)
4
+
5
+ * [#118](https://github.com/slack-ruby/slack-ruby-bot-server/pull/118): Do not fail to start on errors in `Team#purge!` - [@dblock](https://github.com/dblock).
6
+
3
7
  #### 0.12.0 (2020/4/26)
4
8
 
5
9
  * [#113](https://github.com/slack-ruby/slack-ruby-bot-server/pull/113): Added support for intervals with `.every` - [@dblock](https://github.com/dblock).
data/README.md CHANGED
@@ -17,7 +17,7 @@ A library that contains a [Grape](http://github.com/ruby-grape/grape) API servin
17
17
 
18
18
  ### Stable Release
19
19
 
20
- You're reading the documentation for the **stable** release of slack-ruby-bot-server, 0.12.0. See [UPGRADING](UPGRADING.md) when upgrading from an older version.
20
+ You're reading the documentation for the **next** release of slack-ruby-bot-server. Please see the documentation for the [last stable release, v0.12.0](https://github.com/slack-ruby/slack-ruby-bot-server/blob/v0.12.0/README.md) unless you're integrating with HEAD. See [UPGRADING](UPGRADING.md) when upgrading from an older version.
21
21
 
22
22
  ### Try Me
23
23
 
@@ -3,11 +3,14 @@ require_relative 'methods'
3
3
  class Team < ActiveRecord::Base
4
4
  include Methods
5
5
 
6
- def self.purge!
7
- # destroy teams inactive for two weeks
8
- Team.where(active: false).where('updated_at <= ?', 2.weeks.ago).each do |team|
9
- puts "Destroying #{team}, inactive since #{team.updated_at}, over two weeks ago."
10
- team.destroy
6
+ def self.purge!(dt = 2.weeks.ago)
7
+ Team.where(active: false).where('updated_at <= ?', dt).each do |team|
8
+ begin
9
+ logger.info "Destroying #{team}, inactive since #{team.updated_at}."
10
+ team.destroy
11
+ rescue StandardError => e
12
+ logger.warn "Error destroying #{team}, #{e.message}."
13
+ end
11
14
  end
12
15
  end
13
16
  end
@@ -15,11 +15,15 @@ class Team
15
15
 
16
16
  include Methods
17
17
 
18
- def self.purge!
18
+ def self.purge!(dt = 2.weeks.ago)
19
19
  # destroy teams inactive for two weeks
20
- Team.where(active: false, :updated_at.lte => 2.weeks.ago).each do |team|
21
- Mongoid.logger.info "Destroying #{team}, inactive since #{team.updated_at}, over two weeks ago."
22
- team.destroy
20
+ Team.where(active: false, :updated_at.lte => dt).each do |team|
21
+ begin
22
+ logger.info "Destroying #{team}, inactive since #{team.updated_at}."
23
+ team.destroy
24
+ rescue StandardError => e
25
+ logger.warn "Error destroying #{team}, #{e.message}."
26
+ end
23
27
  end
24
28
  end
25
29
  end
@@ -1,3 +1,3 @@
1
1
  module SlackRubyBotServer
2
- VERSION = '0.12.0'.freeze
2
+ VERSION = '0.12.1'.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.0
4
+ version: 0.12.1
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-04-27 00:00:00.000000000 Z
11
+ date: 2020-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async-websocket
@@ -279,7 +279,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
279
279
  - !ruby/object:Gem::Version
280
280
  version: '0'
281
281
  requirements: []
282
- rubygems_version: 3.0.3
282
+ rubygems_version: 3.1.3
283
283
  signing_key:
284
284
  specification_version: 4
285
285
  summary: A Grape API serving a Slack bot to multiple teams.