ruby_ci 0.2.6 → 0.2.8

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 +27 -22
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3635c09d11258f3e066c50631d7a25eb3946512ea3eedb4e35b9e240797b1f85
4
- data.tar.gz: fb84e77923af72c0c2b3568d87a3c78d2165c176b0c6dbb2a6e6124062a127bd
3
+ metadata.gz: a6400f3cec96d4e4cad018ad111d075613423b27f659a00c96c38b09fc16349f
4
+ data.tar.gz: 45860e320108093009e7420cbe3dea8851ef0caa859aac01c3322b4cede0c986
5
5
  SHA512:
6
- metadata.gz: 9efac45b1459e07557e0d766d767460b8ab179c1dd8c1afa7189d17b8067df2d790a34bc14c00d3f8a342b52b22905bf313fc63bdf8f0ecf0e9eb276da2ffcbe
7
- data.tar.gz: fe6fc89c19b6716cd9b132fdf3ef748859966318cbc6de6bb69e5fe5b9740b57b0c6049d415b97c6569913b5c5373aa51d2834e328245dd6e6273b271c5b6d48
6
+ metadata.gz: 3591fa2b255939128e10e7a100d5076f3e23b56a08774dc17d6d5f5aba3d857657bc4fb60ab5995949d19b5e2266eecb3a5aeeb87d19a9dc960c30d075eff063
7
+ data.tar.gz: 61eaf3ad2023d7b2720950a03b24dc1d050d6b3392d498800252ca5404e915c5705a52f3dab2fa7b2bcc378079aab7e3e7be7c6a0dbc9a4cf183af50ae1d54b9
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubyCI
4
- VERSION = "0.2.6"
4
+ VERSION = "0.2.8"
5
5
  end
data/lib/ruby_ci.rb CHANGED
@@ -121,32 +121,37 @@ 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
152
+ rescue => e
153
+ puts e.message
154
+ puts e.backtrace.join("\n")
150
155
  end
151
156
  end
152
157
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_ci
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ale ∴
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-25 00:00:00.000000000 Z
11
+ date: 2024-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: console