ruby_ci 0.2.7 → 0.2.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ruby_ci/version.rb +1 -1
  3. data/lib/ruby_ci.rb +25 -22
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2441626a4b8a03996716c6932e0914bb851eebd62a39b8ce2c8e5282f3abe906
4
- data.tar.gz: 2942c029042f0a38d533b8410e280e0fc94cf18b9a8871012f3a5d5328a0f44d
3
+ metadata.gz: 2920f9bf7f47278319623491a637407d94b46160479c83d0f94d96d1652ba139
4
+ data.tar.gz: 9ae3ab078220371e34526bd53d47e2e57aba01fc39fd49709b00fdb43737027b
5
5
  SHA512:
6
- metadata.gz: b2bb8f6a266af27120f648ed3a3225d117a4abea4e0ac1ca5f9453a18389ce388f292aa71bbc2349c7252253d732a07855b37a9751fe28475913973f4a63e5ea
7
- data.tar.gz: b1a433532873916bfe8b0beef1f5e953a77bc69ed143a6bac1e5c018d1c26724f6aa5eed42b39d9334806ab9eeddcd0532210629577ed461022afa865c9d8c6e
6
+ metadata.gz: eff0af87982d50bec4da005de4179b9cdebfc18cc0b8b2bba776d328f37a6c499695f80e9bb73afd2c3a67742b4f12356f037f1d7f9d1ded8e8021f0bb29d444
7
+ data.tar.gz: 308527f4679a5489a7ab5b3c387f841869f128ab3e93c438faf78477233e53b08ad2803445d617bf81ad167e2f9103b996014b9bed29c56a3fda6550e7981901
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubyCI
4
- VERSION = "0.2.7"
4
+ VERSION = "0.2.9"
5
5
  end
data/lib/ruby_ci.rb CHANGED
@@ -121,35 +121,38 @@ module RubyCI
121
121
  connect_to_ws do
122
122
  send_msg("phx_join")
123
123
 
124
- while message = connection.read
125
- RubyCI.debug("ws#msg_received: #{message.inspect}")
126
-
127
- response = message.dig(:payload, :response)
128
-
129
- case response&.dig(:event) || message[:event]
130
- when "phx_error"
131
- raise("[RubyCI] Unexpected error")
132
- when "join"
133
- handle_join(response)
134
- when "deq_request"
135
- handle_deq_request(response)
136
- when "deq"
137
- if (tests = response[:tests]).any?
138
- result = @on[:deq].call(tests)
139
- task.async do
140
- send_msg("deq", result)
124
+ begin
125
+ while message = connection.read
126
+ RubyCI.debug("ws#msg_received: #{message.inspect}")
127
+
128
+ response = message.dig(:payload, :response)
129
+
130
+ case response&.dig(:event) || message[:event]
131
+ when "phx_error"
132
+ raise("[RubyCI] Unexpected error")
133
+ when "join"
134
+ handle_join(response)
135
+ when "deq_request"
136
+ handle_deq_request(response)
137
+ when "deq"
138
+ if (tests = response[:tests]).any?
139
+ result = @on[:deq].call(tests)
140
+ task.async do
141
+ send_msg("deq", result)
142
+ end
143
+ else
144
+ break
141
145
  end
146
+ when "error"
147
+ raise(response.inspect)
142
148
  else
143
- break
149
+ puts response
144
150
  end
145
- when "error"
146
- raise(response.inspect)
147
- else
148
- puts response
149
151
  end
150
152
  rescue => e
151
153
  puts e.message
152
154
  puts e.backtrace.join("\n")
155
+ task&.stop
153
156
  end
154
157
  end
155
158
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_ci
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ale ∴