openhab-scripting 4.6.1 → 4.6.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: e7e6ee3df4ad1f531639fff95e296f8ed489f5b4a47a01c713d63855b98b5e6c
4
- data.tar.gz: 8fe4c12aee553c1d8a4aba1509a0b90fb1fc40edc6f75c2b9c814b610e6b98a5
3
+ metadata.gz: 287e243222ea07f7a3157b208722d47f489f14456713ad86401292f6b2fda942
4
+ data.tar.gz: 44968c29cf24415646ebb27ce64c3894966c4e9f9707edcd303eb89d4a4b1f04
5
5
  SHA512:
6
- metadata.gz: f841778b56365cb9df2e8f3749d09c11626b2d528dcf6250d32b31e5733dfb9caead2a9987171808d20fdacd72fac62189f5391b538c48bc0e0e63c0b743a0ce
7
- data.tar.gz: b64a487d9d4a3d6fcf4d7c6e8137ec4237ad75d6756fdc5b91546616db14c21833cf52156c0edfacbdaa0dc58c92bba2028cec98d58bf3df2e00f770f0a93fbf
6
+ metadata.gz: 12ce91f43449208a374b04ab92171a93c4ab3b68f2fee8ce7f948f7bf21f2be4a8d967b8f5758be957f5ca36cac831ebcb5f184204d650ed50d1fb345b1c2f7a
7
+ data.tar.gz: d7da5a64ab6aef028308a998ea83a77da1d77d12cbccb24c34875f6e51a9c6360e204efd75287de4d4f1fbc17b9bcd722057da227821f519452945fb17fd1666
@@ -15,10 +15,11 @@ module OpenHAB
15
15
  include ComparableItem
16
16
 
17
17
  # apply meta-programming methods to including class
18
+ # @!visibility private
18
19
  def self.included(klass)
19
20
  klass.prepend ItemEquality # make sure this is first
20
21
  klass.extend Forwardable
21
- klass.delegate %i[+ - * / % | positive? negative? to_d to_f to_i to_int zero?] => :state
22
+ klass.delegate %i[+ - * / % | to_d to_f to_i to_int] => :state
22
23
  # remove the JRuby default == so that we can inherit the Ruby method
23
24
  klass.remove_method :==
24
25
  end
@@ -62,6 +63,16 @@ module OpenHAB
62
63
 
63
64
  super
64
65
  end
66
+
67
+ %i[positive? negative? zero?].each do |predicate|
68
+ class_eval <<~RUBY, __FILE__, __LINE__ + 1
69
+ def #{predicate} # def positive?
70
+ return false unless state? # return false unless state?
71
+ #
72
+ state.#{predicate} # state.positive?
73
+ end # end
74
+ RUBY
75
+ end
65
76
  end
66
77
  end
67
78
  end
@@ -5,5 +5,5 @@
5
5
  #
6
6
  module OpenHAB
7
7
  # @return [String] Version of OpenHAB helper libraries
8
- VERSION = '4.6.1'
8
+ VERSION = '4.6.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.6.1
4
+ version: 4.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian O'Connell