openhab-scripting 3.7.2 → 3.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/openhab/dsl/monkey_patch/ruby/number.rb +50 -6
- data/lib/openhab/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03f4915cdcccdf7e6d5f509d93cfba5daae5ca85c9e355413d2d78f270bb9584
|
4
|
+
data.tar.gz: f2d8b6ac6296a51dbf27d0047095397817a479cf3af16661d4fbf9c73d74911d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ae48d6b88bfcb037a90e6531fe5dca9da08139337d153ec64eae50bd75ec594eaddd2b87344e97cdd1d3f65a415a89e98c2b87dc1149fa56d8b5720619a120d
|
7
|
+
data.tar.gz: 37b692b154064290cb16203313652efff3e93358f74b4de71fc3b4ef51b1633dd4711f05f46b86d0588b17683e3bef68784aca9299017368ebac0b920c6d2c60
|
@@ -26,14 +26,58 @@ module OpenHAB
|
|
26
26
|
alias minute minutes
|
27
27
|
alias hour hours
|
28
28
|
end
|
29
|
+
|
30
|
+
#
|
31
|
+
# Extend float to create duration object
|
32
|
+
#
|
33
|
+
module FloatExtensions
|
34
|
+
#
|
35
|
+
# Create Duration with number of milliseconds
|
36
|
+
#
|
37
|
+
# @return [Java::JavaTime::Duration] Duration truncated to an integral number of milliseconds from self
|
38
|
+
#
|
39
|
+
def millis
|
40
|
+
Java::JavaTime::Duration.of_millis(to_i)
|
41
|
+
end
|
42
|
+
|
43
|
+
#
|
44
|
+
# Create Duration with number of seconds
|
45
|
+
#
|
46
|
+
# @return [Java::JavaTime::Duration] Duration with number of seconds from self
|
47
|
+
#
|
48
|
+
def seconds
|
49
|
+
(self * 1000).millis
|
50
|
+
end
|
51
|
+
|
52
|
+
#
|
53
|
+
# Create Duration with number of minutes
|
54
|
+
#
|
55
|
+
# @return [Java::JavaTime::Duration] Duration with number of minutes from self
|
56
|
+
#
|
57
|
+
def minutes
|
58
|
+
(self * 60).seconds
|
59
|
+
end
|
60
|
+
|
61
|
+
#
|
62
|
+
# Create Duration with number of hours
|
63
|
+
#
|
64
|
+
# @return [Java::JavaTime::Duration] Duration with number of hours from self
|
65
|
+
#
|
66
|
+
def hours
|
67
|
+
(self * 60).minutes
|
68
|
+
end
|
69
|
+
|
70
|
+
alias second seconds
|
71
|
+
alias millisecond millis
|
72
|
+
alias milliseconds millis
|
73
|
+
alias ms millis
|
74
|
+
alias minute minutes
|
75
|
+
alias hour hours
|
76
|
+
end
|
29
77
|
end
|
30
78
|
end
|
31
79
|
end
|
32
80
|
end
|
33
81
|
|
34
|
-
|
35
|
-
|
36
|
-
#
|
37
|
-
class Integer
|
38
|
-
prepend OpenHAB::DSL::MonkeyPatch::Ruby::IntegerExtensions
|
39
|
-
end
|
82
|
+
Integer.prepend(OpenHAB::DSL::MonkeyPatch::Ruby::IntegerExtensions)
|
83
|
+
Float.prepend(OpenHAB::DSL::MonkeyPatch::Ruby::FloatExtensions)
|
data/lib/openhab/version.rb
CHANGED
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: 3.
|
4
|
+
version: 3.8.1
|
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: 2021-09-
|
11
|
+
date: 2021-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|