fugit 1.8.0 → 1.8.1

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: fe369cec5c3fb690ead6f7638fcd430db71fd6525070c45aa48a8c7b3c3d4171
4
- data.tar.gz: ce486e692afb9bf796122005314c89185373b07d596684b8c7a3f395bf36d1b4
3
+ metadata.gz: b1839fa07acc6287be95f8076c19afa2c9d6c9b5500ac1b03febab61959b5057
4
+ data.tar.gz: 839ff5c0f85ccd51625febfdbfedd017e46962d288cf313307b706830dc838c9
5
5
  SHA512:
6
- metadata.gz: 94b9b504e574dbff1f6b0abab21028c97c0303533a8b45747ae6250c6d866c83c7b1999c5cce4680f5015f62946e9ba2f0a2e28af0faf5dc6194c3649b615b97
7
- data.tar.gz: a70bdcd045774d4290cc7d014c62793e28f4a322bf8a3f93d7ee5ce2b2d37744481d32896ce5c88ff89cd3fddfe7ec37bf41c5d3b480dafea45a0d246e1636bd
6
+ metadata.gz: 5336bf251441fa3f7372d48aec2196cf86831b24c64110955f2ccf2df2e6e1ec84a68b318b53be8282f87794f40c09778bddd47abec3f65fe1469544a758fabb
7
+ data.tar.gz: 0fdd70455097838c21c3f03c9dca20889b4aba07f67d790136e40be2d8686b0a6ad8a594fff1fe28e7cd4d322ad66a8a31aa71750cd435c7601345487ae89bdb
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
  # CHANGELOG.md
3
3
 
4
4
 
5
+ ## fugit 1.8.1 released 2023-01-20
6
+
7
+ * Fix for month subtraction, gh-84, @mreinsch
8
+ * Fix duration - time, gh-85, @mreinsch
9
+
10
+
5
11
  ## fugit 1.8.0 released 2022-12-06
6
12
 
7
13
  * Introduce Fugit.parse_cronish and .do_parse_cronish, gh-70
data/CREDITS.md CHANGED
@@ -1,6 +1,8 @@
1
1
 
2
2
  # fugit credits
3
3
 
4
+ * Michael Reinsch, https://github.com/mreinsch, gh-84 and gh-85
5
+ * Marc Anguera, https://github.com/markets, gh-70 and Sidekiq-Cron
4
6
  * ski-nine, https://github.com/ski-nine, gh-81
5
7
  * Joseph Halter, https://github.com/JosephHalter, gh-79
6
8
  * James Healy, https://github.com/yob, gh-76
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-2023, 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
@@ -68,8 +68,10 @@ module Fugit
68
68
  hou: { a: 'h', r: 'h', i: 'H', s: 3600, I: true, l: 'hour' },
69
69
  min: { a: 'm', r: 'm', i: 'M', s: 60, I: true, l: 'minute' },
70
70
  sec: { a: 's', r: 's', i: 'S', s: 1, I: true, l: 'second' } }.freeze
71
- INFLA_KEYS, NON_INFLA_KEYS =
72
- KEYS.partition { |k, v| v[:I] }.freeze
71
+
72
+ INFLA_KEYS, NON_INFLA_KEYS = KEYS
73
+ .partition { |k, v| v[:I] }
74
+ .collect(&:freeze)
73
75
 
74
76
  def _to_s(key)
75
77
 
@@ -240,7 +242,7 @@ module Fugit
240
242
  n, m = at[1] / 12, at[1] % 12
241
243
  at[0], at[1] = at[0] + n, m
242
244
  elsif at[1] < 1
243
- n, m = -at[1] / 12, -at[1] % 12
245
+ n, m = (-at[1]) / 12 + 1, (11+at[1]) % 12 + 1
244
246
  at[0], at[1] = at[0] - n, m
245
247
  end
246
248
 
@@ -269,7 +271,7 @@ module Fugit
269
271
  when Numeric then add_numeric(-a)
270
272
  when Fugit::Duration then add_duration(-a)
271
273
  when String then add_duration(-self.class.parse(a))
272
- when ::Time, ::EtOrbi::EoTime then add_to_time(a)
274
+ when ::Time, ::EtOrbi::EoTime then opposite.add_to_time(a)
273
275
  else fail ArgumentError.new(
274
276
  "cannot subtract #{a.class} instance to a Fugit::Duration")
275
277
  end
data/lib/fugit.rb CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  module Fugit
5
5
 
6
- VERSION = '1.8.0'
6
+ VERSION = '1.8.1'
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.8.0
4
+ version: 1.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Mettraux
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-06 00:00:00.000000000 Z
11
+ date: 2023-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: raabro