diagram 0.2.1 → 0.3.0

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.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/lib/diagrams/base.rb +246 -0
  3. data/lib/diagrams/class_diagram.rb +127 -2
  4. data/lib/diagrams/elements/class_entity.rb +28 -0
  5. data/lib/diagrams/elements/edge.rb +32 -0
  6. data/lib/diagrams/elements/event.rb +26 -0
  7. data/lib/diagrams/elements/node.rb +38 -0
  8. data/lib/diagrams/elements/relationship.rb +37 -0
  9. data/lib/diagrams/elements/slice.rb +27 -0
  10. data/lib/diagrams/elements/state.rb +28 -0
  11. data/lib/diagrams/elements/task.rb +27 -0
  12. data/lib/diagrams/elements/transition.rb +31 -0
  13. data/lib/diagrams/flowchart_diagram.rb +125 -4
  14. data/lib/diagrams/gantt_diagram.rb +97 -3
  15. data/lib/diagrams/pie_diagram.rb +111 -29
  16. data/lib/diagrams/state_diagram.rb +162 -4
  17. data/lib/diagrams/version.rb +1 -1
  18. data/lib/diagrams.rb +2 -2
  19. data/sig/diagrams/base.rbs +86 -0
  20. data/sig/diagrams/class_diagram.rbs +33 -0
  21. data/sig/diagrams/elements/class_entity.rbs +15 -0
  22. data/sig/diagrams/elements/edge.rbs +16 -0
  23. data/sig/diagrams/elements/event.rbs +14 -0
  24. data/sig/diagrams/elements/node.rbs +14 -0
  25. data/sig/diagrams/elements/relationship.rbs +16 -0
  26. data/sig/diagrams/elements/slice.rbs +14 -0
  27. data/sig/diagrams/elements/state.rbs +14 -0
  28. data/sig/diagrams/elements/task.rbs +16 -0
  29. data/sig/diagrams/elements/transition.rbs +15 -0
  30. data/sig/diagrams/elements/types.rbs +18 -0
  31. data/sig/diagrams/flowchart_diagram.rbs +32 -0
  32. data/sig/diagrams/gantt_diagram.rbs +29 -0
  33. data/sig/diagrams/pie_diagram.rbs +36 -0
  34. data/sig/diagrams/state_diagram.rbs +40 -0
  35. metadata +212 -22
  36. data/lib/diagrams/abstract_diagram.rb +0 -26
  37. data/lib/diagrams/class_diagram/class/field.rb +0 -15
  38. data/lib/diagrams/class_diagram/class/function/argument.rb +0 -14
  39. data/lib/diagrams/class_diagram/class/function.rb +0 -16
  40. data/lib/diagrams/class_diagram/class.rb +0 -12
  41. data/lib/diagrams/comparable.rb +0 -20
  42. data/lib/diagrams/flowchart_diagram/link.rb +0 -11
  43. data/lib/diagrams/flowchart_diagram/node.rb +0 -10
  44. data/lib/diagrams/gantt_diagram/section/task.rb +0 -13
  45. data/lib/diagrams/gantt_diagram/section.rb +0 -10
  46. data/lib/diagrams/pie_diagram/section.rb +0 -10
  47. data/lib/diagrams/plot.rb +0 -23
  48. data/lib/diagrams/state_diagram/event.rb +0 -10
  49. data/lib/diagrams/state_diagram/state.rb +0 -12
  50. data/lib/diagrams/state_diagram/transition.rb +0 -11
