sof-cycle 0.1.8 → 0.1.9

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: bcb187376738c3b567bf2bc9fc68bba6f1cb7e766302a897ab272db848b1b081
4
- data.tar.gz: d841689c22f68f7f273d1791feb7753826c3b5c2235deb467fad88ee163ec18f
3
+ metadata.gz: 9a26ea052ce2819b24073d04f710d4c68cbfafd64d73d96b17efda48e4cd883e
4
+ data.tar.gz: 7d5b89211965af6b73bdce55d9c5807317ee158a30fecfa3b9ce2de80a42f427
5
5
  SHA512:
6
- metadata.gz: f193e2a83e149315956c99df5efebabfd05c9ade453bb4e4763db1a39870c62c63bae5e6c82379bddd1f07a85a1a6f898fb90d53a753f0936f146efdf6e5f786
7
- data.tar.gz: 7000bd01fd3c3302756b757b406f36ec75db9125a3acf597e5c6fb54ab811356e076b4d45087098db94ffb4d4f0151b33d8bd4ce3c1ebe4e4844ae20029aec66
6
+ metadata.gz: 4bea2cadd346b867b6801191c93cbd2a1efc69d56138c88bfb786e7a043fa3499dc426d1542a15645448c5ba84aa91ee195c5fab4a3599714dcd76800e84b6a7
7
+ data.tar.gz: f9bdf58b3db82a7148b36b8df8889a6b24b519b2a2e6d6e412d57f284c5a491f52b5046ab018e3b294f4145fc9c95f85e2d07f68dbb650d48cfea9f4df6c8a31
data/CHANGELOG.md CHANGED
@@ -5,20 +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.8] - 2025-09-04
8
+ ## [0.1.9] - 2025-09-04
9
9
 
10
10
  ### Changed
11
11
 
12
- - Simplified `handles?` logic to do string comparison instead of symbol comparison.
13
-
14
- ## [0.1.7] - 2025-06-09
15
-
16
- ### Added
12
+ - Make use of scoping for `Cycle.cycle_handlers` to prevent collisions with other Cycle classes.
17
13
 
18
- - `Cycle#considered_dates` to get the subset of `#covered_dates` that are
19
- considered for the cycle's calculations.
14
+ ## [0.1.8] - 2025-09-04
20
15
 
21
- ### Fixed
16
+ ### Changed
22
17
 
23
- - `Cycles::Lookback.volume_to_delay_expiration` now computes correctly when the
24
- `#considered_dates` is smaller than the `#covered_dates` of the cycle.
18
+ - Simplified `handles?` logic to do string comparison instead of symbol comparison.
@@ -0,0 +1 @@
1
+ 3fa79340bfbc44787ee3db5a54f4c67155a90a8fb696a17a91a9a76d9e41c7e4c5bb0993d06657ea18bab82f7d89f3a8d4482a3eceedc91c6e34014ce0d97694
@@ -2,6 +2,6 @@
2
2
 
3
3
  module SOF
4
4
  class Cycle
5
- VERSION = "0.1.8"
5
+ VERSION = "0.1.9"
6
6
  end
7
7
  end
data/lib/sof/cycle.rb CHANGED
@@ -69,7 +69,7 @@ module SOF
69
69
  raise InvalidInput, "'#{notation}' is not a valid input"
70
70
  end
71
71
 
72
- cycle = cycle_handlers.find do |klass|
72
+ cycle = Cycle.cycle_handlers.find do |klass|
73
73
  parser.parses?(klass.notation_id)
74
74
  end.new(notation, parser:)
75
75
  return cycle if parser.active?
@@ -84,7 +84,7 @@ module SOF
84
84
  # class_for_notation_id('L')
85
85
  #
86
86
  def class_for_notation_id(notation_id)
87
- cycle_handlers.find do |klass|
87
+ Cycle.cycle_handlers.find do |klass|
88
88
  klass.notation_id == notation_id
89
89
  end || raise(InvalidKind, "'#{notation_id}' is not a valid kind of #{name}")
90
90
  end
@@ -152,14 +152,14 @@ module SOF
152
152
  end
153
153
 
154
154
  def inherited(klass)
155
- cycle_handlers << klass
155
+ Cycle.cycle_handlers << klass
156
156
  end
157
157
 
158
158
  private
159
159
 
160
160
  def build_kind_legend
161
161
  legend = {}
162
- cycle_handlers.each do |handler|
162
+ Cycle.cycle_handlers.each do |handler|
163
163
  # Skip volume_only since it doesn't have a notation_id
164
164
  next if handler.instance_variable_get(:@volume_only)
165
165
 
@@ -231,7 +231,7 @@ module SOF
231
231
  end
232
232
 
233
233
  # Return the cycle representation as a notation string
234
- def notation = self.class.notation(to_h)
234
+ def notation = Cycle.notation(to_h)
235
235
 
236
236
  # Cycles are considered equal if their hash representations are equal
237
237
  def ==(other) = to_h == other.to_h
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sof-cycle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Gay
8
+ autorequire:
8
9
  bindir: exe
9
10
  cert_chain: []
10
- date: 1980-01-02 00:00:00.000000000 Z
11
+ date: 2025-09-05 00:00:00.000000000 Z
11
12
  dependencies:
12
13
  - !ruby/object:Gem::Dependency
13
14
  name: forwardable
@@ -37,6 +38,7 @@ dependencies:
37
38
  - - ">="
38
39
  - !ruby/object:Gem::Version
39
40
  version: '6.0'
41
+ description:
40
42
  email:
41
43
  - jim@saturnflyer.com
42
44
  executables: []
@@ -55,6 +57,7 @@ files:
55
57
  - checksums/sof-cycle-0.1.2.gem.sha512
56
58
  - checksums/sof-cycle-0.1.6.gem.sha512
57
59
  - checksums/sof-cycle-0.1.7.gem.sha512
60
+ - checksums/sof-cycle-0.1.8.gem.sha512
58
61
  - lib/sof-cycle.rb
59
62
  - lib/sof/cycle.rb
60
63
  - lib/sof/cycle/version.rb
@@ -71,6 +74,7 @@ licenses: []
71
74
  metadata:
72
75
  homepage_uri: https://github.com/SOFware/sof-cycle
73
76
  changelog_uri: https://github.com/SOFware/sof-cycle/blob/main/CHANGELOG.md
77
+ post_install_message:
74
78
  rdoc_options: []
75
79
  require_paths:
76
80
  - lib
@@ -85,7 +89,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
85
89
  - !ruby/object:Gem::Version
86
90
  version: '0'
87
91
  requirements: []
88
- rubygems_version: 3.6.7
92
+ rubygems_version: 3.5.11
93
+ signing_key:
89
94
  specification_version: 4
90
95
  summary: Parse and interact with SOF cycle notation.
91
96
  test_files: []