slackify 0.3.0 โ†’ 0.3.2

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: e158dfddb3b113177499b3247dbc9a4a7a4f9fff55f87ecafb21064aa4549325
4
- data.tar.gz: cb03ce87203fc97ca0f4d7a728f25b6f729288e539b1530b39e6d51f59f6020a
3
+ metadata.gz: d5f1105d73a8943514708110e7b544fbaf8e300770f902103dcca4da95bfc9fa
4
+ data.tar.gz: b4a2b7dd7fcffed2cce55214fb96d2d09ea6ff40513d0360900187118857b6b8
5
5
  SHA512:
6
- metadata.gz: '093e9a1f4ab6e37c0020fb699d45ed392922477a195d72ba415ce702b3c2096663b6beba81364e61aae513ce0e3693f5463bd6a36a5ba48d2bc9888e4a48c856'
7
- data.tar.gz: a0f3caca091ceef0e50e84e5d1a6b6c139dcf7de5982babec1b43e1f21d1376b1bdb76f223b4e43b4b9ddf925c66fb7906bf80aa5f9d3dc9df8e85e1631f5954
6
+ metadata.gz: a80fbbb042403ae528e9563c7d3cdaec8462e30a6aaf033d1c93c804b9e78cb58e1b03cbd1c324cab8329eb697da35fe5d81e47dffe633643fd39192d507a802
7
+ data.tar.gz: f822f3cf7448b07f946f3a7d07b644d1ae70a57ee9cc8a9f06996c2de20f36561b4894294f5c350ab5c7a44394e75aed1e2a5ef1f127e1ee47cdac000975edbd
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## V0.3.2
2
+
3
+ * Add support for interactive block payloads ([b6cf1db](https://github.com/jusleg/slackify/commit/b6cf1dbb47b832037ebff56054efa27c9e3251dc)) by [@drose-shopify](https://github.com/drose-shopify)
4
+
1
5
  ## V0.3.0
2
6
 
3
7
  * Add code documentation and improve exception message
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Slackify [![Build Status](https://travis-ci.org/jusleg/slackify.svg?branch=master)](https://travis-ci.org/jusleg/slackify) [![Gem Version](https://badge.fury.io/rb/slackify.svg)](https://badge.fury.io/rb/slackify) ![Gem downloads](https://img.shields.io/gem/dt/slackify)
1
+ # Slackify [![Tests ๐Ÿงช](https://github.com/jusleg/slackify/workflows/Tests%20%F0%9F%A7%AA/badge.svg)](https://github.com/jusleg/slackify/actions?query=workflow%3A%22Tests+%F0%9F%A7%AA%22) [![Lint ๐Ÿ’Ž](https://github.com/jusleg/slackify/workflows/Lint%20%F0%9F%92%8E/badge.svg)](https://github.com/jusleg/slackify/actions?query=workflow%3A%22Lint+%F0%9F%92%8E%22) [![Gem Version](https://badge.fury.io/rb/slackify.svg)](https://badge.fury.io/rb/slackify) ![Gem downloads](https://img.shields.io/gem/dt/slackify)
2
2
 
3
3
  Slackify is a gem that allows to build slackbots on Rails using the [Event API](https://api.slack.com/events-api) from Slack.
4
4
 
@@ -21,7 +21,14 @@ module Slackify
21
21
 
22
22
  def interactive_callback
23
23
  parsed_payload = JSON.parse(params[:payload])
24
- response = handler_from_callback_id(parsed_payload["callback_id"]).call(parsed_payload)
24
+
25
+ callback_id = if parsed_payload.key?('view')
26
+ parsed_payload.dig('view', 'callback_id')
27
+ else
28
+ parsed_payload['callback_id']
29
+ end
30
+
31
+ response = handler_from_callback_id(callback_id).call(parsed_payload)
25
32
  if !response.nil?
26
33
  Timeout.timeout(SLACK_TIMEOUT_SECONDS) do
27
34
  render json: response
@@ -30,7 +37,7 @@ module Slackify
30
37
  head :ok
31
38
  end
32
39
  rescue Timeout::Error
33
- raise Timeout::Error, "Slack interactive callback timed out for #{parsed_payload['callback_id']}"
40
+ raise Timeout::Error, "Slack interactive callback timed out for #{callback_id}"
34
41
  end
35
42
 
36
43
  def slash_command_callback
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.3.0
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Leger