@@ -0,0 +1,33 @@
1
+
2
+ module Diagrams
3
+ class ClassDiagram < Base
4
+ attr_reader classes: ::Array[Elements::ClassEntity]
5
+ attr_reader relationships: ::Array[Elements::Relationship]
6
+
7
+ # Initializes a new ClassDiagram.
8
+ def initialize: (?classes: ::Array[Elements::ClassEntity]?, ?relationships: ::Array[Elements::Relationship]?, ?version: Integer | String?) -> void
9
+
10
+ # Adds a class entity to the diagram.
11
+ def add_class: (Elements::ClassEntity class_entity) -> Elements::ClassEntity
12
+
13
+ # Adds a relationship to the diagram.
14
+ def add_relationship: (Elements::Relationship relationship) -> Elements::Relationship
15
+
16
+ # Finds a class entity by its name.
17
+ def find_class: (::String class_name) -> Elements::ClassEntity?
18
+
19
+ # Returns the specific content of the class diagram as a hash.
20
+ def to_h_content: () -> { classes: ::Array[Hash[Symbol, untyped]], relationships: ::Array[Hash[Symbol, untyped]] }
21
+
22
+ # Returns a hash mapping element types to their collections for diffing.
23
+ def identifiable_elements: () -> { classes: ::Array[Elements::ClassEntity], relationships: ::Array[Elements::Relationship] }
24
+
25
+ # Class method to create a ClassDiagram from a hash.
26
+ def self.from_h: (Hash[Symbol | String, untyped] data_hash, version: Integer | String?, checksum: String?) -> ClassDiagram
27
+
28
+ private
29
+
30
+ # Validates the consistency of classes and relationships during initialization.
31
+ def validate_elements!: () -> void
32
+ end
33
+ end
@@ -0,0 +1,15 @@
1
+ module Diagrams
2
+ module Elements
3
+ class ClassEntity < ::Dry::Struct
4
+ include Diagrams::Elements::Types
5
+
6
+ # Attributes
7
+ def name: () -> ::String
8
+ def attributes: () -> ::Array[::String]
9
+ def methods: () -> ::Array[::String]
10
+
11
+ # Methods
12
+ def to_h: () -> { name: ::String, attributes: ::Array[::String], methods: ::Array[::String] }
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,16 @@
1
+ module Diagrams
2
+ module Elements
3
+ class Edge < ::Dry::Struct
4
+ include Diagrams::Elements::Types
5
+
6
+ # Attributes
7
+ def source_id: () -> ::String
8
+ def target_id: () -> ::String
9
+ def label: () -> ::String?
10
+
11
+ # Methods
12
+ # Dry::Struct provides to_h, signature reflects potential nil label removal
13
+ def to_h: () -> { source_id: ::String, target_id: ::String, ?label: ::String }
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,14 @@
1
+ module Diagrams
2
+ module Elements
3
+ class Event < ::Dry::Struct
4
+ include Diagrams::Elements::Types
5
+
6
+ # Attributes
7
+ def id: () -> ::String
8
+ def label: () -> ::String?
9
+
10
+ # Methods
11
+ def to_h: () -> { id: ::String, ?label: ::String }
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ module Diagrams
2
+ module Elements
3
+ class Node < ::Dry::Struct
4
+ include Diagrams::Elements::Types
5
+
6
+ # Attributes
7
+ def id: () -> ::String
8
+ def label: () -> ::String
9
+
10
+ # Methods
11
+ def to_h: () -> { id: ::String, label: ::String }
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,16 @@
1
+ module Diagrams
2
+ module Elements
3
+ class Relationship < ::Dry::Struct
4
+ include Diagrams::Elements::Types
5
+
6
+ # Attributes
7
+ def source_class_name: () -> ::String
8
+ def target_class_name: () -> ::String
9
+ def type: () -> ::String
10
+ def label: () -> ::String?
11
+
12
+ # Methods
13
+ def to_h: () -> { source_class_name: ::String, target_class_name: ::String, type: ::String, ?label: ::String }
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,14 @@
1
+ module Diagrams
2
+ module Elements
3
+ class Slice < ::Dry::Struct
4
+ include Diagrams::Elements::Types
5
+
6
+ # Attributes
7
+ def label: () -> ::String
8
+ def value: () -> ::Float
9
+
10
+ # Methods
11
+ def to_h: () -> { label: ::String, value: ::Float }
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ module Diagrams
2
+ module Elements
3
+ class State < ::Dry::Struct
4
+ include Diagrams::Elements::Types
5
+
6
+ # Attributes
7
+ def id: () -> ::String
8
+ def label: () -> ::String?
9
+
10
+ # Methods
11
+ def to_h: () -> { id: ::String, ?label: ::String }
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,16 @@
1
+ module Diagrams
2
+ module Elements
3
+ class Task < ::Dry::Struct
4
+ include Diagrams::Elements::Types
5
+
6
+ # Attributes
7
+ def id: () -> ::String
8
+ def name: () -> ::String
9
+ def start_date: () -> ::String # Or ::Date if type is changed
10
+ def end_date: () -> ::String # Or ::Date if type is changed
11
+
12
+ # Methods
13
+ def to_h: () -> { id: ::String, name: ::String, start_date: ::String, end_date: ::String }
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,15 @@
1
+ module Diagrams
2
+ module Elements
3
+ class Transition < ::Dry::Struct
4
+ include Diagrams::Elements::Types
5
+
6
+ # Attributes
7
+ def source_state_id: () -> ::String
8
+ def target_state_id: () -> ::String
9
+ def label: () -> ::String?
10
+
11
+ # Methods
12
+ def to_h: () -> { source_state_id: ::String, target_state_id: ::String, ?label: ::String }
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,18 @@
1
+ # Signatures for the shared Dry::Types module used by elements.
2
+ # Note: Dry::Types integration with RBS can be complex. This is a basic representation.
3
+ module Diagrams
4
+ module Elements
5
+ module Types
6
+ # Define common types used in elements if needed, or rely on Dry::Types inference.
7
+ # Example:
8
+ # type StrictString = ::String
9
+ # type StrictFloat = ::Float
10
+ # type StrictArray[T] = ::Array[T]
11
+ # type String? = StrictString?
12
+ # ... etc ...
13
+
14
+ # Include the Dry::Types module interface (basic representation)
15
+ include ::Dry::Types
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,32 @@
1
+ module Diagrams
2
+ class FlowchartDiagram < Base
3
+ attr_reader nodes: ::Array[Element::Node]
4
+ attr_reader edges: ::Array[Element::Edge]
5
+
6
+ # Initializes a new FlowchartDiagram.
7
+ def initialize: (?nodes: ::Array[Element::Node]?, ?edges: ::Array[Element::Edge]?, ?version: Integer | String?) -> void
8
+
9
+ # Adds a node to the diagram.
10
+ def add_node: (Element::Node node) -> Element::Node
11
+
12
+ # Adds an edge to the diagram.
13
+ def add_edge: (Element::Edge edge) -> Element::Edge
14
+
15
+ # Finds a node by its ID.
16
+ def find_node: (::String node_id) -> Element::Node?
17
+
18
+ # Returns the specific content of the flowchart diagram as a hash.
19
+ def to_h_content: () -> { nodes: ::Array[Hash[Symbol, untyped]], edges: ::Array[Hash[Symbol, untyped]] }
20
+
21
+ # Returns a hash mapping element types to their collections for diffing.
22
+ def identifiable_elements: () -> { nodes: ::Array[Elements::Node], edges: ::Array[Elements::Edge] }
23
+
24
+ # Class method to create a FlowchartDiagram from a hash.
25
+ def self.from_h: (Hash[Symbol | String, untyped] data_hash, version: Integer | String?, checksum: String?) -> FlowchartDiagram
26
+
27
+ private
28
+
29
+ # Validates the consistency of nodes and edges during initialization.
30
+ def validate_elements!: () -> void
31
+ end
32
+ end
@@ -0,0 +1,29 @@
1
+ module Diagrams
2
+ class GanttDiagram < Base
3
+ attr_reader title: ::String
4
+ attr_reader tasks: ::Array[Elements::Task]
5
+
6
+ # Initializes a new GanttDiagram.
7
+ def initialize: (?title: ::String?, ?tasks: ::Array[Elements::Task]?, ?version: Integer | String?) -> void
8
+
9
+ # Adds a task to the diagram.
10
+ def add_task: (Elements::Task task) -> Elements::Task
11
+
12
+ # Finds a task by its ID.
13
+ def find_task: (::String task_id) -> Elements::Task?
14
+
15
+ # Returns the specific content of the Gantt diagram as a hash.
16
+ def to_h_content: () -> { title: ::String, tasks: ::Array[Hash[Symbol, untyped]] }
17
+
18
+ # Returns a hash mapping element types to their collections for diffing.
19
+ def identifiable_elements: () -> { tasks: ::Array[Elements::Task] }
20
+
21
+ # Class method to create a GanttDiagram from a hash.
22
+ def self.from_h: (Hash[Symbol | String, untyped] data_hash, version: Integer | String?, checksum: String?) -> GanttDiagram
23
+
24
+ private
25
+
26
+ # Validates the consistency of tasks during initialization.
27
+ def validate_elements!: () -> void
28
+ end
29
+ end
@@ -0,0 +1,36 @@
1
+ module Diagrams
2
+ class PieDiagram < Base
3
+ attr_reader title: ::String
4
+ attr_reader slices: ::Array[Elements::Slice]
5
+
6
+ # Initializes a new PieDiagram.
7
+ def initialize: (?title: ::String?, ?slices: ::Array[Elements::Slice]?, ?version: Integer | String?) -> void
8
+
9
+ # Adds a slice to the diagram.
10
+ # Note: update_checksum and initial_load are internal flags.
11
+ def add_slice: (Elements::Slice slice, ?update_checksum: bool, ?initial_load: bool) -> Elements::Slice
12
+
13
+ # Finds a slice by its label.
14
+ def find_slice: (::String label) -> Elements::Slice?
15
+
16
+ # Calculates the total raw value of all slices.
17
+ def total_value: () -> ::Float
18
+
19
+ # Returns the specific content of the pie diagram as a hash.
20
+ def to_h_content: () -> { title: ::String, slices: ::Array[Hash[Symbol, untyped]] }
21
+
22
+ # Returns a hash mapping element types to their collections for diffing.
23
+ def identifiable_elements: () -> { slices: ::Array[Elements::Slice] }
24
+
25
+ # Class method to create a PieDiagram from a hash.
26
+ def self.from_h: (Hash[Symbol | String, untyped] data_hash, version: Integer | String?, checksum: String?) -> PieDiagram
27
+
28
+ private
29
+
30
+ # Validates the consistency of slices during initialization.
31
+ def validate_elements!: () -> void
32
+
33
+ # Recalculates the percentage for each slice based on the total value.
34
+ def recalculate_percentages!: () -> void
35
+ end
36
+ end
@@ -0,0 +1,40 @@
1
+ module Diagrams
2
+ class StateDiagram < Base
3
+ attr_reader title: ::String
4
+ attr_reader states: ::Array[Elements::State]
5
+ attr_reader transitions: ::Array[Elements::Transition]
6
+ attr_reader events: ::Array[Elements::Event]
7
+
8
+ # Initializes a new StateDiagram.
9
+ def initialize: (?title: ::String?, ?states: ::Array[Elements::State]?, ?transitions: ::Array[Elements::Transition]?, ?events: ::Array[Elements::Event]?, ?version: Integer | String?) -> void
10
+
11
+ # Adds a state to the diagram.
12
+ def add_state: (Elements::State state) -> Elements::State
13
+
14
+ # Adds a transition to the diagram.
15
+ def add_transition: (Elements::Transition transition) -> Elements::Transition
16
+
17
+ # Adds an event to the diagram.
18
+ def add_event: (Elements::Event event) -> Elements::Event
19
+
20
+ # Finds a state by its ID.
21
+ def find_state: (::String state_id) -> Elements::State?
22
+
23
+ # Finds an event by its ID.
24
+ def find_event: (::String event_id) -> Elements::Event?
25
+
26
+ # Returns the specific content of the state diagram as a hash.
27
+ def to_h_content: () -> { title: ::String, states: ::Array[Hash[Symbol, untyped]], transitions: ::Array[Hash[Symbol, untyped]], events: ::Array[Hash[Symbol, untyped]] }
28
+
29
+ # Returns a hash mapping element types to their collections for diffing.
30
+ def identifiable_elements: () -> { states: ::Array[Elements::State], transitions: ::Array[Elements::Transition], events: ::Array[Elements::Event] }
31
+
32
+ # Class method to create a StateDiagram from a hash.
33
+ def self.from_h: (Hash[Symbol | String, untyped] data_hash, version: Integer | String?, checksum: String?) -> StateDiagram
34
+
35
+ private
36
+
37
+ # Validates the consistency of elements during initialization.
38
+ def validate_elements!: () -> void
39
+ end
40
+ end
metadata CHANGED
@@ -1,15 +1,28 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: diagram
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Abdelkader Boudih
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-02-03 00:00:00.000000000 Z
10
+ date: 2025-03-31 00:00:00.000000000 Z
12
11
  dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: dry-equalizer
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: '0.2'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: '0.2'
13
26
  - !ruby/object:Gem::Dependency
