circulator 2.1.7 → 2.1.8

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: 63f6c8044ac3e21dffede73e1345d33d2e1e3f77350bcd6b332df8508d810f1f
4
- data.tar.gz: 65ef2f903e7ec29993e1bbf7cf7b522c0d7bcba0cd424c75a7271ff0a89478db
3
+ metadata.gz: ad89c887b2b9cb0b3fc2a12bb0a8da92480828f4d8bb594700233f4b1c0ee9fd
4
+ data.tar.gz: 4400d66545332b1bd4bc09028611efe7ce04a06076520e1f8a860f3089bb8d49
5
5
  SHA512:
6
- metadata.gz: c06f5b31e89fdd3832c8339b6884546b72b651395c2ca0a81cd37767f0a482dac2507ab45120bfe95fcaa950d6359080170859cb6ff1db61c485b165386df99d
7
- data.tar.gz: 7a9f34b128d42a5c1ef9c45b806de26ac318bd822df6fbb6d35ffaa3df8384ac0dda2833057076cbb6715a30d98685a4eda03c73e6c2352a2d5682fa8a0c3260
6
+ metadata.gz: 31d7f74c6167dd0c0e51180d8cb585a5da27a9cab543bc32b0ec2da1c819ccd0cff3920446b94496baa36cf2b4005610f535054ce863a08f2ac691ca6ee70ff2
7
+ data.tar.gz: 4fcf8a370b45aa9d883c5ce4b10f4b714b66c5d5f4f5cdf638281ee01f5636687505c1be94297e5abb072f1de5db8b082edd500cd0b9ccaa769a08a280de743e
data/CHANGELOG.md CHANGED
@@ -5,12 +5,8 @@ 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
- ## [2.1.7] - 2026-01-06
8
+ ## [2.1.8] - 2026-01-07
9
9
 
10
10
  ### Added
11
11
 
12
- - Use an array of mulitple symbols with allow_if guard clauses. (96b66e6)
13
-
14
- ### Changed
15
-
16
- - Documentation of lib/circulator.rb and explain extensions in README.md (7a04d58)
12
+ - Detailed conditional information display in DOT and PlantUML diagrams (dce5b69)
@@ -144,5 +144,30 @@ module Circulator
144
144
  def dynamic_transition(action, from_state, to_state = nil)
145
145
  raise NotImplementedError, "Subclasses must implement #{__method__}"
146
146
  end
147
+
148
+ def format_conditional(conditional)
149
+ case conditional
150
+ when Symbol
151
+ "(#{conditional})"
152
+ when Hash
153
+ attr, states = conditional.first
154
+ states_str = Array(states).join(", ")
155
+ "(#{attr}: #{states_str})"
156
+ when Array
157
+ parts = conditional.map { |c| format_conditional_part(c) }
158
+ "(#{parts.join(", ")})"
159
+ else
160
+ "(conditional)"
161
+ end
162
+ end
163
+
164
+ def format_conditional_part(part)
165
+ case part
166
+ when Symbol
167
+ part.to_s
168
+ else
169
+ "conditional"
170
+ end
171
+ end
147
172
  end
148
173
  end
@@ -124,7 +124,7 @@ module Circulator
124
124
 
125
125
  def standard_transition(action, from_state, to_state, conditional: nil)
126
126
  label = action.to_s
127
- label += " (conditional)" if conditional
127
+ label += " #{format_conditional(conditional)}" if conditional
128
128
 
129
129
  {
130
130
  from: from_state,
@@ -87,7 +87,7 @@ module Circulator
87
87
 
88
88
  def standard_transition(action, from_state, to_state, conditional: nil)
89
89
  note = if conditional
90
- "conditional transition"
90
+ "conditional: #{format_conditional(conditional)}"
91
91
  end
92
92
 
93
93
  {
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Circulator
4
- VERSION = "2.1.7"
4
+ VERSION = "2.1.8"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: circulator
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.7
4
+ version: 2.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Gay