Application allows you to easly create Slack integrations.
Roda - http://roda.jeremyevans.net
Sequel - http://sequel.jeremyevans.net
- We use rvm in this project, so when you clone your repository you should have gemset created.
- Setup .env file with values (some of them you need to obtain from slack integration - incoming/outcoming webhook):
DATABASE_URL
TEST_DATABASE_URL
RESERVATION_INCOMING_WEBHOOK
RESERVATION_CHANNEL
RACK_ENV
RESERVATION_OUTGOING_TOKEN
- gem install bundler
- bundle
- rake db:create
- rake db:migrate
- Application can use users whitelisting. Create
authorized_users.yml
inconfigurations
folder and list users which should be whitelisted for registration. Uncomment proper line inregister_user.rb
. - to run server: rackup
After you filled in proper env variables you need and added integrations on your slack panel, you can invoke the command from you slack channel (I recommend slash commands).
Format of the text you type after slash command is: DD/MM-HH-HH
If you want to improve or add some integrations check issues or simply create one.
Application structure has been prepared to easly add new integrations.
- Create
your_integration_name.rb
file inapps
folder. - Create a service witch your funcionality in
services
folder. - If you need to create a model for some object create it in
models
folder, create a migration and add it tomodels.rb
file. - Create slack configuration in
configurations
folder. - Initialize a bot in
roda-app.rb
withopts[:your_bot_name] = Slackbotsy::Bot.new(YOUR_CONFIG)
- You can now use this bot to post message with
PostToSlack.say(:your_bot_name, message)
. Note that posting to slack works only in production enviroment. To change this, go intoapp/services/post_to_slack.rb
.
rake db:create RACK_ENV=test
rake db:migrate RACK_ENV=test
rspec spec
MIT