0.0
No release in over 3 years
Low commit activity in last 3 years
Create Slack apps with a simple Sinatra specific DSL
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0
>= 0

Runtime

~> 1.3, >= 1.3.0
~> 0.16, >= 0.16.4
~> 1.0, >= 1.0.3
~> 2.0, >= 2.0.5
~> 1.7, >= 1.7.2
 Project Readme

Sinatra::Slack

Gem Version Maintainability Test Coverage

Note: WIP

Creating your first Slack Slash Command application has never been to easy. Combining sinatra and sinatra-slack DSL, you can quickly create a app that processes Slash Commands with ease.

Installation

Add this line to your application's Gemfile:

gem 'sinatra-slack'

And then execute:

$ bundle

Or install it yourself as:

$ gem install sinatra-slack

Dependencies

This gem currently requires you to use Thin.

Example

Go to folder example for more information. Learn how to create a Slack App in https://api.slack.com

Usage

require "sinatra/base"
require "sinatra/slack"

class App < Sinatra::Base
  register Sinatra::Slack

  configure :production, :development do
    enable :logging

    before { logger.info "Received: #{params}" }
  end

  set :slack_secret, ENV['SLACK_SIGNING_SECRET']
  commands_endpoint "/slack/commands"
  actions_endpoint "/slack/actions"

  command "/command *sub_command :spot_name" do |sub_command, spot_name|
    "Executed *command* command \n[subcommand]: #{sub_command} \n[args]:  #{spot_name}"
  end
end

TODO

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/nunonamorado/sinatra-slack. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.