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 +4 -4
- data/CHANGELOG.md +2 -6
- data/lib/circulator/diagram.rb +25 -0
- data/lib/circulator/dot.rb +1 -1
- data/lib/circulator/plantuml.rb +1 -1
- data/lib/circulator/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ad89c887b2b9cb0b3fc2a12bb0a8da92480828f4d8bb594700233f4b1c0ee9fd
|
|
4
|
+
data.tar.gz: 4400d66545332b1bd4bc09028611efe7ce04a06076520e1f8a860f3089bb8d49
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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.
|
|
8
|
+
## [2.1.8] - 2026-01-07
|
|
9
9
|
|
|
10
10
|
### Added
|
|
11
11
|
|
|
12
|
-
-
|
|
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)
|
data/lib/circulator/diagram.rb
CHANGED
|
@@ -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
|
data/lib/circulator/dot.rb
CHANGED
|
@@ -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,
|
data/lib/circulator/plantuml.rb
CHANGED
data/lib/circulator/version.rb
CHANGED