14
27
  name: dry-struct
15
28
  requirement: !ruby/object:Gem::Requirement
@@ -24,6 +37,174 @@ dependencies:
24
37
  - - ">="
25
38
  - !ruby/object:Gem::Version
26
39
  version: 1.6.0
40
+ - !ruby/object:Gem::Dependency
41
+ name: dry-types
42
+ requirement: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '1.0'
47
+ type: :runtime
48
+ prerelease: false
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '1.0'
54
+ - !ruby/object:Gem::Dependency
55
+ name: json
56
+ requirement: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ type: :runtime
62
+ prerelease: false
63
+ version_requirements: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ - !ruby/object:Gem::Dependency
69
+ name: zeitwerk
70
+ requirement: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '2.6'
75
+ type: :runtime
76
+ prerelease: false
77
+ version_requirements: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '2.6'
82
+ - !ruby/object:Gem::Dependency
83
+ name: bundler
84
+ requirement: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: 2.5.5
89
+ type: :development
90
+ prerelease: false
91
+ version_requirements: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: 2.5.5
96
+ - !ruby/object:Gem::Dependency
97
+ name: minitest
98
+ requirement: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - "~>"
101
+ - !ruby/object:Gem::Version
102
+ version: '5.0'
103
+ type: :development
104
+ prerelease: false
105
+ version_requirements: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - "~>"
108
+ - !ruby/object:Gem::Version
109
+ version: '5.0'
110
+ - !ruby/object:Gem::Dependency
111
+ name: rake
112
+ requirement: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - "~>"
115
+ - !ruby/object:Gem::Version
116
+ version: '13.0'
117
+ type: :development
118
+ prerelease: false
119
+ version_requirements: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - "~>"
122
+ - !ruby/object:Gem::Version
123
+ version: '13.0'
124
+ - !ruby/object:Gem::Dependency
125
+ name: rubocop
126
+ requirement: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - "~>"
129
+ - !ruby/object:Gem::Version
130
+ version: '1.59'
131
+ type: :development
132
+ prerelease: false
133
+ version_requirements: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - "~>"
136
+ - !ruby/object:Gem::Version
137
+ version: '1.59'
138
+ - !ruby/object:Gem::Dependency
139
+ name: rubocop-minitest
140
+ requirement: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - "~>"
143
+ - !ruby/object:Gem::Version
144
+ version: '0.34'
145
+ type: :development
146
+ prerelease: false
147
+ version_requirements: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - "~>"
150
+ - !ruby/object:Gem::Version
151
+ version: '0.34'
152
+ - !ruby/object:Gem::Dependency
153
+ name: rubocop-performance
154
+ requirement: !ruby/object:Gem::Requirement
155
+ requirements:
156
+ - - "~>"
157
+ - !ruby/object:Gem::Version
158
+ version: '1.20'
159
+ type: :development
160
+ prerelease: false
161
+ version_requirements: !ruby/object:Gem::Requirement
162
+ requirements:
163
+ - - "~>"
164
+ - !ruby/object:Gem::Version
165
+ version: '1.20'
166
+ - !ruby/object:Gem::Dependency
167
+ name: rubocop-rake
168
+ requirement: !ruby/object:Gem::Requirement
169
+ requirements:
170
+ - - "~>"
171
+ - !ruby/object:Gem::Version
172
+ version: '0.6'
173
+ type: :development
174
+ prerelease: false
175
+ version_requirements: !ruby/object:Gem::Requirement
176
+ requirements:
177
+ - - "~>"
178
+ - !ruby/object:Gem::Version
179
+ version: '0.6'
180
+ - !ruby/object:Gem::Dependency
181
+ name: steep
182
+ requirement: !ruby/object:Gem::Requirement
183
+ requirements:
184
+ - - ">="
185
+ - !ruby/object:Gem::Version
186
+ version: '0'
187
+ type: :development
188
+ prerelease: false
189
+ version_requirements: !ruby/object:Gem::Requirement
190
+ requirements:
191
+ - - ">="
192
+ - !ruby/object:Gem::Version
193
+ version: '0'
194
+ - !ruby/object:Gem::Dependency
195
+ name: yard
196
+ requirement: !ruby/object:Gem::Requirement
197
+ requirements:
198
+ - - "~>"
199
+ - !ruby/object:Gem::Version
200
+ version: '0.9'
201
+ type: :development
202
+ prerelease: false
203
+ version_requirements: !ruby/object:Gem::Requirement
204
+ requirements:
205
+ - - "~>"
206
+ - !ruby/object:Gem::Version
207
+ version: '0.9'
27
208
  description: Work with diagrams in Ruby
