fugit 1.5.2 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7c15d1aa5444c8526cae61312916c90cde61e1e516faa8bdb330ade277ef3669
4
- data.tar.gz: 5126ecd62951257326cb483e0b694ff4ffe7a02a7ef5eda53359e26aa43b43eb
3
+ metadata.gz: fd6f6af6264734f4eb10d5aa8e88cbcfbca029fb697f20b7a0ae37d220c55653
4
+ data.tar.gz: 25606c4f975d71350a360f4feb092a54f88bbb022fef31e4eb13c22d98b36b8f
5
5
  SHA512:
6
- metadata.gz: d04b7906c8134bc36f98a4cc3a5b598f430f1125c0169aa162cd8f789bb812479cdc17a65154ad6afb9f102b784d4d6a2831fe7a1512ef3a4b81ebe4eca22087
7
- data.tar.gz: 1de022b1f39ba9a4f9cdeea4eed9427b1b33c3b9e121def7680a481b4036ad7542a4e5340814e7aa4a9937f03cc144b2fc2661975682b3683948cc4b7445bd0e
6
+ metadata.gz: 253c2fc474a22ff93caa8b1f465af16565ab8b69037f7e83dc1e42719085d95342ee9d7a43200bdb05bcc9815dc29f590c5d86df51b7f526e25bb6d96dd4ef02
7
+ data.tar.gz: '0951e692d8026d3a66c374e99f872bd03270f77e93232bbbecefac44c8b9b17253b46218dbb36f9f009441bb6d602c04f40dad7782df31674e26244c1ce59055'
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
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
+
5
10
  ## fugit 1.5.2 released 2021-09-18
6
11
 
7
12
  * Simplify inc_day, gh-62
data/CREDITS.md CHANGED
@@ -1,6 +1,7 @@
1
1
 
2
2
  # fugit credits
3
3
 
4
+ * Peter Goldstein, https://github.com/petergoldstein GHA 3.3 j9.3, gh-65
4
5
  * Pascal Zumkehr https://github.com/codez gh-62, Santiago into DST vs Time.zone
5
6
  * Ggallardoh https://github.com/Ggallardoh gh-60, America/Santiago into DST
6
7
  * Khaled AbuShqear https://github.com/shqear93 gh-57, "12pm"
data/LICENSE.txt CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- Copyright (c) 2017-2021, John Mettraux, jmettraux+flor@gmail.com
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.1', '>= 1.1.8'
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
- (@weekdays || [ [ '*' ] ]).map { |d| d.compact.join('#') }.join(','),
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 ]
@@ -620,6 +622,24 @@ module Fugit
620
622
  @zone, @timezone = z
621
623
  end
622
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
+
623
643
  module Parser include Raabro
624
644
 
625
645
  WEEKDAYS =
data/lib/fugit.rb CHANGED
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+
3
4
  module Fugit
4
5
 
5
- VERSION = '1.5.2'
6
+ VERSION = '1.5.3'
6
7
  end
7
8
 
8
9
  require 'time'
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.2
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: 2021-09-18 00:00:00.000000000 Z
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.1'
33
+ version: '1'
34
34
  - - ">="
35
35
  - !ruby/object:Gem::Version
36
- version: 1.1.8
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.1'
43
+ version: '1'
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: 1.1.8
46
+ version: 1.2.7
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rspec
49
49
  requirement: !ruby/object:Gem::Requirement