openhab-scripting 4.8.5 → 4.9.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: 19b14c62e681500abaa99858522f7592e0a4d93f6966a5cf8e99157b0944cbe6
4
- data.tar.gz: 071556f83604d539af3620a0796eef993edfc0bb224ad3dd08cf7d5a71e9d593
3
+ metadata.gz: 18381f7d16d590838748802e7535c611279c6b251fc5f782f9f11247f856074b
4
+ data.tar.gz: 1f339a40040d41445020eb2a460269eba1088554034a064c1a335e2e85f17be4
5
5
  SHA512:
6
- metadata.gz: '01429a840f1af1e81886988f00ad628fa01dd7a7423ef2e20c59eb1d40822b573115d12a0c8c6fc093012ad29a70666bf280de52a789a8dc8cf6b0c7d2eb1867'
7
- data.tar.gz: 28aab00e8742851f08fee9535b39c913f78f4c7200f2bdbd8788e4d6c8ac8ae6f202a7f3e4675e0e02af2bbc953b6a10114b93987eff5c6ec37e1d6ad0f8ddeb
6
+ metadata.gz: 3611a93e20e13b0c5a63354e8c1082466f279e7a9b83b5c352a2b357e09f45411035c6bb1baa79575f1c7e9480ae66a9f651a635dba3130b791dcdf9eb3c4f32
7
+ data.tar.gz: 69f57f2931d50f868742682fa8d400348dc93670dd8ba6f6172477bbc02d9e297203d6466030c52d6055cae740b1fa8f05e8889faf7bef655d650105587ccfc5
@@ -13,13 +13,13 @@ module OpenHAB
13
13
  include OpenHAB::DSL::Rules::Property
14
14
 
15
15
  prop_array(:only_if) do |item|
16
- unless item.is_a?(Proc) || item.respond_to?(:truthy?)
16
+ unless item.is_a?(Proc) || [item].flatten.all? { |it| it.respond_to?(:truthy?) }
17
17
  raise ArgumentError, "Object passed to only_if must respond_to 'truthy?'"
18
18
  end
19
19
  end
20
20
 
21
21
  prop_array(:not_if) do |item|
22
- unless item.is_a?(Proc) || item.respond_to?(:truthy?)
22
+ unless item.is_a?(Proc) || [item].flatten.all? { |it| it.respond_to?(:truthy?) }
23
23
  raise ArgumentError, "Object passed to not_if must respond_to 'truthy?'"
24
24
  end
25
25
  end
@@ -113,7 +113,7 @@ module OpenHAB
113
113
  # @return [Boolean] True if criteria are satisfied, false otherwise
114
114
  #
115
115
  def process_not_if(event, items, procs)
116
- items.none?(&:truthy?) && procs.none? { |proc| proc.call(event) }
116
+ items.flatten.none?(&:truthy?) && procs.none? { |proc| proc.call(event) }
117
117
  end
118
118
 
119
119
  #
@@ -126,7 +126,7 @@ module OpenHAB
126
126
  # @return [Boolean] True if criteria are satisfied, false otherwise
127
127
  #
128
128
  def process_only_if(event, items, procs)
129
- items.all?(&:truthy?) && procs.all? { |proc| proc.call(event) }
129
+ items.flatten.all?(&:truthy?) && procs.all? { |proc| proc.call(event) }
130
130
  end
131
131
  end
132
132
  end
@@ -5,5 +5,5 @@
5
5
  #
6
6
  module OpenHAB
7
7
  # @return [String] Version of OpenHAB helper libraries
8
- VERSION = '4.8.5'
8
+ VERSION = '4.9.0'
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.5
4
+ version: 4.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian O'Connell