exe/socrates in socrates-0.1.16 vs exe/socrates in socrates-0.1.17

- old
+ new

@@ -32,11 +32,11 @@ options[:debug] = true end end option_parser.parse! -def run_command(options) +def run_command(options) # rubocop:disable Metrics/MethodLength storage = case options[:storage] when "redis" Socrates::Storage::Redis.new(url: ENV.fetch("REDIS_URL", "redis://localhost")) else @@ -52,12 +52,18 @@ end end case (adapter = options[:adapter]) when "console" - Socrates::Bots::CLI.new(state_factory: Socrates::SampleStates::StateFactory.new).start + adapter = Socrates::Adapters::Console.new + adapter.add_user(id: 1, name: "joe", first: "Joe", last: "Smith", email: "joe@example.com") + adapter.add_user(id: 2, name: "rachel", first: "Rachel", last: "Doe", email: "rachel@example.com") + + Socrates::Bots::CLI.new(adapter: adapter, state_factory: Socrates::SampleStates::StateFactory.new).start + when "slack" Socrates::Bots::Slack.new(state_factory: Socrates::SampleStates::StateFactory.new).start + else puts "Unknown adapter '#{adapter}'" exit 1 end end