slack-ruby-bot-server 0.12.3 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop_todo.yml +4 -9
  3. data/.travis.yml +0 -1
  4. data/CHANGELOG.md +4 -0
  5. data/DEBUGGING.md +0 -20
  6. data/README.md +29 -81
  7. data/UPGRADING.md +14 -0
  8. data/lib/slack-ruby-bot-server.rb +3 -3
  9. data/lib/slack-ruby-bot-server/api/endpoints/teams_endpoint.rb +7 -3
  10. data/lib/slack-ruby-bot-server/api/middleware.rb +4 -5
  11. data/lib/slack-ruby-bot-server/config.rb +8 -2
  12. data/lib/slack-ruby-bot-server/ext.rb +1 -1
  13. data/lib/slack-ruby-bot-server/loggable.rb +25 -0
  14. data/lib/slack-ruby-bot-server/rspec.rb +0 -1
  15. data/lib/slack-ruby-bot-server/service.rb +7 -33
  16. data/lib/slack-ruby-bot-server/version.rb +1 -1
  17. data/public/index.html.erb +1 -1
  18. data/slack-ruby-bot-server.gemspec +2 -2
  19. data/tasks/db.rake +0 -36
  20. metadata +11 -51
  21. data/images/slackbotserver.gif +0 -0
  22. data/images/slackbutton.gif +0 -0
  23. data/lib/slack-ruby-bot-server/ext/activerecord/slack-ruby-bot/commands/base.rb +0 -18
  24. data/lib/slack-ruby-bot-server/ext/slack-ruby-bot.rb +0 -2
  25. data/lib/slack-ruby-bot-server/ext/slack-ruby-bot/client.rb +0 -12
  26. data/lib/slack-ruby-bot-server/server.rb +0 -31
  27. data/sample_apps/README.md +0 -11
  28. data/sample_apps/sample_app_activerecord/.rspec +0 -3
  29. data/sample_apps/sample_app_activerecord/.standalone_migrations +0 -3
  30. data/sample_apps/sample_app_activerecord/Gemfile +0 -24
  31. data/sample_apps/sample_app_activerecord/Procfile +0 -1
  32. data/sample_apps/sample_app_activerecord/README.md +0 -12
  33. data/sample_apps/sample_app_activerecord/Rakefile +0 -14
  34. data/sample_apps/sample_app_activerecord/commands.rb +0 -2
  35. data/sample_apps/sample_app_activerecord/commands/help.rb +0 -19
  36. data/sample_apps/sample_app_activerecord/commands/whoami.rb +0 -6
  37. data/sample_apps/sample_app_activerecord/config.ru +0 -22
  38. data/sample_apps/sample_app_activerecord/config/newrelic.yml +0 -217
  39. data/sample_apps/sample_app_activerecord/config/postgresql.yml +0 -17
  40. data/sample_apps/sample_app_activerecord/db/migrate/20170307164946_create_teams_table.rb +0 -12
  41. data/sample_apps/sample_app_activerecord/db/migrate/20190323181453_add_activated_fields.rb +0 -7
  42. data/sample_apps/sample_app_activerecord/db/schema.rb +0 -29
  43. data/sample_apps/sample_app_activerecord/spec/api/root_spec.rb +0 -16
  44. data/sample_apps/sample_app_activerecord/spec/commands/help_spec.rb +0 -14
  45. data/sample_apps/sample_app_activerecord/spec/commands/whoami_spec.rb +0 -14
  46. data/sample_apps/sample_app_activerecord/spec/spec_helper.rb +0 -19
  47. data/sample_apps/sample_app_mongoid/.rspec +0 -3
  48. data/sample_apps/sample_app_mongoid/Gemfile +0 -20
  49. data/sample_apps/sample_app_mongoid/Procfile +0 -1
  50. data/sample_apps/sample_app_mongoid/README.md +0 -14
  51. data/sample_apps/sample_app_mongoid/Rakefile +0 -10
  52. data/sample_apps/sample_app_mongoid/commands.rb +0 -2
  53. data/sample_apps/sample_app_mongoid/commands/help.rb +0 -19
  54. data/sample_apps/sample_app_mongoid/commands/whoami.rb +0 -6
  55. data/sample_apps/sample_app_mongoid/config.ru +0 -14
  56. data/sample_apps/sample_app_mongoid/config/mongoid.yml +0 -27
  57. data/sample_apps/sample_app_mongoid/config/newrelic.yml +0 -217
  58. data/sample_apps/sample_app_mongoid/spec/api/root_spec.rb +0 -16
  59. data/sample_apps/sample_app_mongoid/spec/commands/help_spec.rb +0 -14
  60. data/sample_apps/sample_app_mongoid/spec/commands/whoami_spec.rb +0 -14
  61. data/sample_apps/sample_app_mongoid/spec/spec_helper.rb +0 -27
@@ -1,16 +0,0 @@
1
- require 'spec_helper'
2
-
3
- def app
4
- SlackRubyBotServer::Api::Middleware.instance
5
- end
6
-
7
- describe 'API' do
8
- include Rack::Test::Methods
9
-
10
- it 'root' do
11
- get '/api'
12
- expect(last_response.status).to eq 200
13
- links = JSON.parse(last_response.body)['_links']
14
- expect(links.keys.sort).to eq(%w[self status team teams].sort)
15
- end
16
- end
@@ -1,14 +0,0 @@
1
- require 'spec_helper'
2
- require 'commands/help'
3
-
4
- describe Help do
5
- let!(:team) { Fabricate(:team) }
6
- let(:app) { SlackRubyBotServer::Server.new(team: team) }
7
- let(:client) { app.send(:client) }
8
- let(:message_hook) { SlackRubyBot::Hooks::Message.new }
9
- it 'default' do
10
- expect(client).to receive(:say).with(channel: 'channel', text: [Help::HELP, SlackRubyBotServer::INFO].join("\n"))
11
- expect(client).to receive(:say).with(channel: 'channel')
12
- message_hook.call(client, Hashie::Mash.new(channel: 'channel', text: "#{SlackRubyBot.config.user} help"))
13
- end
14
- end
@@ -1,14 +0,0 @@
1
- require 'spec_helper'
2
- require 'commands/whoami'
3
-
4
- describe Whoami do
5
- let(:team) { Fabricate(:team) }
6
- let(:app) { SlackRubyBotServer::Server.new(team: team) }
7
- context 'whoami' do
8
- it 'returns username' do
9
- expect(message: "#{SlackRubyBot.config.user} whoami", channel: 'channel', user: 'user').to respond_with_slack_message(
10
- '<@user>'
11
- )
12
- end
13
- end
14
- end
@@ -1,27 +0,0 @@
1
- $LOAD_PATH.unshift File.expand_path('..', __dir__)
2
-
3
- ENV['RACK_ENV'] = 'test'
4
-
5
- require 'mongoid'
6
- require 'database_cleaner'
7
- require 'slack-ruby-bot-server/rspec'
8
-
9
- Mongoid.load!(File.expand_path('../config/mongoid.yml', __dir__), ENV['RACK_ENV'])
10
-
11
- RSpec.configure do |config|
12
- config.before :suite do
13
- Mongo::Logger.logger.level = Logger::INFO
14
-
15
- Mongoid::Tasks::Database.create_indexes
16
- end
17
-
18
- config.after :suite do
19
- Mongoid.purge!
20
- end
21
-
22
- config.around :each do |example|
23
- DatabaseCleaner.cleaning do
24
- example.run
25
- end
26
- end
27
- end