Sha256: 5a1baab24731223b5caeb42d5241e973bded38c7c0ee6e940fb8c271cd00c1c3

Contents?: true

Size: 461 Bytes

Versions: 1

Compression:

Stored size: 461 Bytes

Contents

module Lita
  module Handlers
    class Redis < Handler
      route /^redis /, :send, command: true, restrict_to: :admins, help: {'redis COMMAND [ARG ...]' => 'Sends a COMMAND to Redis with ARG.'}

      def send(response)
        command, *args = response.args

        ret = Lita.redis.__send__(command, *args)

        response.reply ret.inspect
      rescue => e
        response.reply e.message
      end
    end

    Lita.register_handler Redis
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lita-redis-0.1.0 lib/lita/handlers/redis.rb