lib/boned/cli.rb in boned-0.2.1 vs lib/boned/cli.rb in boned-0.2.2

- old
+ new

@@ -2,26 +2,30 @@ require 'pp' class Boned::CLI < Drydock::Command attr_accessor :exit_code - def init - Boned.connect - end def start + Boned.connect if Boned.service_available?('127.0.0.1', server_opts[:port]) raise Boned::Server::ServerRunning, server_opts[:port] end Boned::Controllers::Controller.new(server_opts).start end def stop - Boned.stop_redis + Boned.connect(false) + Boned.stop_redis if not Boned.service_available?('127.0.0.1', server_opts[:port]) raise Boned::Server::ServerNotRunning, server_opts[:port] end Boned::Controllers::Controller.new(server_opts).stop + end + + def stop_redis + Boned.connect(false) + Boned.stop_redis end def info require 'yaml' if Boned.service_available?('127.0.0.1', server_opts[:port]) \ No newline at end of file