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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9d03e0c2f0496021ac6e662b63d10dca97af04c504cee47ffeea6fbd436f4f86
4
- data.tar.gz: 0a5b7aa05457930b6e3165c6a90d795135838583fbaca0e0a9912e7f918694c2
3
+ metadata.gz: 17c37db68c0bd400f252a05376c97844c89287a062c0dc26ceb4e8b4fc53fe62
4
+ data.tar.gz: 9fd668c694f127adfe07bceb74765785d913bb65413b93330e6870e8ce8761ee
5
5
  SHA512:
6
- metadata.gz: eff09280b4e5054eee95423f6e4452e54531ea5829427b0a5d982a7698e75503918bbdf7e4fc1214c8a4710c121f53a508f705bbe768744a76ee49ecbdef34e4
7
- data.tar.gz: d52511df16c8acaf217278bb7fc222b3dda1fb557dbeffb1b37c8a9c10dce36cbef67b1785177238f359a7f33918a4ac28322198ac3f92f50845f2fee351376d
6
+ metadata.gz: 4b594ea96f955f07ad380ec021a6b330eb4ec569d92b9dc44897bdc46603431057db81c2091cefddab50d5d6ed1b12ad9cafd13be5fca20627bcaeb7f481cc15
7
+ data.tar.gz: 5b1910e5db2280d5e74a93ec7709c5ee7972ad1328b5de01c2c542f4c4c02b2e03bdfeeefd5ffd253078f8c65e4acc756d1ae606c116a1ba13d4f4f46ac67752
checksums.yaml.gz.sig CHANGED
@@ -1,2 +1,4 @@
1
- ������<�F?5�eg���LyɊ�^�A�ćeF�T����"H���?�<#V�ʯ&x�ҷy��Iw��-����{�e }/}�^��� 9�!�+_2�U��K(�An�� B͗Џf=x��G����� ]�&eMFG��CN)[�4;�������G8�H0�����k�<��P��z��ܞh:�m2�1�D$Á��
2
- ��G����n��j�g�d-w"��R���F��+�6�g�E{o��NI� GD�
1
+ 6��h';������Y=��Qb W5}X�я�iL|T�1 ��lbQ��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
@@ -2,6 +2,11 @@
2
2
 
3
3
  Nothing so far
4
4
 
5
+ ## 1.4.2
6
+
7
+ #### Changes
8
+ * Fix 00:00 vs. 24:00 calculation for times with time zones
9
+
5
10
  ## 1.4.1
6
11
 
7
12
  #### Changes
@@ -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('0000-01-01').freeze
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
- @time = ::Time.new(DATELESS_DATE.year, DATELESS_DATE.month, DATELESS_DATE.day, hour, min, 0, offset || 0).utc
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 > DATELESS_DATE.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
@@ -1,3 +1,3 @@
1
1
  module AIXM
2
- VERSION = "1.4.1".freeze
2
+ VERSION = "1.4.2".freeze
3
3
  end
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.1
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-02-27 00:00:00.000000000 Z
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