fancybox2 0.0.2 → 0.0.3

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: 45c38b5bf5cf22c421a61cd6ebcf5e09802d92047fb02f74a53ea97a5cd2a0d1
4
- data.tar.gz: fda98ad8a2a41d27e6d84a278e74d5d29aab5e97934d1e4794aaddc8ca24947b
3
+ metadata.gz: b5f1b63c49186562a7754d3a1674d201202f8cfa2fa83b009d148b8036514a41
4
+ data.tar.gz: d91b6945428ab9b366ecd29dcf4f56eced667f129592cf48b39888bd114b360f
5
5
  SHA512:
6
- metadata.gz: 75b363b07e701e3d143d0055cab28acbfc39e00121d41a26d56f3d2fd84fbb5be895f973b53987a5830ed2e242148f8a5cfdd8eca8f1217768af5fde108c9b5c
7
- data.tar.gz: cfa1d5b4a6501bbddf1923937e1d6c1a9e804bbc6244052ebc045099f2538c72fd2e0d631413516e76420b05b0a7845f7fab830c157b0f14f51c74aaa5e4d373
6
+ metadata.gz: 6f03ac7a8f28b7dc5ce77ce4e77e71f623a94a5ccfa30bb472d4408e8c0cb5d07334166864474c514f4f72f74f9010b8aa7a1b0f785a87e93845af986f6113d5
7
+ data.tar.gz: e5df22e0bc8a716cc16cbfe0d0c696560ead8923b9bb9b41b431284e11574fe389ce9980e54943cc8dc314266c9761c010a626945206f7c5368214a88241a0e0
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'zeitwerk'
2
4
  require 'logger'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Array
2
4
  # Extracts options from a set of arguments. Removes and returns the last
3
5
  # element in the array if it's a hash, otherwise returns a blank hash.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # :nocov:
2
4
  class Hash
3
5
  # Returns a new hash with all keys converted using the block operation.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'logger'
2
4
  require 'json'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Fancybox2
2
4
  module Logger
3
5
  class MQTTLogDevice
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Fancybox2
2
4
  module Logger
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'json'
2
4
  require 'yaml'
3
5
  require 'logger'
@@ -228,14 +230,17 @@ module Fancybox2
228
230
  def start_sending_alive(interval: 5000)
229
231
  # TODO: replace the alive interval task with Eventmachine?
230
232
  # Interval is expected to be msec, so convert it to secs
231
- interval /= 1000
233
+ interval /= 1000.0
232
234
  @alive_task.shutdown if @alive_task
233
235
  @alive_task = Concurrent::TimerTask.new(execution_interval: interval, timeout_interval: 2, run_now: true) do
234
- packet = { status: @status, lastSeen: Time.now.utc }
235
- if @alive_message_data
236
- packet[:data] = @alive_message_data.call
236
+ packet = { status: @status, lastSeen: Time.now.utc, data: nil }
237
+ begin
238
+ packet[:data] = alive_message_data
239
+ message_to :core, :alive, packet
240
+ rescue StandardError => e
241
+ logger.error "Error in alive_message_data callback: #{e.message}"
242
+ logger.error e.backtrace.join "\n"
237
243
  end
238
- message_to :core, :alive, packet
239
244
  end
240
245
  @alive_task.execute
241
246
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Fancybox2
2
4
  module Module
3
5
  class Config
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Fancybox2
2
4
  module Module
3
5
  module Exceptions
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Fancybox2
2
- VERSION = '0.0.2'
4
+ VERSION = '0.0.3'
3
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fancybox2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alessandro Verlato
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-15 00:00:00.000000000 Z
11
+ date: 2020-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: zeitwerk