slackify 0.1.4 → 0.1.5

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: 481a11f7bd67bbd0dade00117995381beb8719b0aba7f4b886372be0fb169d57
4
- data.tar.gz: 6d2fad59ffe6938d3bf0f3ba9bf754218faf1cfdeb7f64ed3fd5c586535f465f
3
+ metadata.gz: ef19a6dcce63500188e60c11300e64b87bc9e1f14b19b74414a9836a6c62bbe6
4
+ data.tar.gz: 99b6d64edb26950cb2170726482c8dfee60a0ec6f2783ad6590590569f30c756
5
5
  SHA512:
6
- metadata.gz: eec68d6c75d8537cc74036921025d68d14475d5f7f84b3d50d918d33a4f5dec96e2b2080956da0bf52717a24ee882282fd9eaced48f00abfefc30df843d7c0af
7
- data.tar.gz: 6e9888657a4a3ec71b86ed7714f21cfc275b9b1e90d0d1136ecba01dfc41853e9cc8b2a0dc58c15f8d8cbc35c3df77d6ea183190add7a2149b2bd759852ba3c2
6
+ metadata.gz: cb26feeb493688c5d4b8968df4f8675696cfc63be388de73c83c1ccf35bb6b856594ef1262610f09abfc214ec3f042586de2bc7228b09d87614789624ccf65f4
7
+ data.tar.gz: c197031062643ab45484f851bb274378eab85b272917b8bfb829e8c1f2f3c13448af27ff70eeb80c980c69a2d8c76c5996e0436c43c6ec34883b0867df0be47f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## V0.1.5
2
+
3
+ Update how the `bot_id` is set in the handler configuration. You can disable the slack auth test (which is used to obtain the bot_id) by setting `SLACK_AUTH_SKIP=1` in your environment variables. If you are running in a Rails environment other than production, development or staging and would like to use the bot for real requests, you can trigger a manual auth test by calling `Slackify.configuration.handlers.bot_auth_test`. Gemfile.lock was removed.
4
+
1
5
  ## V0.1.4
2
6
 
3
7
  Custom unhandled_handler configuration fix. It wouldn't let you set a custom one as the validation was checking for `is_a?` instead of `<`
@@ -43,16 +43,26 @@ module Slackify
43
43
  end
44
44
  end
45
45
 
46
+ def bot_auth_test
47
+ @bot_id = Slackify.configuration.slack_client.auth_test.fetch('user_id')
48
+ Rails.logger.debug("[Slackify] Bot successfully authenticated to Slack")
49
+ true
50
+ rescue KeyError
51
+ raise "[Slackify] The bot did not successfully authenticate to Slack"
52
+ end
53
+
46
54
  private
47
55
 
48
56
  def environment_configurations
49
- @bot_id =
50
- case Rails.env
51
- when 'production', 'staging', 'development'
52
- Slackify.configuration.slack_client.auth_test['user_id']
53
- when 'test'
54
- ''
55
- end
57
+ if %w(production staging development).exclude?(Rails.env) || skip_auth?
58
+ @bot_id = 'dummy_bot_id'
59
+ else
60
+ bot_auth_test
61
+ end
62
+ end
63
+
64
+ def skip_auth?
65
+ ENV['SLACKIFY_AUTH_SKIP'] == '1'
56
66
  end
57
67
 
58
68
  def read_handlers_yaml
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slackify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Leger
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-03-17 00:00:00.000000000 Z
12
+ date: 2019-09-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -138,8 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
138
  - !ruby/object:Gem::Version
139
139
  version: '0'
140
140
  requirements: []
141
- rubyforge_project:
142
- rubygems_version: 2.7.3
141
+ rubygems_version: 3.0.3
143
142
  signing_key:
144
143
  specification_version: 4
145
144
  summary: Slackbot framework for Rails using the Events API