Class: LabSystem::KrokiRequest

Inherits:
WebSystem::SimpleRequest show all
Defined in:
lib/lab_system/requests/kroki_request.rb

Instance Attribute Summary

Attributes inherited from WebSystem::SimpleRequest

#env

Instance Method Summary collapse

Methods inherited from WebSystem::SimpleRequest

#_call_action, #action, #call, call, #format, #http_method, #qs, #request, #response_404, #segments

Methods inherited from Liza::Controller

color, inherited, on_connected

Methods inherited from Liza::Unit

const_missing, division, part, system, #system, test_class

Instance Method Details

#call_indexObject



3
4
5
6
7
8
9
10
# File 'lib/lab_system/requests/kroki_request.rb', line 3

def call_index
  @kroki_clients = []

  @kroki_clients << KrokiClient.new_plantuml(:ab, :svg)
  @kroki_clients << KrokiClient.new_nomnoml(:ab, :svg)

  @kroki_clients.map &:call
end

#call_nomnomlObject



24
25
26
27
28
29
30
# File 'lib/lab_system/requests/kroki_request.rb', line 24

def call_nomnoml
  @kroki_clients = []

  @kroki_clients << KrokiClient.new_nomnoml(:ab, :svg)

  @kroki_clients.map &:call
end

#call_plantumlObject



14
15
16
17
18
19
20
# File 'lib/lab_system/requests/kroki_request.rb', line 14

def call_plantuml
  @kroki_clients = []
  
  @kroki_clients << KrokiClient.new_plantuml(:ab, :svg)

  @kroki_clients.map &:call
end

#call_plantuml_lizaObject



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/lab_system/requests/kroki_request.rb', line 34

def call_plantuml_liza
  @kroki_clients = []

  Lizarb.loaders.map &:eager_load

  @kroki_clients << LizaKrokiClient.new_plantuml(:liza_1, :svg) {
    @units = Unit.subclasses.sort { _1.name <=> _2.name }.reverse
  }
  @kroki_clients << LizaKrokiClient.new_plantuml(:liza_1, :svg) {
    @units = [Liza::System]
    @systems_in_objects = [DevSystem, NetSystem, WebSystem]
  }
  @kroki_clients << LizaKrokiClient.new_plantuml(:liza_1, :svg) {
    @units = [Liza::System]
    @systems_in_objects = [HappySystem, LabSystem]
  }
  @kroki_clients << LizaKrokiClient.new_plantuml(:liza_1, :svg) {
    @units = [Liza::System]
    @systems_in_objects = App.systems.values
  }
  @kroki_clients << LizaKrokiClient.new_plantuml(:liza_1, :svg) {
    @units = [Box]
    @boxes = [DevBox]
    @subs = []
    @objects = []
    @systems = (@boxes+@subs+@objects).map(&:system).uniq
  }
  @kroki_clients << LizaKrokiClient.new_plantuml(:liza_1, :svg) {
    @units = [Box]
    @boxes = [DevBox, NetBox, WebBox]
    @subs = []
    @objects = []
    @systems = (@boxes+@subs+@objects).map(&:system).uniq
  }
  @kroki_clients << LizaKrokiClient.new_plantuml(:liza_1, :svg) {
    @units = [Panel, Controller]
    @subs = [Command, Shell]
    @objects = []
    @systems = (@subs+@objects).map(&:system).uniq
  }
  @kroki_clients << LizaKrokiClient.new_plantuml(:liza_1, :svg) {
    @units = [Controller]
    @subs = []
    @objects = App.systems.values.map { _1.box.panels.values.map(&:division) }.flatten
    @systems = (@subs+@objects).map(&:system).uniq
  }

  # NetSystem

  @kroki_clients << LizaKrokiClient.new_plantuml(:liza_1, :svg) {
    @units = [Controller]
    @subs = []
    @objects = [Command, Database, Client, DatabaseCommand, *Database.descendants, *Client.descendants]
    @systems = (@subs+@objects).map(&:system).uniq
  }

  # WebSystem

  @kroki_clients << LizaKrokiClient.new_plantuml(:liza_1, :svg) {
    @units = [Controller]
    @subs = [Command, WebSystem::Rack]
    @objects = [RackCommand, MiddleRack, ServerRack, *MiddleRack.subclasses, *ServerRack.subclasses]
    @systems = (@subs+@objects).map(&:system).uniq
  }

  @kroki_clients << LizaKrokiClient.new_plantuml(:liza_1, :svg) {
    @units = [Controller]
    @subs = []
    @objects = [Command, Request, RequestCommand, *Request.descendants]
    @systems = (@subs+@objects).map(&:system).uniq
  }

  @kroki_clients.map &:call
end