28
209
  email:
29
210
  - seuros@pre-history.com
@@ -32,27 +213,38 @@ extensions: []
32
213
  extra_rdoc_files: []
33
214
  files:
34
215
  - lib/diagrams.rb
35
- - lib/diagrams/abstract_diagram.rb
216
+ - lib/diagrams/base.rb
36
217
  - lib/diagrams/class_diagram.rb
37
- - lib/diagrams/class_diagram/class.rb
38
- - lib/diagrams/class_diagram/class/field.rb
39
- - lib/diagrams/class_diagram/class/function.rb
40
- - lib/diagrams/class_diagram/class/function/argument.rb
41
- - lib/diagrams/comparable.rb
218
+ - lib/diagrams/elements/class_entity.rb
219
+ - lib/diagrams/elements/edge.rb
220
+ - lib/diagrams/elements/event.rb
221
+ - lib/diagrams/elements/node.rb
222
+ - lib/diagrams/elements/relationship.rb
223
+ - lib/diagrams/elements/slice.rb
224
+ - lib/diagrams/elements/state.rb
225
+ - lib/diagrams/elements/task.rb
226
+ - lib/diagrams/elements/transition.rb
42
227
  - lib/diagrams/flowchart_diagram.rb
43
- - lib/diagrams/flowchart_diagram/link.rb
44
- - lib/diagrams/flowchart_diagram/node.rb
45
228
  - lib/diagrams/gantt_diagram.rb
