et-orbi 1.2.7 → 1.2.8

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: 23ff138170f965f0a2dc35d38aaa08123ddfd97176d76f5e1b2136306eec812e
4
- data.tar.gz: 193d8bca6b8cfb34f023aadb504e127fd3f187eb64c10f546327510c8f487e04
3
+ metadata.gz: 149c5b95f1f67702640cb1b202d768bec7e215bb6335f9ec73f247d65edb6298
4
+ data.tar.gz: 6e559b757f53c60daef8be08c9c9af0d48378e203cc3d7cbb5582b4bb758b051
5
5
  SHA512:
6
- metadata.gz: 9a5747b65189567c49a9dda0936bac7d947deaa8a5067ba4d311d1c80032722baae682acfc111488d8c6b3139fa41238dfec645279983449312c6f5aa8881eb9
7
- data.tar.gz: 2173668af72a6c2aff4e992201d5c74ffe5f87023f6e52c4c42389c28bb8cab4a231c55142bbc9c12513173260c80bf3b372c0ccad555900f6a7efad01e35482
6
+ metadata.gz: 58d548986bc13f557c88cb862f52c10faa9211489a0daa0de7691eea5473905554a3257166d689c128d1a14d97c000713de17ee5064c557eaf601f718ee26b2b
7
+ data.tar.gz: 4919107bc2091bb8be87af751e86f75bf99f5f29fae457f12321b85bfc38ec38ad47a533e4a706f27bbd409b0bd92e479c9f44b9b01f5dc2adc18a839b2232cc
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
  # CHANGELOG.md
3
3
 
4
4
 
5
+ ## et-orbi 1.2.8 released 2024-03-11 (13 years)
6
+
7
+ - Cache the @ref time used in the #rweek and #rday computation
8
+
9
+
5
10
  ## et-orbi 1.2.7 released 2022-03-09
6
11
 
7
12
  - Fix the wday_in_month computation for floraison/fugit#67
data/CREDITS.md CHANGED
@@ -1,6 +1,7 @@
1
1
 
2
2
  # et-orbi credits
3
3
 
4
+ * Igor Viktor https://github.com/gogainda gh-34
4
5
  * phibid, for https://github.com/floraison/fugit/issues/67
5
6
  * Peter Goldstein, https://github.com/petergoldstein GHA 3.3 j9.3, gh-32
6
7
  * harsha-flipp (https://github.com/harsha-flipp) https://github.com/floraison/fugit/issues/63
data/LICENSE.txt CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- Copyright (c) 2017-2022, John Mettraux, jmettraux+flor@gmail.com
2
+ Copyright (c) 2017-2024, John Mettraux, jmettraux+flor@gmail.com
3
3
 
4
4
  Permission is hereby granted, free of charge, to any person obtaining a copy
5
5
  of this software and associated documentation files (the "Software"), to deal
data/Makefile CHANGED
@@ -1,10 +1,10 @@
1
1
 
2
2
  ## gem tasks ##
3
3
 
4
- NAME = \
5
- $(shell ruby -e "s = eval(File.read(Dir['*.gemspec'][0])); puts s.name")
6
- VERSION = \
7
- $(shell ruby -e "s = eval(File.read(Dir['*.gemspec'][0])); puts s.version")
4
+ NAME != \
5
+ ruby -e "s = eval(File.read(Dir['*.gemspec'][0])); puts s.name"
6
+ VERSION != \
7
+ ruby -e "s = eval(File.read(Dir['*.gemspec'][0])); puts s.version"
8
8
 
9
9
  count_lines:
10
10
  find lib -name "*.rb" | xargs cat | ruby -e "p STDIN.readlines.count { |l| l = l.strip; l[0, 1] != '#' && l != '' }"
data/README.md CHANGED
@@ -3,7 +3,6 @@
3
3
 
4
4
  [![tests](https://github.com/floraison/et-orbi/workflows/test/badge.svg)](https://github.com/floraison/et-orbi/actions)
5
5
  [![Gem Version](https://badge.fury.io/rb/et-orbi.svg)](http://badge.fury.io/rb/et-orbi)
6
- [![Join the chat at https://gitter.im/floraison/fugit](https://badges.gitter.im/floraison/fugit.svg)](https://gitter.im/floraison/fugit?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
7
6
 
8
7
  Time zones for [fugit](https://github.com/floraison/fugit) and for [rufus-scheduler](https://github.com/jmettraux/rufus-scheduler). Urbi et Orbi.
9
8
 
data/lib/et-orbi/time.rb CHANGED
@@ -101,6 +101,8 @@ module EtOrbi
101
101
  def zone=(z)
102
102
 
103
103
  @time = nil
104
+ @ref = nil
105
+
104
106
  @zone = self.class.get_tzone(zone || :current)
105
107
  end
106
108
 
@@ -330,16 +332,22 @@ module EtOrbi
330
332
  - count_weeks(EtOrbi.make_time(strftime('%F 12:00:00 %/Z')) , 1) ]
331
333
  end
332
334
 
335
+ # "reference week", used in fugit for cron modulo notation
336
+ #
333
337
  def rweek
334
338
 
335
- ((self - EtOrbi.make_time('2019-01-01 00:00:00', @zone)) / WEEK_S)
336
- .floor + 1
339
+ @ref ||= EtOrbi.make_time('2019-01-01 00:00:00', @zone)
340
+
341
+ ((self - @ref) / WEEK_S).floor + 1
337
342
  end
338
343
 
344
+ # "reference week", used in fugit for cron modulo notation
345
+ #
339
346
  def rday
340
347
 
341
- ((self - EtOrbi.make_time('2019-01-01 00:00:00', @zone)) / DAY_S)
342
- .floor + 1
348
+ @ref ||= EtOrbi.make_time('2019-01-01 00:00:00', @zone)
349
+
350
+ ((self - @ref) / DAY_S).floor + 1
343
351
  end
344
352
 
345
353
  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.7'
16
+ VERSION = '1.2.8'
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.7
4
+ version: 1.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Mettraux
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-09 00:00:00.000000000 Z
11
+ date: 2024-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tzinfo
@@ -82,7 +82,7 @@ metadata:
82
82
  bug_tracker_uri: https://github.com/floraison/et-orbi/issues
83
83
  homepage_uri: https://github.com/floraison/et-orbi
84
84
  source_code_uri: https://github.com/floraison/et-orbi
85
- post_install_message:
85
+ post_install_message:
86
86
  rdoc_options: []
87
87
  require_paths:
88
88
  - lib
@@ -97,8 +97,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
97
97
  - !ruby/object:Gem::Version
98
98
  version: '0'
99
99
  requirements: []
100
- rubygems_version: 3.1.2
101
- signing_key:
100
+ rubygems_version: 3.2.33
101
+ signing_key:
102
102
  specification_version: 4
103
103
  summary: time with zones
104
104
  test_files: []