lib/socrates/bots/cli_bot.rb in socrates-0.1.1 vs lib/socrates/bots/cli_bot.rb in socrates-0.1.2

- old
+ new

@@ -1,16 +1,13 @@ module Socrates module Bots class CLIBot - def initialize(state_factory:) - @adapter = ConsoleAdapter.new + def initialize(adapter:, state_factory:) + @adapter = adapter || Adapters::ConsoleAdapter.new @dispatcher = Core::Dispatcher.new(adapter: @adapter, state_factory: state_factory) end def start - # Clear out any remnants from previous runs. - @storage.clear(ConsoleAdapter::CLIENT_ID) - while (input = gets.chomp) @dispatcher.dispatch(message: input) end end end