fast_ci 1.1.1 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cde3318f98f75d587d3151007dd38a0336106709b3df12bc971fc720275adc64
4
- data.tar.gz: a600f3f55cdf8c479b9b9f555e3a9818d2a26113af146994c5ce809c38b928da
3
+ metadata.gz: 76c1186cf1228f3465acc2228203c51070ac0c80c18f567dec89d7bdcacca0c2
4
+ data.tar.gz: 15ab92271b656e5020a52f8b98fb1d53f587d7626f3c6035aa426b0cf57707f7
5
5
  SHA512:
6
- metadata.gz: 654096c3ac8764a47cf7122a66e6b931fe349fffea27e37cbe1875de914efe9d3acad2fe319783fbd0c0651099fb23e510324ad399b8835980b58b070be7e65e
7
- data.tar.gz: fe743b69df08bd40150ad3d09a93e468b81217a36462d5c3e872db32351aa9b74ed11dad06e70f8574cb211cf5e32ac38e573d5e3681b4e0682e0d14d8590632
6
+ metadata.gz: bab65efe177bb36d558cd3d50977b11cf2422aed04c70791bac94b1f62d5e533099e7cdf0d3123363da31cbed50c57b472b23e00d67a6b3c474b03999d2fc4b3
7
+ data.tar.gz: db5e94d7764901155fe12199da461dfd7da3a72155de0a1f918f07fe8897202b6c55e3a92b62e08560e1b462979fc8b4c7842bd3f539f7cf012134506ce9a50e
data/Gemfile.lock CHANGED
@@ -11,7 +11,7 @@ GIT
11
11
  PATH
12
12
  remote: .
13
13
  specs:
14
- fast_ci (1.1.1)
14
+ fast_ci (1.2.0)
15
15
  async-websocket (<= 0.20.0)
16
16
  brakeman (>= 5.4.1)
17
17
  console (>= 1.10.0)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FastCI
4
- VERSION = "1.1.1"
4
+ VERSION = "1.2.0"
5
5
  end
data/lib/fast_ci.rb CHANGED
@@ -124,9 +124,9 @@ module FastCI
124
124
  @on[event] = block
125
125
  end
126
126
 
127
- def send_msg(event, payload = {})
127
+ def send_msg(event, payload = {}, custom_topic = nil)
128
128
  FastCI.debug("ws#send_msg: #{event} -> #{payload.inspect}")
129
- connection.write({ "topic": topic, "event": event, "payload": payload, "ref": ref })
129
+ connection.write({ "topic": custom_topic || topic, "event": event, "payload": payload, "ref": ref })
130
130
  connection.flush
131
131
  end
132
132
 
@@ -159,6 +159,20 @@ module FastCI
159
159
  end
160
160
  end
161
161
 
162
+ def start_heartbeat
163
+ Async do
164
+ loop do
165
+ sleep 30
166
+ send_heartbeat
167
+ end
168
+ end
169
+ end
170
+
171
+ def send_heartbeat
172
+ FastCI.debug("Sending heartbeat")
173
+ send_msg("heartbeat", {}, "phoenix")
174
+ end
175
+
162
176
  def await(retry_count = 0)
163
177
  connect_to_ws do
164
178
  send_msg("phx_join")
@@ -216,6 +230,7 @@ module FastCI
216
230
 
217
231
  # https://github.com/bblimke/webmock/blob/b709ba22a2949dc3bfac662f3f4da88a21679c2e/lib/webmock/http_lib_adapters/async_http_client_adapter.rb#L8
218
232
  def after_start_connection
233
+ start_heartbeat
219
234
  if defined?(WebMock::HttpLibAdapters::AsyncHttpClientAdapter)
220
235
  WebMock::HttpLibAdapters::AsyncHttpClientAdapter.enable!
221
236
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fast_ci
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nesha Zoric
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-20 00:00:00.000000000 Z
11
+ date: 2025-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: console
@@ -174,7 +174,7 @@ metadata:
174
174
  homepage_uri: https://github.com/RubyCI/fast_ci_gem
175
175
  source_code_uri: https://github.com/RubyCI/fast_ci_gem
176
176
  changelog_uri: https://github.com/RubyCI/fast_ci_gem
177
- post_install_message:
177
+ post_install_message:
178
178
  rdoc_options: []
179
179
  require_paths:
180
180
  - lib
@@ -190,7 +190,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
190
190
  version: '0'
191
191
  requirements: []
192
192
  rubygems_version: 3.2.3
193
- signing_key:
193
+ signing_key:
194
194
  specification_version: 4
195
195
  summary: Ruby wrapper for creating FastCI integrations
196
196
  test_files: []