slack-ruby-bot-server 0.12.3 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/.rubocop_todo.yml +4 -9
 - data/.travis.yml +0 -1
 - data/CHANGELOG.md +4 -0
 - data/DEBUGGING.md +0 -20
 - data/README.md +29 -81
 - data/UPGRADING.md +14 -0
 - data/lib/slack-ruby-bot-server.rb +3 -3
 - data/lib/slack-ruby-bot-server/api/endpoints/teams_endpoint.rb +7 -3
 - data/lib/slack-ruby-bot-server/api/middleware.rb +4 -5
 - data/lib/slack-ruby-bot-server/config.rb +8 -2
 - data/lib/slack-ruby-bot-server/ext.rb +1 -1
 - data/lib/slack-ruby-bot-server/loggable.rb +25 -0
 - data/lib/slack-ruby-bot-server/rspec.rb +0 -1
 - data/lib/slack-ruby-bot-server/service.rb +7 -33
 - data/lib/slack-ruby-bot-server/version.rb +1 -1
 - data/public/index.html.erb +1 -1
 - data/slack-ruby-bot-server.gemspec +2 -2
 - data/tasks/db.rake +0 -36
 - metadata +11 -51
 - data/images/slackbotserver.gif +0 -0
 - data/images/slackbutton.gif +0 -0
 - data/lib/slack-ruby-bot-server/ext/activerecord/slack-ruby-bot/commands/base.rb +0 -18
 - data/lib/slack-ruby-bot-server/ext/slack-ruby-bot.rb +0 -2
 - data/lib/slack-ruby-bot-server/ext/slack-ruby-bot/client.rb +0 -12
 - data/lib/slack-ruby-bot-server/server.rb +0 -31
 - data/sample_apps/README.md +0 -11
 - data/sample_apps/sample_app_activerecord/.rspec +0 -3
 - data/sample_apps/sample_app_activerecord/.standalone_migrations +0 -3
 - data/sample_apps/sample_app_activerecord/Gemfile +0 -24
 - data/sample_apps/sample_app_activerecord/Procfile +0 -1
 - data/sample_apps/sample_app_activerecord/README.md +0 -12
 - data/sample_apps/sample_app_activerecord/Rakefile +0 -14
 - data/sample_apps/sample_app_activerecord/commands.rb +0 -2
 - data/sample_apps/sample_app_activerecord/commands/help.rb +0 -19
 - data/sample_apps/sample_app_activerecord/commands/whoami.rb +0 -6
 - data/sample_apps/sample_app_activerecord/config.ru +0 -22
 - data/sample_apps/sample_app_activerecord/config/newrelic.yml +0 -217
 - data/sample_apps/sample_app_activerecord/config/postgresql.yml +0 -17
 - data/sample_apps/sample_app_activerecord/db/migrate/20170307164946_create_teams_table.rb +0 -12
 - data/sample_apps/sample_app_activerecord/db/migrate/20190323181453_add_activated_fields.rb +0 -7
 - data/sample_apps/sample_app_activerecord/db/schema.rb +0 -29
 - data/sample_apps/sample_app_activerecord/spec/api/root_spec.rb +0 -16
 - data/sample_apps/sample_app_activerecord/spec/commands/help_spec.rb +0 -14
 - data/sample_apps/sample_app_activerecord/spec/commands/whoami_spec.rb +0 -14
 - data/sample_apps/sample_app_activerecord/spec/spec_helper.rb +0 -19
 - data/sample_apps/sample_app_mongoid/.rspec +0 -3
 - data/sample_apps/sample_app_mongoid/Gemfile +0 -20
 - data/sample_apps/sample_app_mongoid/Procfile +0 -1
 - data/sample_apps/sample_app_mongoid/README.md +0 -14
 - data/sample_apps/sample_app_mongoid/Rakefile +0 -10
 - data/sample_apps/sample_app_mongoid/commands.rb +0 -2
 - data/sample_apps/sample_app_mongoid/commands/help.rb +0 -19
 - data/sample_apps/sample_app_mongoid/commands/whoami.rb +0 -6
 - data/sample_apps/sample_app_mongoid/config.ru +0 -14
 - data/sample_apps/sample_app_mongoid/config/mongoid.yml +0 -27
 - data/sample_apps/sample_app_mongoid/config/newrelic.yml +0 -217
 - data/sample_apps/sample_app_mongoid/spec/api/root_spec.rb +0 -16
 - data/sample_apps/sample_app_mongoid/spec/commands/help_spec.rb +0 -14
 - data/sample_apps/sample_app_mongoid/spec/commands/whoami_spec.rb +0 -14
 - 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
         
     |