sof-cycle 0.1.9 → 0.1.11

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: 9a26ea052ce2819b24073d04f710d4c68cbfafd64d73d96b17efda48e4cd883e
4
- data.tar.gz: 7d5b89211965af6b73bdce55d9c5807317ee158a30fecfa3b9ce2de80a42f427
3
+ metadata.gz: 98a3b894aa388fbe5e272203915060486d219d54872ee3f54bbbc9aed3c343d7
4
+ data.tar.gz: 4023edaf4b2c668680d4fb7147f920b7dff727ade6bc02a64c5d928dabc5bbd5
5
5
  SHA512:
6
- metadata.gz: 4bea2cadd346b867b6801191c93cbd2a1efc69d56138c88bfb786e7a043fa3499dc426d1542a15645448c5ba84aa91ee195c5fab4a3599714dcd76800e84b6a7
7
- data.tar.gz: f9bdf58b3db82a7148b36b8df8889a6b24b519b2a2e6d6e412d57f284c5a491f52b5046ab018e3b294f4145fc9c95f85e2d07f68dbb650d48cfea9f4df6c8a31
6
+ metadata.gz: 32ed188de45051c75b5e9fc41f26f59ccba11e2432eb7714601eed2baa581a70b00136cd7b7e8c5bac50d5966dca221540b92e570c6ac06aa7bbfe9a1be72123
7
+ data.tar.gz: e2b243c6387a5a79b7c1dfda6c7a2efb31f692f5196924abf7351bcfbf9ba87e7416e5528533f9a7ab29c7200c709e9b2d426a00db8222c570621bd16b040210
data/.tool-versions ADDED
@@ -0,0 +1 @@
1
+ ruby 3.4.3
data/CHANGELOG.md CHANGED
@@ -5,14 +5,10 @@ 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.9] - 2025-09-04
8
+ ## [0.1.11] - 2025-09-05
9
9
 
10
10
  ### Changed
11
11
 
12
- - Make use of scoping for `Cycle.cycle_handlers` to prevent collisions with other Cycle classes.
12
+ - Use `time_span.notation` instead of `TimeSpan.notation` in `Cycle#notation`.
13
13
 
14
- ## [0.1.8] - 2025-09-04
15
-
16
- ### Changed
17
-
18
- - Simplified `handles?` logic to do string comparison instead of symbol comparison.
14
+ ## [0.1.10] - 2025-09-04
@@ -0,0 +1 @@
1
+ 1dd8e44d63d65dc2efc605dc2957fde47f7b9dfb7b91ddc7cca43bbc420b10366c26512eb940261381f54ad41d3a240dfa13abeaf8d52688c0ba1075b425ac9f
@@ -0,0 +1 @@
1
+ 827bb10a76bdf83a57b26a111b504f2df8506184fc363d6bc8924755db65f87039be4daadddc2b8455928f68e5d81bb174bea63372dbda8c5271341b38bb5094
@@ -2,6 +2,6 @@
2
2
 
3
3
  module SOF
4
4
  class Cycle
5
- VERSION = "0.1.9"
5
+ VERSION = "0.1.11"
6
6
  end
7
7
  end
data/lib/sof/cycle.rb CHANGED
@@ -231,7 +231,15 @@ module SOF
231
231
  end
232
232
 
233
233
  # Return the cycle representation as a notation string
234
- def notation = Cycle.notation(to_h)
234
+ def notation
235
+ hash = to_h
236
+ [
237
+ "V#{volume}",
238
+ self.class.notation_id,
239
+ time_span.notation,
240
+ hash.fetch(:from, nil)
241
+ ].compact.join
242
+ end
235
243
 
236
244
  # Cycles are considered equal if their hash representations are equal
237
245
  def ==(other) = to_h == other.to_h
data/lib/sof/time_span.rb CHANGED
@@ -29,7 +29,7 @@ module SOF
29
29
 
30
30
  # Return a notation string from a hash
31
31
  def notation(hash)
32
- return unless hash.key?(:period)
32
+ return unless hash.key?(:period) && hash[:period].present?
33
33
 
34
34
  [
35
35
  hash.fetch(:period_count) { 1 },
@@ -49,6 +49,10 @@ module SOF
49
49
  end
50
50
  end
51
51
 
52
+ def notation
53
+ [period_count, code].join
54
+ end
55
+
52
56
  # Class used to calculate the windows of time so that
53
57
  # a TimeSpan object will know the correct end of year,
54
58
  # quarter, etc.
@@ -63,7 +67,7 @@ module SOF
63
67
  end
64
68
 
65
69
  def for_notation(notation)
66
- types.find do |klass|
70
+ DatePeriod.types.find do |klass|
67
71
  klass.code == notation.to_s.upcase
68
72
  end
69
73
  end
@@ -189,7 +193,7 @@ module SOF
189
193
  end
190
194
  attr_reader :window
191
195
 
192
- delegate [:end_date, :begin_date] => :window
196
+ delegate [:end_date, :begin_date, :code] => :window
193
197
 
194
198
  def end_date_of_period(date)
195
199
  window.end_of_period(date)
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sof-cycle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Gay
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2025-09-05 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: forwardable
@@ -38,7 +37,6 @@ dependencies:
38
37
  - - ">="
39
38
  - !ruby/object:Gem::Version
40
39
  version: '6.0'
41
- description:
42
40
  email:
43
41
  - jim@saturnflyer.com
44
42
  executables: []
@@ -48,16 +46,19 @@ files:
48
46
  - ".claude/settings.local.json"
49
47
  - ".rspec"
50
48
  - ".simplecov"
49
+ - ".tool-versions"
51
50
  - CHANGELOG.md
52
51
  - CLAUDE.md
53
52
  - README.md
54
53
  - Rakefile
55
54
  - checksums/sof-cycle-0.1.0.gem.sha512
56
55
  - checksums/sof-cycle-0.1.1.gem.sha512
56
+ - checksums/sof-cycle-0.1.10.gem.sha512
57
57
  - checksums/sof-cycle-0.1.2.gem.sha512
58
58
  - checksums/sof-cycle-0.1.6.gem.sha512
59
59
  - checksums/sof-cycle-0.1.7.gem.sha512
60
60
  - checksums/sof-cycle-0.1.8.gem.sha512
61
+ - checksums/sof-cycle-0.1.9.gem.sha512
61
62
  - lib/sof-cycle.rb
62
63
  - lib/sof/cycle.rb
63
64
  - lib/sof/cycle/version.rb
@@ -74,7 +75,6 @@ licenses: []
74
75
  metadata:
75
76
  homepage_uri: https://github.com/SOFware/sof-cycle
76
77
  changelog_uri: https://github.com/SOFware/sof-cycle/blob/main/CHANGELOG.md
77
- post_install_message:
78
78
  rdoc_options: []
79
79
  require_paths:
80
80
  - lib
@@ -89,8 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
89
89
  - !ruby/object:Gem::Version
90
90
  version: '0'
91
91
  requirements: []
92
- rubygems_version: 3.5.11
93
- signing_key:
92
+ rubygems_version: 3.6.7
94
93
  specification_version: 4
95
94
  summary: Parse and interact with SOF cycle notation.
96
95
  test_files: []