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.
- checksums.yaml +4 -4
- data/lib/ruby_ci/version.rb +1 -1
- data/lib/ruby_ci.rb +25 -22
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2920f9bf7f47278319623491a637407d94b46160479c83d0f94d96d1652ba139
|
4
|
+
data.tar.gz: 9ae3ab078220371e34526bd53d47e2e57aba01fc39fd49709b00fdb43737027b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eff0af87982d50bec4da005de4179b9cdebfc18cc0b8b2bba776d328f37a6c499695f80e9bb73afd2c3a67742b4f12356f037f1d7f9d1ded8e8021f0bb29d444
|
7
|
+
data.tar.gz: 308527f4679a5489a7ab5b3c387f841869f128ab3e93c438faf78477233e53b08ad2803445d617bf81ad167e2f9103b996014b9bed29c56a3fda6550e7981901
|
data/lib/ruby_ci/version.rb
CHANGED
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
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
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
|
-
|
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
|