fugit 1.12.1 → 1.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 15a3ea665c020e35ce51dcbc82be9a74e6f4abcaa2441316b514c630ffdbc094
4
- data.tar.gz: f99246722de255325b57ea46f7b3f24bbfc11d65f1eb98fde9a2a43a3c249df0
3
+ metadata.gz: dbfc8b39f64a9745e37dcc8f20b5e923378a76a66a5ceecda42d9892ebcfc6fb
4
+ data.tar.gz: 19dc7123a550e62a242aed23ce401a8f3084cbc6fb6321e281dc03b706702b0a
5
5
  SHA512:
6
- metadata.gz: cc55e7332f5f111ddf27d145fed7fbfeaeed30f492ba343d1f4067e776c96874b42bad9488b9683203040cc50333f74bab56fa6e61744ef92fb059f2a2c9f076
7
- data.tar.gz: 5ee65240dd04fddb7777bee327f8fee0cfef5260ed55db9ec71ece64c5e5e6b53283aa7d26ba52facbca3882aee0920ff0dd3715fea5ad9153caca82ea712450
6
+ metadata.gz: '089240f70ced2e63f3cd18c74dd58da00e372137ee2768b002a24fb452cf6c0f0bd539e192667a0e20b2dd83082eccefc82ff2c8605a0ca405e667c6ba3c81c6'
7
+ data.tar.gz: 59dca013d409f191481ad0f3038ed697627f5f2f5b589cfd33c9547cde3d35ab6771c35f28b751504dc6325b107b1556b75949fab0f4ca94d47204ebfb3b14b1
data/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
  # CHANGELOG.md
3
3
 
4
4
 
5
+ ## fugit 1.12.2 released 2026-05-28
6
+
7
+ * Fix "divide by zero" gh-117
8
+ * Let at parse 'now', gh-111
9
+ * Let Fugit::At pass options to Chronic, gh-116
10
+
11
+
5
12
  ## fugit 1.12.1 released 2025-10-14
6
13
 
7
14
  * Fix Fugit::Cron#to_cron_s to include & if @day_and
data/CREDITS.md CHANGED
@@ -1,6 +1,7 @@
1
1
 
2
2
  # fugit credits
3
3
 
4
+ * JebeenLee https://github.com/JebeenLee gh-117 divide by zero
4
5
  * Eric Claerhout https://github.com/swebra gh-114 rweek readme clarity
5
6
  * Hugh Kelsey https://github.com/hughkelsey gh-114 rweek/rday / wed%4+1,wed%4
6
7
  * Mark R. James, https://github.com/mrj, AM vs America/Los_Angeles, gh-113
data/LICENSE.txt CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- Copyright (c) 2017-2025, John Mettraux, jmettraux+flor@gmail.com
2
+ Copyright (c) 2017-2026, 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
@@ -1,6 +1,12 @@
1
1
 
2
2
  # fugit
3
3
 
4
+ > Sed fugit interea, fugit irreparabile tempus
5
+
6
+ Virgil, _Georgics_ Book III
7
+
8
+ ---
9
+
4
10
  [![tests](https://github.com/floraison/fugit/workflows/test/badge.svg)](https://github.com/floraison/fugit/actions)
5
11
  [![Gem Version](https://badge.fury.io/rb/fugit.svg)](http://badge.fury.io/rb/fugit)
6
12
 
data/lib/fugit/at.rb CHANGED
@@ -6,14 +6,19 @@ module Fugit
6
6
 
7
7
  class << self
8
8
 
9
- def parse(s)
9
+ def parse(s, opts={})
10
10
 
11
- ::EtOrbi.make_time(s) rescue nil
11
+ do_parse(s, opts || {}) rescue nil
12
12
  end
13
13
 
14
- def do_parse(s)
14
+ def do_parse(s, opts={})
15
15
 
16
- ::EtOrbi.make_time(s)
16
+ case s
17
+ when /^now$/i then ::EtOrbi::EoTime.now
18
+ when String then ::EtOrbi.parse(s, opts || {})
19
+ when ::EtOrbi::EoTime then s
20
+ else ::EtOrbi.make_time(s)
21
+ end
17
22
  end
18
23
  end
19
24
  end
data/lib/fugit/cron.rb CHANGED
@@ -591,6 +591,8 @@ module Fugit
591
591
  # let it go, "* */24 * * *" and "* */27 * * *" are okay
592
592
  # gh-86 and gh-103
593
593
 
594
+ return false if sla && sla < 1
595
+
594
596
  edn = max if sla && edn.nil?
595
597
 
596
598
  return nil if sta.nil? && edn.nil? && sla.nil?
data/lib/fugit/parse.rb CHANGED
@@ -8,13 +8,13 @@ module Fugit
8
8
 
9
9
  def parse_cron(s); ::Fugit::Cron.parse(s); end
10
10
  def parse_duration(s); ::Fugit::Duration.parse(s); end
11
- def parse_nat(s, opts={}); ::Fugit::Nat.parse(s, opts); end
12
- def parse_at(s); ::Fugit::At.parse(s); end
11
+ def parse_nat(s, opts={}); ::Fugit::Nat.parse(s, opts || {}); end
12
+ def parse_at(s, opts={}); ::Fugit::At.parse(s, opts || {}); end
13
13
  def parse_in(s); parse_duration(s); end
14
14
 
15
15
  def do_parse_cron(s); ::Fugit::Cron.do_parse(s); end
16
16
  def do_parse_duration(s); ::Fugit::Duration.do_parse(s); end
17
- def do_parse_nat(s, opts={}); ::Fugit::Nat.do_parse(s, opts); end
17
+ def do_parse_nat(s, opts={}); ::Fugit::Nat.do_parse(s, opts || {}); end
18
18
  def do_parse_at(s); ::Fugit::At.do_parse(s); end
19
19
  def do_parse_in(s); do_parse_duration(s); end
20
20
 
@@ -24,8 +24,8 @@ module Fugit
24
24
 
25
25
  (opts[:cron] != false && parse_cron(s)) || # 542ms 616ms
26
26
  (opts[:duration] != false && parse_duration(s)) || # 645ms # 534ms
27
- (opts[:nat] != false && parse_nat(s, opts)) || # 2s # 35s
28
- (opts[:at] != false && parse_at(s)) || # 568ms 622ms
27
+ (opts[:nat] != false && parse_nat(s, opts || {})) || # 2s # 35s
28
+ (opts[:at] != false && parse_at(s, opts || {})) || # 568ms 622ms
29
29
  nil
30
30
  end
31
31
 
data/lib/fugit.rb CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  module Fugit
5
5
 
6
- VERSION = '1.12.1'
6
+ VERSION = '1.12.2'
7
7
  end
8
8
 
9
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.12.1
4
+ version: 1.12.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Mettraux
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-10-14 00:00:00.000000000 Z
11
+ date: 2026-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: raabro