Skip to content

Commit

Permalink
Say something.
Browse files Browse the repository at this point in the history
  • Loading branch information
dblock committed Nov 28, 2015
1 parent 194a464 commit a93877a
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ gem 'sdoc', '~> 0.4.0', group: :doc
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

# Slack Bot
gem 'slack-ruby-bot'

group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
Expand Down
39 changes: 39 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ GEM
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.3.8)
arel (6.0.3)
binding_of_caller (0.7.2)
debug_inspector (>= 0.0.1)
Expand All @@ -51,9 +52,27 @@ GEM
debug_inspector (0.0.2)
diff-lcs (1.2.5)
erubis (2.7.0)
eventmachine (1.0.8)
execjs (2.6.0)
faraday (0.9.2)
multipart-post (>= 1.2, < 3)
faraday_middleware (0.9.2)
faraday (>= 0.7.4, < 0.10)
faraday_middleware-parse_oj (0.3.0)
faraday (~> 0.9.0)
faraday_middleware (~> 0.9.1)
oj (~> 2.0)
faye-websocket (0.10.1)
eventmachine (>= 0.12.0)
websocket-driver (>= 0.5.1)
giphy (2.0.2)
faraday (~> 0.9)
faraday_middleware (~> 0.9)
faraday_middleware-parse_oj (~> 0.3)
launchy (~> 2.4)
globalid (0.3.6)
activesupport (>= 4.1.0)
hashie (3.4.3)
i18n (0.7.0)
jbuilder (2.3.2)
activesupport (>= 3.0.0, < 5)
Expand All @@ -63,6 +82,8 @@ GEM
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json (1.8.3)
launchy (2.4.3)
addressable (~> 2.3)
loofah (2.0.3)
nokogiri (>= 1.5.9)
mail (2.6.3)
Expand All @@ -71,8 +92,10 @@ GEM
mini_portile (0.6.2)
minitest (5.8.3)
multi_json (1.11.2)
multipart-post (2.0.0)
nokogiri (1.6.6.4)
mini_portile (~> 0.6.0)
oj (2.13.1)
rack (1.6.4)
rack-test (0.6.3)
rack (>= 1.0)
Expand Down Expand Up @@ -129,6 +152,18 @@ GEM
sdoc (0.4.1)
json (~> 1.7, >= 1.7.7)
rdoc (~> 4.0)
slack-ruby-bot (0.4.5)
activesupport
giphy (~> 2.0.2)
hashie
slack-ruby-client
websocket-driver (~> 0.5.4)
slack-ruby-client (0.4.0)
eventmachine
faraday
faraday_middleware
faye-websocket
json
spring (1.4.4)
sprockets (3.4.1)
rack (> 1, < 3)
Expand All @@ -152,6 +187,9 @@ GEM
binding_of_caller (>= 0.7.2)
railties (>= 4.0)
sprockets-rails (>= 2.0, < 4.0)
websocket-driver (0.5.4)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.2)

PLATFORMS
ruby
Expand All @@ -165,6 +203,7 @@ DEPENDENCIES
rspec-rails
sass-rails (~> 5.0)
sdoc (~> 0.4.0)
slack-ruby-bot
spring
sqlite3
turbolinks
Expand Down
5 changes: 5 additions & 0 deletions bot/say.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class Say < SlackRubyBot::Commands::Base
command 'say' do |client, data, match|
send_message client, data.channel, match['expression']
end
end
8 changes: 8 additions & 0 deletions bot/tattletale.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
$:.unshift File.dirname(__FILE__)
require 'say'

Thread.abort_on_exception = true

Thread.new do
SlackRubyBot::App.instance.run
end
1 change: 1 addition & 0 deletions config/initializers/bot.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require File.join(Rails.root, 'bot/tattletale')

0 comments on commit a93877a

Please sign in to comment.