checkcheckit 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -50,14 +50,17 @@ class CheckCheckIt::Console
50
50
  puts "Live at URL: #{web_service_url}/#{list_id}"
51
51
 
52
52
  if @options['ws']
53
- @client = web_socket.connect(web_service_url, sync: true) do
54
- after_start do
55
- emit('register', {list_id: list_id})
53
+ begin
54
+ @client = web_socket.connect(web_service_url, sync: true) do
55
+ after_start { emit('register', {list_id: list_id}) }
56
56
  end
57
+ rescue Errno::ECONNREFUSED => e
58
+ STDERR.puts "Websocket refused connection"
57
59
  end
58
60
  end
59
61
  end
60
62
 
63
+ return if @options['no-cli'] || @options['n']
61
64
  step_through_list(list)
62
65
  else
63
66
  puts "Could not find checklist via: #{target}"
@@ -160,12 +163,18 @@ class CheckCheckIt::Console
160
163
 
161
164
  # Returns id
162
165
  def notify_server_of_start(emails, list)
163
- Excon.post(web_service_url, :body => {
164
- emails: emails,
165
- list: list.to_h
166
- }.to_json,
167
- :headers => {
168
- 'Content-Type' => 'application/json'
169
- }).body.to_i
166
+ begin
167
+ response = Excon.post(web_service_url, :body => {
168
+ emails: emails,
169
+ list: list.to_h
170
+ }.to_json,
171
+ :headers => {
172
+ 'Content-Type' => 'application/json'
173
+ })
174
+ STDERR.puts response if @options['d'] || @options['debug']
175
+ return response.body.gsub('"','')
176
+ rescue Excon::Errors::SocketError => e
177
+ puts "Error connecting to #{web_service_url}"
178
+ end
170
179
  end
171
180
  end
@@ -1,3 +1,3 @@
1
1
  module CheckCheckIt
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: checkcheckit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-16 00:00:00.000000000 Z
12
+ date: 2012-12-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: lucy-goosey
@@ -114,7 +114,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
114
114
  version: '0'
115
115
  segments:
116
116
  - 0
117
- hash: 861194127315958268
117
+ hash: 3870174722211618529
118
118
  required_rubygems_version: !ruby/object:Gem::Requirement
119
119
  none: false
120
120
  requirements:
@@ -123,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
123
  version: '0'
124
124
  segments:
125
125
  - 0
126
- hash: 861194127315958268
126
+ hash: 3870174722211618529
127
127
  requirements: []
128
128
  rubyforge_project:
129
129
  rubygems_version: 1.8.23