Sha256: 0005d8d3c340192ca44f598859371302110683efc41677276756d84f27362311

Contents?: true

Size: 514 Bytes

Versions: 9

Compression:

Stored size: 514 Bytes

Contents

require "socrates/adapters/console"
require "socrates/core/dispatcher"

module Socrates
  module Bots
    class CLI
      def initialize(adapter: nil, state_factory:)
        @adapter    = adapter || Adapters::Console.new
        @dispatcher = Core::Dispatcher.new(adapter: @adapter, state_factory: state_factory)
      end

      def start
        context = { channel: "CONSOLE" }

        while (input = gets.chomp)
          @dispatcher.dispatch(input, context: context)
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
socrates-0.1.25 lib/socrates/bots/cli.rb
socrates-0.1.24 lib/socrates/bots/cli.rb
socrates-0.1.23 lib/socrates/bots/cli.rb
socrates-0.1.22 lib/socrates/bots/cli.rb
socrates-0.1.21 lib/socrates/bots/cli.rb
socrates-0.1.20 lib/socrates/bots/cli.rb
socrates-0.1.19 lib/socrates/bots/cli.rb
socrates-0.1.18 lib/socrates/bots/cli.rb
socrates-0.1.17 lib/socrates/bots/cli.rb