openhab-scripting 4.27.1 → 4.28.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: 7281829b6759d5f975fc84086826ed6a2712b841a41c47b1305eb37df54aa264
4
- data.tar.gz: c2002b1ba4a7f207c89355775fef67b30d28fa7c0dc8b0131785b8c5527988a5
3
+ metadata.gz: 738583da2cd48296525b6b6a2999fe1daba82b0cbb1c410beb7e3575fdf6afbb
4
+ data.tar.gz: e7d4ff645268380636f69bff6eec42d8b8f650784225afe9d456027b44e11d77
5
5
  SHA512:
6
- metadata.gz: 2f50fa017b7b74d18cf4419b9a28b25134c2d52b5e5871864b97dc1698b467e211dfc85a91a24f6b391584e2ca130c5596da7f894681fd0c2f85b3a446c983d3
7
- data.tar.gz: 658dd4e19e86c5629998023b415269c2c11891796020872e590f7cb85e69491046194db90ab2914cfbc38cbed77b0dec273040d107167239a7efa03d97de0ef1
6
+ metadata.gz: e06a080cedde9ffbb29983f087c93dff1533fe521112c1036015c1f42f93c5a9d164bd0c307d21109c8f3a6abe7cb74e0f63b144cd21d2f7086a1e03d0b9c545
7
+ data.tar.gz: e23ccc89ee67bc2152efaa91ff33157c74d99d244da3cc11b497b8500b094f40dfc66b61fcb04c18763fe53afaabccba8baa6f2bf05c9f3d5d194915255f8078
@@ -39,7 +39,7 @@ module OpenHAB
39
39
 
40
40
  if timer.respond_to? :id
41
41
  logger.trace("Adding #{timer} with id #{timer.id.inspect} timer ids")
42
- @timer_ids[timer.id] = Set.new unless @timer_ids[timer.id]
42
+ @timer_ids[timer.id] = TimerSet.new unless @timer_ids[timer.id]
43
43
  @timer_ids[timer.id] << timer
44
44
  end
45
45
 
@@ -87,6 +87,19 @@ module OpenHAB
87
87
  @timers.clear
88
88
  end
89
89
  end
90
+
91
+ #
92
+ # Provide additional methods for the timers set
93
+ #
94
+ class TimerSet < Set
95
+ #
96
+ # A shorthand to cancel all the timer objects held within the set
97
+ # so that timers[timer_id].cancel_all is equivalent to timers[timer_id].each(&:cancel)
98
+ #
99
+ def cancel_all
100
+ each(&:cancel)
101
+ end
102
+ end
90
103
  end
91
104
  end
92
105
  end
@@ -5,5 +5,5 @@
5
5
  #
6
6
  module OpenHAB
7
7
  # @return [String] Version of OpenHAB helper libraries
8
- VERSION = '4.27.1'
8
+ VERSION = '4.28.0'
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openhab-scripting
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.27.1
4
+ version: 4.28.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian O'Connell
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-01-10 00:00:00.000000000 Z
11
+ date: 2022-01-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler