et-orbi 1.2.9 → 1.2.11

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: 435f9eb2e9b27822b9ee161fbe2449375cb710e1e01b8f3313c61983424aba85
4
- data.tar.gz: a72603974625eb4e8c49e89c3a317002ea8661adbaa461c2d143450bd8b9c40a
3
+ metadata.gz: c7f008f08099e4efe55b1cdeef327f9dd043703196609615e52ec20499db141e
4
+ data.tar.gz: d7d636ce1eaf898dbf76b8d8c94ea3aeaab02a462e9e646ead51502f975dcb93
5
5
  SHA512:
6
- metadata.gz: b45a1917c605b29254c97d5ab27d1b5e894cb2e9ed01b27594a19b8a52fc16c18fe6f59d56a362cedc0e0d3131278ec2d0d288427a132ce2b5152a7b0404ab22
7
- data.tar.gz: dd28bbd9b3fe1ad3feb0088284a01f909453afd1ae56ba3c910215d85d9af793fdf3042adc27fa1789bc646412abb2643f0543c1b7bb2fa8e02aa50a57771f33
6
+ metadata.gz: c3fbfbef817e8c176a66d38edac9924e8f557fbb12bceddc42249bdd773f74b1fa3792f6a3c7cfff1f3ecd1bf13ff293de7baa0f84da3418cd171574d8984c40
7
+ data.tar.gz: 2c3176e291230ad074b11d475a823cfa6cbce12cd55295337fcf1c36a9bdf7b35453801d3d940bd72308420594afae61a31a96ff4282fc0e9cc966c02d3ddfaf
data/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
2
2
  # CHANGELOG.md
3
3
 
4
4
 
5
+ ## et-orbi 1.2.11 released 2024-03-23
6
+
7
+ - Cache @rweek and @rday, not @ref, gh-38
8
+
9
+
10
+ ## et-orbi 1.2.10 released 2024-03-22
11
+
12
+ - Refine #rweek computation, aim more at noon instead of midnight, gh-38
13
+
14
+
5
15
  ## et-orbi 1.2.9 released 2024-03-13
6
16
 
7
17
  - Refine #rweek computation, aim at noon instead of midnight, gh-38
data/CREDITS.md CHANGED
@@ -1,15 +1,15 @@
1
1
 
2
2
  # et-orbi credits
3
3
 
4
- * Benjami Darcet @bdarcet https://github.com/floraison/fugit/issues/67 gh-38
5
- * @franckduche https://github.com/floraison/fugit/issues/67 gh-38
4
+ * Benjami Darcet https://github.com/bdarcet https://github.com/floraison/fugit/issues/67 gh-38
5
+ * https://github.com/franckduche https://github.com/floraison/fugit/issues/67 gh-38
6
6
  * Igor Viktor https://github.com/gogainda gh-34
7
7
  * phibid, for https://github.com/floraison/fugit/issues/67
8
8
  * Peter Goldstein, https://github.com/petergoldstein GHA 3.3 j9.3, gh-32
9
- * harsha-flipp (https://github.com/harsha-flipp) https://github.com/floraison/fugit/issues/63
10
- * adank92 (https://github.com/adank92) https://github.com/ondrejbartas/sidekiq-cron/issues/276 gh-28
11
- * Stan Hu (https://github.com/stanhu) Chronic toubles, gh-24, gh-26, etc
12
- * d-m-u (https://github.com/d-m-u) EoTime#==(Time), gh-20, gh-7
9
+ * harsha-flipp https://github.com/harsha-flipp https://github.com/floraison/fugit/issues/63
10
+ * adank92 https://github.com/adank92 https://github.com/ondrejbartas/sidekiq-cron/issues/276 gh-28
11
+ * Stan Hu https://github.com/stanhu Chronic toubles, gh-24, gh-26, etc
12
+ * d-m-u https://github.com/d-m-u EoTime#==(Time), gh-20, gh-7
13
13
  * Vais Salikhov (https://github.com/vais) missing US timezone aliases, gh-18 gh-19
14
14
  * Wenhui Wang https://github.com/w11th .parse vs Chronic+ActiveSupport, fugit 11
15
15
  * Marcel https://github.com/MTRNord "Mitteleuropaeische Sommerzeit", gh-15
data/lib/et-orbi/time.rb CHANGED
@@ -96,7 +96,8 @@ module EtOrbi
96
96
  def touch
97
97
 
98
98
  @time = nil
99
- @ref = nil
99
+ @rday = nil
100
+ @rweek = nil
100
101
  end
101
102
 
102
103
  def seconds=(f)
@@ -353,18 +354,24 @@ module EtOrbi
353
354
  #
354
355
  def rweek
355
356
 
356
- @ref ||= EtOrbi.make_time('2019-01-01 12:00:00', @zone)
357
-
358
- ((self - @ref) / WEEK_S).floor + 1
357
+ @rweek ||=
358
+ begin
359
+ ref = EtOrbi.make_time('2019-01-01 12:00:00', @zone)
360
+ noon = EtOrbi.make_time(strftime('%F 12:00:00'), @zone)
361
+ ((noon - ref) / WEEK_S).floor + 1
362
+ end
359
363
  end
360
364
 
361
365
  # "reference week", used in fugit for cron modulo notation
362
366
  #
363
367
  def rday
364
368
 
365
- @ref ||= EtOrbi.make_time('2019-01-01 00:00:00', @zone)
366
-
367
- ((self - @ref) / DAY_S).floor + 1
369
+ @rday ||=
370
+ begin
371
+ ref = EtOrbi.make_time('2019-01-01 12:00:00', @zone)
372
+ noon = EtOrbi.make_time(strftime('%F 12:00:00'), @zone)
373
+ ((noon - ref) / DAY_S).floor + 1
374
+ end
368
375
  end
369
376
 
370
377
  def reach(points)
data/lib/et-orbi.rb CHANGED
@@ -13,6 +13,6 @@ require 'et-orbi/zone'
13
13
 
14
14
  module EtOrbi
15
15
 
16
- VERSION = '1.2.9'
16
+ VERSION = '1.2.11'
17
17
  end
18
18
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: et-orbi
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.9
4
+ version: 1.2.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Mettraux
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-13 00:00:00.000000000 Z
11
+ date: 2024-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tzinfo