openhab-scripting 4.8.1 → 4.8.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4d0594ce30afe7ee9653b705d23d24bc48489f7c0d264a0dd246d59d4266dc82
4
- data.tar.gz: 2bec61de8afbaf4bbe180f510f6b797a9ab59449c506fc41f374d485c128698c
3
+ metadata.gz: 04e0efcb683ac15c3b82af5e7837412e84b1038a822468de155b5825068e9593
4
+ data.tar.gz: 8b2da1406b372c7164a47d3fec3ac5da4d35af8ee3ceb207148f977ad1cab91d
5
5
  SHA512:
6
- metadata.gz: 419fd04010222b680c6d8a3c6c5c78752add3a7d0912333e9623a20b4ffe83d8fcc5a3ec62c9df811e3fb794611e3d5bf8961776af9ee3d74c2239fd8c10160e
7
- data.tar.gz: f4e06ae879aee439acc8c6103093edd871f06e9c9ed89fb04fa74e5550849ea7e897e2e26b12c776aa93a2eacc4d9f0c00f2c3039ca73351e857cabd105d8577
6
+ metadata.gz: 2227a683fa379ca71f96cb1fd5ca0944906a7f94f3413d7d775a0082a99a62f53631215272db38c3ce85984e4ffcbe382d882ab3a3c76a7c06adac69354854e5
7
+ data.tar.gz: 91b9855912c8b309b01369f833a1c89845708c61beaf655d08965ab09dd5e0231eec4a6d508f9941934e9b4c8cda36c8ea88db74e7dbbfb9880f8cf233afc65d
@@ -21,7 +21,7 @@ module OpenHAB
21
21
  #
22
22
  #
23
23
  def update_from_file(file, mime_type: nil)
24
- file_data = IO.binread(file)
24
+ file_data = File.binread(file)
25
25
  mime_type ||= Marcel::MimeType.for(Pathname.new(file)) || Marcel::MimeType.for(file_data)
26
26
  update_from_bytes(file_data, mime_type: mime_type)
27
27
  end
@@ -77,7 +77,6 @@ module OpenHAB
77
77
  # Create the run queue based on guards
78
78
  #
79
79
  # @param [Map] inputs rule inputs
80
- #
81
80
  # @return [Queue] <description>
82
81
  #
83
82
  def create_queue(inputs)
@@ -243,6 +242,8 @@ module OpenHAB
243
242
  #
244
243
  # @return [Boolean] True if guards says rule should execute, false otherwise
245
244
  #
245
+ # rubocop:disable Metrics/MethodLength
246
+ # Loggging inflates method length
246
247
  def check_guards(event:)
247
248
  if @guard.should_run? event
248
249
  now = TimeOfDay::TimeOfDay.now
@@ -254,7 +255,10 @@ module OpenHAB
254
255
  logger.trace("Skipped execution of rule '#{name}' because of guard #{@guard}")
255
256
  end
256
257
  false
258
+ rescue StandardError => e
259
+ print_backtrace(e)
257
260
  end
261
+ # rubocop:enable Metrics/MethodLength
258
262
 
259
263
  #
260
264
  # Process the run queue
@@ -73,7 +73,7 @@ module OpenHAB
73
73
  return error if debug_enabled?
74
74
 
75
75
  if error.respond_to? :backtrace_locations
76
- backtrace = error.backtrace_locations.map(&:to_s).reject { |line| INTERNAL_CALL_REGEX.match? line }
76
+ backtrace = error.backtrace_locations.map(&:to_s).grep_v(INTERNAL_CALL_REGEX)
77
77
  error.set_backtrace(backtrace)
78
78
  elsif error.respond_to? :stack_trace
79
79
  backtrace = error.stack_trace.reject { |line| JAVA_INTERNAL_CALL_REGEX.match? line.to_s }
@@ -5,5 +5,5 @@
5
5
  #
6
6
  module OpenHAB
7
7
  # @return [String] Version of OpenHAB helper libraries
8
- VERSION = '4.8.1'
8
+ VERSION = '4.8.2'
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openhab-scripting
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.8.1
4
+ version: 4.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian O'Connell