46
- - lib/diagrams/gantt_diagram/section.rb
47
- - lib/diagrams/gantt_diagram/section/task.rb
48
229
  - lib/diagrams/pie_diagram.rb
49
- - lib/diagrams/pie_diagram/section.rb
50
- - lib/diagrams/plot.rb
51
230
  - lib/diagrams/state_diagram.rb
52
- - lib/diagrams/state_diagram/event.rb
53
- - lib/diagrams/state_diagram/state.rb
54
- - lib/diagrams/state_diagram/transition.rb
55
231
  - lib/diagrams/version.rb
232
+ - sig/diagrams/base.rbs
233
+ - sig/diagrams/class_diagram.rbs
234
+ - sig/diagrams/elements/class_entity.rbs
235
+ - sig/diagrams/elements/edge.rbs
236
+ - sig/diagrams/elements/event.rbs
237
+ - sig/diagrams/elements/node.rbs
238
+ - sig/diagrams/elements/relationship.rbs
239
+ - sig/diagrams/elements/slice.rbs
240
+ - sig/diagrams/elements/state.rbs
241
+ - sig/diagrams/elements/task.rbs
242
+ - sig/diagrams/elements/transition.rbs
243
+ - sig/diagrams/elements/types.rbs
244
+ - sig/diagrams/flowchart_diagram.rbs
245
+ - sig/diagrams/gantt_diagram.rbs
246
+ - sig/diagrams/pie_diagram.rbs
247
+ - sig/diagrams/state_diagram.rbs
56
248
  homepage: https://github.com/seuros/diagram-ruby
