sof-cycle 0.1.5 → 0.1.6

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: b2a07b69c0b78ca93a453a9ff1ab0e7fb7afb489bcd95793b92aaa43b74b3625
4
- data.tar.gz: c8ef2c5af032e5a98f600677fabe41e117ec1470a00955b4254e6dfd87717b9b
3
+ metadata.gz: 33cc5f466f7776bd9476664153cf9ae0e3f898132b348cffa0117a911ad7dda6
4
+ data.tar.gz: a30b3ea58dce3a953531deffba10f9199af3b283fdf70f99d7af55988aef428e
5
5
  SHA512:
6
- metadata.gz: '078492cab1d760a9db49da00326eab551bcf00486cbca9f8bbf026d192f398e24d9b156eaf222237936c0a86b9bdb06594daaefc724ffa9d7258eb89a71df6ad'
7
- data.tar.gz: ff0791da35ec67d02633b3200f44929f7627b6bc3d3f9414ec24570a1203f830c2142216f8d37d3e154ad0c157ec2b47f3054d633df40b0bff2e4e61cc13b782
6
+ metadata.gz: ce71b8b026ee7e78c6d6568dea2a88eb2d5faee74cbc4cc4e7c6f78bf7e328b46ba7017e71acf75f7b8613204e6e7a56b9592987d559c5883c1901ead1119718
7
+ data.tar.gz: 306c295e768f6616c80ebe3ee8adbfb734d64b01b2b4fd5d52a45ac9e913752b660bbc7a77129adfd66fb517adb6c0217ec11f4c62518c32620c788a3803c91b
data/CHANGELOG.md CHANGED
@@ -5,14 +5,14 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [0.1.5] - 2024-09-02
8
+ ## [0.1.6] - 2024-09-04
9
9
 
10
- ### Fixed
10
+ ### Added
11
11
 
12
- - `Cycle#last_completed` works for dormant cycles too
12
+ - `Cycle.extend_period(count)` to get a new cycle with the modified period count
13
13
 
14
- ## [0.1.4] - 2024-09-02
14
+ ## [0.1.5] - 2024-09-02
15
15
 
16
- ### Added
16
+ ### Fixed
17
17
 
18
- - `Cycle#last_completed` to return the last completion given the cycle and an array of dates
18
+ - `Cycle#last_completed` works for dormant cycles too
@@ -2,6 +2,6 @@
2
2
 
3
3
  module SOF
4
4
  class Cycle
5
- VERSION = "0.1.5"
5
+ VERSION = "0.1.6"
6
6
  end
7
7
  end
data/lib/sof/cycle.rb CHANGED
@@ -165,6 +165,8 @@ module SOF
165
165
  # Return the most recent completion date from the supplied array of dates
166
166
  def last_completed(dates) = dates.compact.map(&:to_date).max
167
167
 
168
+ def extend_period(_ = nil) = self
169
+
168
170
  # From the supplied anchor date, are there enough in-window completions to
169
171
  # satisfy the cycle?
170
172
  #
@@ -12,6 +12,14 @@ module SOF
12
12
 
13
13
  def to_s = "#{volume}x within #{date_range}"
14
14
 
15
+ def extend_period(count)
16
+ Cycle.for(
17
+ Parser.load(
18
+ parser.to_h.merge(period_count: period_count + count)
19
+ ).to_s
20
+ )
21
+ end
22
+
15
23
  def date_range
16
24
  return humanized_span unless active?
17
25
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sof-cycle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Gay
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-09-02 00:00:00.000000000 Z
11
+ date: 2024-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: forwardable