lib/checkcheckit/console.rb in checkcheckit-0.1.2 vs lib/checkcheckit/console.rb in checkcheckit-0.1.3
- old
+ new
@@ -1,8 +1,9 @@
require 'ostruct'
require 'uri'
+# Uses the "big bowl of pudding' architecture
class CheckCheckIt::Console
attr_accessor :list_dir
attr_accessor :out_stream, :in_stream, :web_socket
def initialize(opts = {})
@@ -49,20 +50,21 @@
if @options['open'] || @options['O']
Process.detach fork{ exec("open #{url}") }
end
+ return if @options['no-cli'] || @options['web-only']
+
begin
@client = web_socket.connect(web_service_url, sync: true) do
after_start { emit('register', {list_id: list_id}) }
end
rescue Errno::ECONNREFUSED, WebSocket::Error, RuntimeError => e
$stderr.puts "Websocket refused connection - using POST"
@use_post = true
end
end
- return if @options['no-cli'] || @options['web']
step_through_list(list)
else
puts "Could not find checklist via: #{target}"
end
end