57
249
  licenses:
58
250
  - MIT
@@ -61,7 +253,6 @@ metadata:
61
253
  source_code_uri: https://github.com/seuros/diagram-ruby
62
254
  changelog_uri: https://github.com/seuros/diagram-ruby/blob/master/CHANGELOG.md
63
255
  rubygems_mfa_required: 'true'
64
- post_install_message:
65
256
  rdoc_options: []
66
257
  require_paths:
67
258
  - lib
@@ -69,15 +260,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
69
260
  requirements:
70
261
  - - ">="
71
262
  - !ruby/object:Gem::Version
72
- version: 3.1.0
263
+ version: 3.3.0
73
264
  required_rubygems_version: !ruby/object:Gem::Requirement
74
265
  requirements:
75
266
  - - ">="
76
267
  - !ruby/object:Gem::Version
77
268
  version: '0'
78
269
  requirements: []
79
- rubygems_version: 3.4.10
80
- signing_key:
270
+ rubygems_version: 3.6.2
81
271
  specification_version: 4
82
272
  summary: Work with diagrams in Ruby
83
273
  test_files: []
@@ -1,26 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Diagrams
4
- # Abstract class for diagrams
5
- class AbstractDiagram < Dry::Struct
6
- module Types
7
- include Dry.Types()
8
- end
9
-
10
- def initialize(*)
11
- raise NotImplementedError, 'Cannot instantiate abstract class' if instance_of?(AbstractDiagram)
12
-
13
- super
14
- end
15
-
16
- def type
17
- raise NotImplementedError, 'Subclasses must define `type`.'
18
- end
19
-
20
- ## Errors
21
- class ValidationError < StandardError; end
22
- class EmptyDiagramError < ValidationError; end
23
- class InvalidPercentageError < ValidationError; end
24
- class DuplicateLabelError < ValidationError; end
25
- end
26
- end
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Diagrams
4
- class ClassDiagram
5
- class Class
6
- class Field < Dry::Struct
7
- attribute :name, ClassDiagram::Types::String
8
- attribute :type, ClassDiagram::Types::String.optional.default('String')
9
- attribute :visibility,
10
- ClassDiagram::Types::String.optional.default('public')
11
- .constrained(format: /\A(public|private|protected|Internal)\z/)
12
- end
13
- end
14
- end
15
- end
@@ -1,14 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Diagrams
4
- class ClassDiagram
5
- class Class
6
- class Function
7
- class Argument < Dry::Struct
8
- attribute :name, ClassDiagram::Types::String
9
- attribute :type, ClassDiagram::Types::String.optional.default(nil)
10
- end
11
- end
12
- end
13
- end
14
- end