Skip to content

Commit

Permalink
Use slack-ruby-bot.
Browse files Browse the repository at this point in the history
  • Loading branch information
dblock committed Jul 2, 2015
1 parent f6e9475 commit 365a751
Show file tree
Hide file tree
Showing 42 changed files with 68 additions and 548 deletions.
9 changes: 3 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@ source 'http://rubygems.org'

ruby '2.1.6'

gem 'hashie'
gem 'slack-api', '~> 1.1.6', require: 'slack'
gem 'slack-ruby-bot'
gem 'puma'
gem 'sinatra'
gem 'activesupport'
gem 'dentaku'
gem 'giphy', '~> 2.0.2'

group :development, :test do
gem 'rake', '~> 10.4'
Expand All @@ -17,8 +14,8 @@ group :development, :test do
end

group :test do
gem 'rspec', '~> 3.2'
gem 'rack-test', '~> 0.6.2'
gem 'rspec'
gem 'rack-test'
gem 'vcr'
gem 'webmock'
end
24 changes: 13 additions & 11 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GEM
remote: http://rubygems.org/
specs:
activesupport (4.2.1)
activesupport (4.2.3)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
Expand Down Expand Up @@ -34,13 +34,13 @@ GEM
faraday_middleware (~> 0.9)
faraday_middleware-parse_oj (~> 0.3)
launchy (~> 2.4)
hashie (3.4.1)
hashie (3.4.2)
i18n (0.7.0)
json (1.8.2)
json (1.8.3)
launchy (2.4.3)
addressable (~> 2.3)
minitest (5.6.1)
multi_json (1.11.0)
minitest (5.7.0)
multi_json (1.11.1)
multipart-post (2.0.0)
oj (2.12.9)
parser (2.3.0.pre.2)
Expand Down Expand Up @@ -85,6 +85,11 @@ GEM
faraday_middleware (~> 0.8)
faye-websocket (~> 0.9.2)
multi_json (~> 1.0, >= 1.0.3)
slack-ruby-bot (0.1.0)
activesupport
giphy (~> 2.0.2)
hashie
slack-api (~> 1.1.6)
thor (0.19.1)
thread_safe (0.3.5)
tilt (1.4.1)
Expand All @@ -102,17 +107,14 @@ PLATFORMS
ruby

DEPENDENCIES
activesupport
dentaku
foreman
giphy (~> 2.0.2)
hashie
puma
rack-test (~> 0.6.2)
rack-test
rake (~> 10.4)
rspec (~> 3.2)
rspec
rubocop (= 0.31.0)
sinatra
slack-api (~> 1.1.6)
slack-ruby-bot
vcr
webmock
18 changes: 0 additions & 18 deletions app/slack-mathbot.rb

This file was deleted.

83 changes: 0 additions & 83 deletions app/slack-mathbot/app.rb

This file was deleted.

27 changes: 0 additions & 27 deletions app/slack-mathbot/commands/base.rb

This file was deleted.

9 changes: 0 additions & 9 deletions app/slack-mathbot/commands/hi.rb

This file was deleted.

9 changes: 0 additions & 9 deletions app/slack-mathbot/commands/unknown.rb

This file was deleted.

13 changes: 0 additions & 13 deletions app/slack-mathbot/config.rb

This file was deleted.

3 changes: 0 additions & 3 deletions app/slack-mathbot/hooks.rb

This file was deleted.

10 changes: 0 additions & 10 deletions app/slack-mathbot/hooks/base.rb

This file was deleted.

11 changes: 0 additions & 11 deletions app/slack-mathbot/hooks/hello.rb

This file was deleted.

33 changes: 0 additions & 33 deletions app/slack-mathbot/hooks/message.rb

This file was deleted.

1 change: 0 additions & 1 deletion app/slack_mathbot.rb

This file was deleted.

5 changes: 4 additions & 1 deletion config.ru
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
require File.expand_path('../app', __FILE__)
$LOAD_PATH.unshift(File.dirname(__FILE__))

require 'slack-mathbot'
require 'web'

Thread.new do
SlackMathbot::App.instance.run
Expand Down
14 changes: 0 additions & 14 deletions config/application.rb

This file was deleted.

5 changes: 0 additions & 5 deletions config/boot.rb

This file was deleted.

3 changes: 0 additions & 3 deletions config/environment.rb

This file was deleted.

3 changes: 0 additions & 3 deletions config/initializers/giphy.rb

This file was deleted.

13 changes: 0 additions & 13 deletions config/initializers/slack/request.rb

This file was deleted.

5 changes: 5 additions & 0 deletions slack-mathbot.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
require 'slack-ruby-bot'
require 'slack-mathbot/version'
require 'slack-mathbot/about'
require 'slack-mathbot/commands'
require 'slack-mathbot/app'
File renamed without changes.
4 changes: 4 additions & 0 deletions slack-mathbot/app.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module SlackMathbot
class App < SlackRubyBot::App
end
end
3 changes: 0 additions & 3 deletions app/slack-mathbot/commands.rb → slack-mathbot/commands.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
require 'slack-mathbot/commands/base'
require 'slack-mathbot/commands/calculate'
require 'slack-mathbot/commands/about'
require 'slack-mathbot/commands/help'
require 'slack-mathbot/commands/hi'
require 'slack-mathbot/commands/unknown'
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module SlackMathbot
module Commands
class Default < Base
class Default < SlackRubyBot::Commands::Base
def self.call(data, _command, _arguments)
send_message_with_gif data.channel, SlackMathbot::ABOUT, 'math'
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module SlackMathbot
module Commands
class Calculate < Base
class Calculate < SlackRubyBot::Commands::Base
def self.call(data, _command, arguments)
result = Dentaku::Calculator.new.evaluate(arguments.join)
result = result.to_s if result
Expand Down
Loading

0 comments on commit 365a751

Please sign in to comment.