aixm 1.4.1 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +4 -2
- data/CHANGELOG.md +5 -0
- data/lib/aixm/schedule/time.rb +9 -4
- data/lib/aixm/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17c37db68c0bd400f252a05376c97844c89287a062c0dc26ceb4e8b4fc53fe62
|
4
|
+
data.tar.gz: 9fd668c694f127adfe07bceb74765785d913bb65413b93330e6870e8ce8761ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b594ea96f955f07ad380ec021a6b330eb4ec569d92b9dc44897bdc46603431057db81c2091cefddab50d5d6ed1b12ad9cafd13be5fca20627bcaeb7f481cc15
|
7
|
+
data.tar.gz: 5b1910e5db2280d5e74a93ec7709c5ee7972ad1328b5de01c2c542f4c4c02b2e03bdfeeefd5ffd253078f8c65e4acc756d1ae606c116a1ba13d4f4f46ac67752
|
checksums.yaml.gz.sig
CHANGED
@@ -1,2 +1,4 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
6��h';������Y=��Qb� W5}X�я�iL|T�1��lb�Q��W1�
|
2
|
+
¼�{��]�jV�6
|
3
|
+
!c�%���R�y���7�-?���Qh�ܒ��i�����t�J`�����h�es1߫o7v�B�I��D����m�)���&h��Q���j�CG��iӌ>�DuE����
|
4
|
+
�`\
|
data/CHANGELOG.md
CHANGED
data/lib/aixm/schedule/time.rb
CHANGED
@@ -29,7 +29,7 @@ module AIXM
|
|
29
29
|
|
30
30
|
EVENTS = { sunrise: :up, sunset: :down }.freeze
|
31
31
|
PRECEDENCES = { first: :min, last: :max }.freeze
|
32
|
-
DATELESS_DATE = ::Date.parse('
|
32
|
+
DATELESS_DATE = ::Date.parse('0001-01-01').freeze
|
33
33
|
|
34
34
|
# @api private
|
35
35
|
attr_accessor :time
|
@@ -250,10 +250,15 @@ module AIXM
|
|
250
250
|
# @param hour [Integer, String]
|
251
251
|
# @param min [Integer, String]
|
252
252
|
# @param offset [Integer, String] either UTC offset in seconds
|
253
|
-
# (default: 0) or 'UTC'
|
253
|
+
# (default: 0), as '+01:00', '-0300' or 'UTC'
|
254
254
|
# @return [Time]
|
255
255
|
def set_time(hour, min, offset)
|
256
|
-
|
256
|
+
# TODO: Colon-workaround can be removed when support of Ruby 3.0 has ended
|
257
|
+
coloned_offset = offset.is_a?(String) ? offset.sub(/([+-]\d{2})(\d{2})/, '\1:\2') : offset
|
258
|
+
utc = ::Time.new(1, 1, 1, hour, min, 0, coloned_offset || 0).utc
|
259
|
+
# utc = ::Time.new(1, 1, 1, hour, min, 0, offset || 0).utc
|
260
|
+
day_shift = utc.hour.zero? && utc.min.zero? && hour.to_i >= 12 ? 1 : 0
|
261
|
+
@time = ::Time.utc(DATELESS_DATE.year, DATELESS_DATE.month, DATELESS_DATE.day + day_shift, utc.hour, utc.min, 0)
|
257
262
|
end
|
258
263
|
|
259
264
|
def event=(value)
|
@@ -267,7 +272,7 @@ module AIXM
|
|
267
272
|
end
|
268
273
|
|
269
274
|
def end_of_day?
|
270
|
-
@time.day
|
275
|
+
@time.day != DATELESS_DATE.day
|
271
276
|
end
|
272
277
|
|
273
278
|
# @note Necessary to use this class in Range.
|
data/lib/aixm/version.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aixm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sven Schwyn
|
@@ -29,7 +29,7 @@ cert_chain:
|
|
29
29
|
kAyiRqgxF4dJviwtqI7mZIomWL63+kXLgjOjMe1SHxfIPo/0ji6+r1p4KYa7o41v
|
30
30
|
fwIwU1MKlFBdsjkd
|
31
31
|
-----END CERTIFICATE-----
|
32
|
-
date: 2023-
|
32
|
+
date: 2023-03-06 00:00:00.000000000 Z
|
33
33
|
dependencies:
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: nokogiri
|
metadata.gz.sig
CHANGED
Binary file
|