fugit 1.5.0 → 1.5.3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of fugit might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -0
- data/CREDITS.md +3 -0
- data/LICENSE.txt +1 -1
- data/README.md +1 -0
- data/fugit.gemspec +1 -1
- data/lib/fugit/cron.rb +38 -3
- data/lib/fugit.rb +2 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd6f6af6264734f4eb10d5aa8e88cbcfbca029fb697f20b7a0ae37d220c55653
|
4
|
+
data.tar.gz: 25606c4f975d71350a360f4feb092a54f88bbb022fef31e4eb13c22d98b36b8f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 253c2fc474a22ff93caa8b1f465af16565ab8b69037f7e83dc1e42719085d95342ee9d7a43200bdb05bcc9815dc29f590c5d86df51b7f526e25bb6d96dd4ef02
|
7
|
+
data.tar.gz: '0951e692d8026d3a66c374e99f872bd03270f77e93232bbbecefac44c8b9b17253b46218dbb36f9f009441bb6d602c04f40dad7782df31674e26244c1ce59055'
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,21 @@
|
|
2
2
|
# CHANGELOG.md
|
3
3
|
|
4
4
|
|
5
|
+
## fugit 1.5.3 released 2022-04-02
|
6
|
+
|
7
|
+
* Fix Fugit::Cron.to_s vs "0 13 * * wed%2", gh-68
|
8
|
+
|
9
|
+
|
10
|
+
## fugit 1.5.2 released 2021-09-18
|
11
|
+
|
12
|
+
* Simplify inc_day, gh-62
|
13
|
+
|
14
|
+
|
15
|
+
## fugit 1.5.1 released 2021-08-18
|
16
|
+
|
17
|
+
* Fix #next_time break issue for America/Santiago into DST, gh-60
|
18
|
+
|
19
|
+
|
5
20
|
## fugit 1.5.0 released 2021-06-08
|
6
21
|
|
7
22
|
* Accept "at 12 noon" and "at 12 midday" as "* 12 * * *", gh-57
|
data/CREDITS.md
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
|
2
2
|
# fugit credits
|
3
3
|
|
4
|
+
* Peter Goldstein, https://github.com/petergoldstein GHA 3.3 j9.3, gh-65
|
5
|
+
* Pascal Zumkehr https://github.com/codez gh-62, Santiago into DST vs Time.zone
|
6
|
+
* Ggallardoh https://github.com/Ggallardoh gh-60, America/Santiago into DST
|
4
7
|
* Khaled AbuShqear https://github.com/shqear93 gh-57, "12pm"
|
5
8
|
* John W Higgins https://github.com/wishdev gh-56, 15/30 cron decision
|
6
9
|
* Karen Sawrey https://github.com/karensawrey gh-47, Mon%2+1 rework idea
|
data/LICENSE.txt
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
Copyright (c) 2017-
|
2
|
+
Copyright (c) 2017-2022, 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/README.md
CHANGED
@@ -37,6 +37,7 @@ The intersection of those two projects is where fugit is born:
|
|
37
37
|
* [flor](https://github.com/floraison/flor) - used in the [cron](https://github.com/floraison/flor/blob/master/doc/procedures/cron.md) procedure
|
38
38
|
* [que-scheduler](https://github.com/hlascelles/que-scheduler) - a reliable job scheduler for [que](https://github.com/chanks/que)
|
39
39
|
* [serial_scheduler](https://github.com/grosser/serial_scheduler) - ruby task scheduler without threading
|
40
|
+
* [delayed_cron_job](https://github.com/codez/delayed_cron_job) - an extension to Delayed::Job that allows you to set cron expressions for your jobs
|
40
41
|
* ...
|
41
42
|
|
42
43
|
## `Fugit.parse(s)`
|
data/fugit.gemspec
CHANGED
@@ -41,7 +41,7 @@ Time tools for flor and the floraison project. Cron parsing and occurrence compu
|
|
41
41
|
# this dependency appears in 'et-orbi'
|
42
42
|
|
43
43
|
s.add_runtime_dependency 'raabro', '~> 1.4'
|
44
|
-
s.add_runtime_dependency 'et-orbi', '~> 1
|
44
|
+
s.add_runtime_dependency 'et-orbi', '~> 1', '>= 1.2.7'
|
45
45
|
|
46
46
|
s.add_development_dependency 'rspec', '~> 3.8'
|
47
47
|
s.add_development_dependency 'chronic', '~> 0.10'
|
data/lib/fugit/cron.rb
CHANGED
@@ -60,7 +60,7 @@ module Fugit
|
|
60
60
|
(@hours || [ '*' ]).join(','),
|
61
61
|
(@monthdays || [ '*' ]).join(','),
|
62
62
|
(@months || [ '*' ]).join(','),
|
63
|
-
|
63
|
+
weekdays_to_cron_s,
|
64
64
|
@timezone ? @timezone.name : nil
|
65
65
|
].compact.join(' ')
|
66
66
|
end
|
@@ -74,6 +74,8 @@ module Fugit
|
|
74
74
|
end
|
75
75
|
|
76
76
|
def time; @t; end
|
77
|
+
def to_t; @t; end
|
78
|
+
#
|
77
79
|
def to_i; @t.to_i; end
|
78
80
|
|
79
81
|
%w[ year month day wday hour min sec wday_in_month rweek rday ]
|
@@ -83,18 +85,33 @@ module Fugit
|
|
83
85
|
def dec(i); inc(-i); end
|
84
86
|
|
85
87
|
def inc_month
|
88
|
+
|
86
89
|
y = @t.year
|
87
90
|
m = @t.month + 1
|
88
91
|
if m == 13; m = 1; y += 1; end
|
92
|
+
|
89
93
|
@t = ::EtOrbi.make(y, m, @t.zone)
|
94
|
+
|
90
95
|
self
|
91
96
|
end
|
92
97
|
|
93
98
|
def inc_day
|
99
|
+
|
94
100
|
inc((24 - @t.hour) * 3600 - @t.min * 60 - @t.sec)
|
95
|
-
|
96
|
-
|
101
|
+
|
102
|
+
return if @t.hour == 0
|
103
|
+
|
104
|
+
if @t.hour < 12
|
105
|
+
begin
|
106
|
+
@t = ::EtOrbi.make(@t.year, @t.month, @t.day, @t.zone)
|
107
|
+
rescue ::TZInfo::PeriodNotFound
|
108
|
+
inc((24 - @t.hour) * 3600)
|
109
|
+
end
|
110
|
+
else
|
111
|
+
inc((24 - @t.hour) * 3600)
|
112
|
+
end
|
97
113
|
end
|
114
|
+
|
98
115
|
def inc_hour
|
99
116
|
inc((60 - @t.min) * 60 - @t.sec)
|
100
117
|
end
|
@@ -605,6 +622,24 @@ module Fugit
|
|
605
622
|
@zone, @timezone = z
|
606
623
|
end
|
607
624
|
|
625
|
+
def weekdays_to_cron_s
|
626
|
+
|
627
|
+
return '*' unless @weekdays
|
628
|
+
|
629
|
+
@weekdays
|
630
|
+
.collect { |a|
|
631
|
+
if a.length == 1
|
632
|
+
a[0].to_s
|
633
|
+
elsif a[1].is_a?(Array)
|
634
|
+
a11 = a[1][1]
|
635
|
+
off = (a11 < 0) ? a11.to_s : (a11 > 0) ? "+#{a11}" : ''
|
636
|
+
"#{a[0]}%#{a[1][0]}" + off
|
637
|
+
else
|
638
|
+
a.collect(&:to_s).join('#')
|
639
|
+
end }
|
640
|
+
.join(',')
|
641
|
+
end
|
642
|
+
|
608
643
|
module Parser include Raabro
|
609
644
|
|
610
645
|
WEEKDAYS =
|
data/lib/fugit.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fugit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Mettraux
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-04-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: raabro
|
@@ -30,20 +30,20 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '1
|
33
|
+
version: '1'
|
34
34
|
- - ">="
|
35
35
|
- !ruby/object:Gem::Version
|
36
|
-
version: 1.
|
36
|
+
version: 1.2.7
|
37
37
|
type: :runtime
|
38
38
|
prerelease: false
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
40
40
|
requirements:
|
41
41
|
- - "~>"
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: '1
|
43
|
+
version: '1'
|
44
44
|
- - ">="
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: 1.
|
46
|
+
version: 1.2.7
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rspec
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -117,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
117
117
|
- !ruby/object:Gem::Version
|
118
118
|
version: '0'
|
119
119
|
requirements: []
|
120
|
-
rubygems_version: 3.
|
120
|
+
rubygems_version: 3.1.2
|
121
121
|
signing_key:
|
122
122
|
specification_version: 4
|
123
123
|
summary: time tools for flor
|