Almirah 0.4.2 → 0.4.4

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 (54) hide show
  1. checksums.yaml +4 -4
  2. data/bin/almirah +2 -2
  3. data/lib/almirah/doc_fabric.rb +25 -0
  4. data/lib/almirah/doc_items/blockquote.rb +15 -16
  5. data/lib/almirah/doc_items/code_block.rb +19 -21
  6. data/lib/almirah/doc_items/controlled_paragraph.rb +4 -4
  7. data/lib/almirah/doc_items/controlled_table.rb +11 -11
  8. data/lib/almirah/doc_items/controlled_table_row.rb +15 -18
  9. data/lib/almirah/doc_items/doc_footer.rb +10 -13
  10. data/lib/almirah/doc_items/doc_item.rb +2 -2
  11. data/lib/almirah/doc_items/heading.rb +1 -1
  12. data/lib/almirah/doc_items/image.rb +25 -27
  13. data/lib/almirah/doc_items/markdown_list.rb +2 -2
  14. data/lib/almirah/doc_items/markdown_table.rb +9 -2
  15. data/lib/almirah/doc_items/scope_table.rb +188 -0
  16. data/lib/almirah/doc_items/text_line.rb +26 -22
  17. data/lib/almirah/doc_items/todo_block.rb +15 -16
  18. data/lib/almirah/doc_items/work_item.rb +129 -0
  19. data/lib/almirah/doc_parser.rb +15 -8
  20. data/lib/almirah/doc_types/base_document.rb +31 -7
  21. data/lib/almirah/doc_types/coverage.rb +3 -3
  22. data/lib/almirah/doc_types/critical_chain_page.rb +218 -0
  23. data/lib/almirah/doc_types/decision.rb +152 -7
  24. data/lib/almirah/doc_types/decision_grouping.rb +17 -0
  25. data/lib/almirah/doc_types/decisions_overview.rb +591 -31
  26. data/lib/almirah/doc_types/implementation.rb +98 -98
  27. data/lib/almirah/doc_types/index.rb +11 -12
  28. data/lib/almirah/doc_types/persistent_document.rb +1 -1
  29. data/lib/almirah/doc_types/planning_dates.rb +17 -0
  30. data/lib/almirah/doc_types/protocol.rb +16 -20
  31. data/lib/almirah/doc_types/risk_record.rb +77 -0
  32. data/lib/almirah/doc_types/risk_registry_page.rb +141 -0
  33. data/lib/almirah/doc_types/risks_overview.rb +102 -0
  34. data/lib/almirah/doc_types/rpn_rendering.rb +23 -0
  35. data/lib/almirah/doc_types/source_file.rb +1 -1
  36. data/lib/almirah/doc_types/traceability.rb +124 -133
  37. data/lib/almirah/dom/doc_section.rb +1 -1
  38. data/lib/almirah/navigation_pane.rb +9 -13
  39. data/lib/almirah/project/critical_chain.rb +117 -0
  40. data/lib/almirah/project/doc_linker.rb +4 -4
  41. data/lib/almirah/project/fever_chart.rb +94 -0
  42. data/lib/almirah/project/project_data.rb +17 -2
  43. data/lib/almirah/project/work_item_scheduler.rb +167 -0
  44. data/lib/almirah/project/working_calendar.rb +112 -0
  45. data/lib/almirah/project.rb +307 -9
  46. data/lib/almirah/project_configuration.rb +176 -29
  47. data/lib/almirah/project_template.rb +6 -6
  48. data/lib/almirah/project_utility.rb +3 -5
  49. data/lib/almirah/search/specifications_db.rb +2 -2
  50. data/lib/almirah/source_file_parser.rb +2 -3
  51. data/lib/almirah/templates/css/main.css +173 -1
  52. data/lib/almirah/templates/scripts/main.js +3 -1
  53. data/lib/almirah.rb +1 -2
  54. metadata +14 -1
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'fileutils'
4
4
 
5
- class ProjectTemplate # rubocop:disable Style/Documentation
5
+ class ProjectTemplate
6
6
  attr_accessor :project_root
7
7
 
8
8
  def initialize(project_name)
@@ -324,11 +324,11 @@ class ProjectTemplate # rubocop:disable Style/Documentation
324
324
 
325
325
  # Scope
326
326
 
327
- | Item | Status | Start Date | Target Date | Description |
328
- |---|---|---|---|---|
329
- | Requirements | To Do | | | |
330
- | Code | To Do | | | |
331
- | Tests | To Do | | | |
327
+ | # | Item | Owner | Depends On | Est (focused) | Est (safe) | Status | Start Date | Target Date | Description |
328
+ |---|---|---|---|---|---|---|---|---|---|
329
+ | 1 | Requirements | BA | | 2 | 3 | To Do | | | |
330
+ | 2 | Code | DEV | | 3 | 5 | To Do | | | |
331
+ | 3 | Tests | TEST | | 2 | 4 | To Do | | | |
332
332
 
333
333
  # Out of Scope
334
334
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'fileutils'
4
4
 
5
- class ProjectUtility # rubocop:disable Style/Documentation
5
+ class ProjectUtility
6
6
  attr_accessor :configuration
7
7
 
8
8
  def initialize(configuration)
@@ -19,7 +19,7 @@ class ProjectUtility # rubocop:disable Style/Documentation
19
19
 
20
20
  private
21
21
 
22
- def combine(run_id) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
22
+ def combine(run_id)
23
23
  path = @configuration.project_root_directory
24
24
  dst_folder = "#{@configuration.project_root_directory}/build"
25
25
  FileUtils.mkdir_p(dst_folder)
@@ -29,9 +29,7 @@ class ProjectUtility # rubocop:disable Style/Documentation
29
29
  dst_f = File.open(dst_file, 'a')
30
30
 
31
31
  src_path = if run_id
32
- unless Dir.exist? "#{path}/tests/runs/#{run_id}"
33
- puts "\e[1m\e[31m Run #{run_id} folder does not exists"
34
- end
32
+ puts "\e[1m\e[31m Run #{run_id} folder does not exists" unless Dir.exist? "#{path}/tests/runs/#{run_id}"
35
33
  "#{path}/tests/runs/#{run_id}/**/*.md"
36
34
  else
37
35
  "#{path}/tests/protocols/**/*.md"
@@ -12,7 +12,7 @@ class SpecificationsDb
12
12
  create_data
13
13
  end
14
14
 
15
- def create_data # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
15
+ def create_data
16
16
  @specifications.each do |sp|
17
17
  sp.items.each do |i|
18
18
  if (i.instance_of? Paragraph) or (i.instance_of? ControlledParagraph)
@@ -31,7 +31,7 @@ class SpecificationsDb
31
31
  end
32
32
  end
33
33
 
34
- def add_markdown_list_item_to_db(data, item_for_reference, item_to_process) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
34
+ def add_markdown_list_item_to_db(data, item_for_reference, item_to_process)
35
35
  e = nil
36
36
  item_to_process.rows.each do |r|
37
37
  if r.is_a?(MarkdownList)
@@ -2,7 +2,7 @@ require_relative 'doc_items/doc_item'
2
2
  require_relative 'doc_items/heading'
3
3
  require_relative 'doc_items/source_code_paragraph'
4
4
 
5
- class SourceFileParser # rubocop:disable Style/Documentation
5
+ class SourceFileParser
6
6
  def self.parse(doc, file_lines)
7
7
  # restart section numbering for each new document
8
8
  Heading.reset_global_section_number
@@ -19,7 +19,7 @@ class SourceFileParser # rubocop:disable Style/Documentation
19
19
  doc.headings.append(item)
20
20
 
21
21
  # main loop
22
- file_lines.each do |s| # rubocop:disable Metrics/BlockLength
22
+ file_lines.each do |s|
23
23
  res = %r{<REQ>(.*)</REQ>}.match(s) # Document Referece Item
24
24
  next unless res
25
25
 
@@ -36,7 +36,6 @@ class SourceFileParser # rubocop:disable Style/Documentation
36
36
  up_links = []
37
37
  tmp.each do |ul|
38
38
  lnk = ul[0]
39
- #
40
39
  doc_id = /([a-zA-Z]+)-\d+/.match(lnk) # SRS
41
40
  up_links << lnk.upcase if doc_id
42
41
  # try to find the real end of text
@@ -77,6 +77,9 @@ table.markdown_table td{
77
77
  table.markdown_table tr.current_status td {
78
78
  background-color: #ffffee;
79
79
  }
80
+ table.markdown_table td.scope_date {
81
+ white-space: nowrap;
82
+ }
80
83
  table.controlled{
81
84
  border: 1px solid #e4e4e4;
82
85
  border-collapse: collapse;
@@ -144,6 +147,163 @@ table.controlled td.item_text{
144
147
  max-width: 100%;
145
148
  max-height: 300px;
146
149
  }
150
+ .workitem_gantt {
151
+ --gantt-owner-width: 120px;
152
+ --gantt-day-width: 26px;
153
+ --gantt-month-h: 18px;
154
+ overflow: auto;
155
+ max-height: 420px;
156
+ margin-bottom: 16px;
157
+ border: 1px solid #e1e4e8;
158
+ }
159
+ .workitem_gantt .gantt_grid {
160
+ display: grid;
161
+ gap: 0;
162
+ width: max-content;
163
+ padding: 4px;
164
+ }
165
+ .workitem_gantt .gantt_corner,
166
+ .workitem_gantt .gantt_owner,
167
+ .workitem_gantt .gantt_owner_tracking,
168
+ .workitem_gantt .gantt_band_corner,
169
+ .workitem_gantt .gantt_buffer {
170
+ position: sticky;
171
+ left: 0;
172
+ background: #fff;
173
+ padding: 2px 8px;
174
+ font-weight: 600;
175
+ white-space: nowrap;
176
+ border-right: 1px solid #e1e4e8;
177
+ z-index: 2;
178
+ }
179
+ .workitem_gantt .gantt_corner {
180
+ top: 0;
181
+ border-bottom: 1px solid #bbb;
182
+ z-index: 3;
183
+ }
184
+ .workitem_gantt .gantt_month_head {
185
+ position: sticky;
186
+ top: 0;
187
+ background: #fff;
188
+ text-align: center;
189
+ font-size: 11px;
190
+ font-weight: 600;
191
+ color: #57606a;
192
+ border-bottom: 1px solid #e1e4e8;
193
+ border-left: 1px solid #d0d7de;
194
+ white-space: nowrap;
195
+ overflow: hidden;
196
+ z-index: 1;
197
+ }
198
+ .workitem_gantt .gantt_day_head {
199
+ position: sticky;
200
+ top: var(--gantt-month-h);
201
+ background: #fff;
202
+ text-align: center;
203
+ font-size: 11px;
204
+ color: #57606a;
205
+ border-bottom: 1px solid #bbb;
206
+ z-index: 1;
207
+ }
208
+ /* Weekday-holiday highlight in the Chart.js palette red (ADR-205 amendment):
209
+ the column carries the buffer bar's diagonal stripe texture, in red; the
210
+ header stays a solid tint so the day number reads. */
211
+ .workitem_gantt .gantt_day_head.gantt_nonworking { background: rgba(255, 99, 132, 0.22); color: #b23a52; }
212
+ .workitem_gantt .gantt_day_head.gantt_friday { background: rgb(225, 241, 250); }
213
+ .workitem_gantt .gantt_nonworking_col {
214
+ background: repeating-linear-gradient(45deg,
215
+ rgba(255, 99, 132, 0.20), rgba(255, 99, 132, 0.20) 5px,
216
+ rgba(255, 99, 132, 0.07) 5px, rgba(255, 99, 132, 0.07) 10px);
217
+ }
218
+ .workitem_gantt .gantt_friday_col { background: rgb(225, 241, 250); }
219
+ .workitem_gantt .gantt_bar,
220
+ .workitem_gantt .gantt_track_bar {
221
+ font-size: 11px;
222
+ line-height: 1.5;
223
+ margin: 1px;
224
+ padding: 1px 5px;
225
+ border-radius: 3px;
226
+ overflow: hidden;
227
+ white-space: nowrap;
228
+ text-overflow: ellipsis;
229
+ color: #fff;
230
+ cursor: default;
231
+ }
232
+ .workitem_gantt .gantt_todo { background: #9aa5b1; }
233
+ .workitem_gantt .gantt_inprogress { background: #ffffdd; color: #333; box-shadow: inset 0 0 0 1px #bbb; }
234
+ .workitem_gantt .gantt_done { background: #cfc; color: #57606a; box-shadow: inset 0 0 0 1px #e1e4e8; }
235
+ .workitem_gantt .gantt_blocked { box-shadow: inset 0 0 0 1px #bbb; }
236
+ .workitem_gantt .gantt_critical { outline: 1px solid #9a6700; outline-offset: -1px; } /* buffer-bar amber (dark) */
237
+ .workitem_gantt .gantt_release_band {
238
+ text-align: center;
239
+ font-size: 11px;
240
+ font-weight: 600;
241
+ color: #57606a;
242
+ background: #eef1f4;
243
+ border-bottom: 1px solid #e1e4e8;
244
+ border-left: 1px solid #d0d7de;
245
+ padding: 2px 4px;
246
+ white-space: nowrap;
247
+ overflow: hidden;
248
+ text-overflow: ellipsis;
249
+ }
250
+ .workitem_gantt .gantt_buffer { color: #9a6700; }
251
+ .critical_chain { margin-bottom: 16px; }
252
+ .critical_chain h2 { font-size: 1.1em; margin-bottom: 6px; }
253
+ .critical_chain .cc_group { margin: 8px 0; }
254
+ .critical_chain .cc_group h3 { font-size: 0.95em; margin: 4px 0; }
255
+ .critical_chain table.cc_chain { border-collapse: collapse; margin: 4px 0; }
256
+ .critical_chain table.cc_chain th,
257
+ .critical_chain table.cc_chain td { border: 1px solid #e1e4e8; padding: 2px 8px; text-align: left; font-size: 12px; }
258
+ .critical_chain .cc_buffer,
259
+ .critical_chain .cc_consumed,
260
+ .critical_chain .cc_projected,
261
+ .critical_chain .cc_finish { margin: 2px 0; font-size: 12px; }
262
+ .critical_chain .cc_consumed { color: #57606a; }
263
+ .critical_chain .cc_finish { font-weight: 600; }
264
+ .critical_chain .cc_unestimated { color: #9a6700; font-style: italic; font-size: 12px; }
265
+ .critical_chain .cc_group_body { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
266
+ .critical_chain .cc_plan { flex: 1 1 320px; }
267
+ .critical_chain .cc_fever { flex: 1 1 360px; max-width: 480px; height: 320px; position: relative; }
268
+ .critical_chain .cc_fever .fever_canvas { width: 100%; height: 100%; }
269
+ .workitem_gantt .gantt_buffer_bar {
270
+ font-size: 11px;
271
+ line-height: 1.5;
272
+ margin: 1px;
273
+ padding: 1px 5px;
274
+ border-radius: 3px;
275
+ text-align: center;
276
+ overflow: hidden;
277
+ white-space: nowrap;
278
+ text-overflow: ellipsis;
279
+ color: #9a6700;
280
+ background: repeating-linear-gradient(45deg, #ffe9b3, #ffe9b3 5px, #fff3d4 5px, #fff3d4 10px);
281
+ box-shadow: inset 0 0 0 1px #e0c068;
282
+ cursor: default;
283
+ }
284
+ .workitem_gantt .gantt_today { border-left: 2px solid #d33; z-index: 5; pointer-events: none; }
285
+ /* Plan-vs-actual tracking lanes (ADR-213): hidden until the toolbar toggle adds
286
+ show-actuals; a hidden lane's grid tracks collapse to zero height. */
287
+ .workitem_gantt .gantt_tracking_lane { display: none; }
288
+ .workitem_gantt.show-actuals .gantt_tracking_lane { display: block; }
289
+ .workitem_gantt .gantt_owner_tracking { font-weight: 400; font-style: italic; color: #57606a; }
290
+ .workitem_gantt .gantt_track_committed { background: #b0b6bd; }
291
+ .workitem_gantt .gantt_track_logged { background: #36a2eb; }
292
+ .gantt_container .gantt_toolbar {
293
+ display: flex;
294
+ justify-content: flex-end;
295
+ gap: 6px;
296
+ padding: 4px 0;
297
+ }
298
+ .gantt_container .gantt_actuals_toggle {
299
+ font-size: 12px;
300
+ padding: 3px 10px;
301
+ border: 1px solid #d0d7de;
302
+ border-radius: 4px;
303
+ background: #f6f8fa;
304
+ cursor: pointer;
305
+ }
306
+ .gantt_container .gantt_actuals_toggle:hover { background: #eef1f4; }
147
307
  table.controlled:not(.odd-even) tbody tr:nth-child(odd) { background-color:#f6f7f8; }
148
308
  table.controlled:not(.odd-even) tbody tr:nth-child(even) { background-color: #fff; }
149
309
  table.controlled:not(.odd-even) tbody tr:nth-child(odd):hover,
@@ -345,4 +505,16 @@ img{
345
505
  padding: 5px;
346
506
  text-align:center;
347
507
  background:#fff;
348
- }
508
+ }/* Risk register RPN threshold bands (ADR-217): acceptable / ALARP caution / unacceptable */
509
+ td.item_rpn {
510
+ text-align: center;
511
+ }
512
+ td.rpn_acceptable {
513
+ background-color: #d5f5e3;
514
+ }
515
+ td.rpn_caution {
516
+ background-color: #fdebd0;
517
+ }
518
+ td.rpn_unacceptable {
519
+ background-color: #fadbd8;
520
+ }
@@ -25,7 +25,9 @@ function openNav() {
25
25
  document.getElementById("searchInput").style.display = "block";
26
26
  }
27
27
  }else{
28
- if (document.title.includes("Traceability Matrix:")){
28
+ var navPane = document.getElementById('nav_pane');
29
+ var hasNav = navPane && navPane.innerHTML.trim() !== "";
30
+ if (document.title.includes("Traceability Matrix:") || !hasNav){
29
31
  document.getElementById('document_tree_menu_item').style.display = "none";
30
32
  } else {
31
33
  document.getElementById('document_tree_menu_item').style.display = "block";
data/lib/almirah.rb CHANGED
@@ -54,8 +54,7 @@ class CLI < Thor
54
54
  end
55
55
 
56
56
  class Almirah
57
- attr_accessor :project
58
- attr_accessor :project_utility
57
+ attr_accessor :project, :project_utility
59
58
 
60
59
  def initialize(project_folder)
61
60
  config = ProjectConfiguration.new project_folder
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Almirah
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oleksandr Ivanov
@@ -73,18 +73,27 @@ files:
73
73
  - lib/almirah/doc_items/markdown_list.rb
74
74
  - lib/almirah/doc_items/markdown_table.rb
75
75
  - lib/almirah/doc_items/paragraph.rb
76
+ - lib/almirah/doc_items/scope_table.rb
76
77
  - lib/almirah/doc_items/source_code_paragraph.rb
77
78
  - lib/almirah/doc_items/text_line.rb
78
79
  - lib/almirah/doc_items/todo_block.rb
80
+ - lib/almirah/doc_items/work_item.rb
79
81
  - lib/almirah/doc_parser.rb
80
82
  - lib/almirah/doc_types/base_document.rb
81
83
  - lib/almirah/doc_types/coverage.rb
84
+ - lib/almirah/doc_types/critical_chain_page.rb
82
85
  - lib/almirah/doc_types/decision.rb
86
+ - lib/almirah/doc_types/decision_grouping.rb
83
87
  - lib/almirah/doc_types/decisions_overview.rb
84
88
  - lib/almirah/doc_types/implementation.rb
85
89
  - lib/almirah/doc_types/index.rb
86
90
  - lib/almirah/doc_types/persistent_document.rb
91
+ - lib/almirah/doc_types/planning_dates.rb
87
92
  - lib/almirah/doc_types/protocol.rb
93
+ - lib/almirah/doc_types/risk_record.rb
94
+ - lib/almirah/doc_types/risk_registry_page.rb
95
+ - lib/almirah/doc_types/risks_overview.rb
96
+ - lib/almirah/doc_types/rpn_rendering.rb
88
97
  - lib/almirah/doc_types/source_file.rb
89
98
  - lib/almirah/doc_types/specification.rb
90
99
  - lib/almirah/doc_types/traceability.rb
@@ -94,8 +103,12 @@ files:
94
103
  - lib/almirah/link_registry.rb
95
104
  - lib/almirah/navigation_pane.rb
96
105
  - lib/almirah/project.rb
106
+ - lib/almirah/project/critical_chain.rb
97
107
  - lib/almirah/project/doc_linker.rb
108
+ - lib/almirah/project/fever_chart.rb
98
109
  - lib/almirah/project/project_data.rb
110
+ - lib/almirah/project/work_item_scheduler.rb
111
+ - lib/almirah/project/working_calendar.rb
99
112
  - lib/almirah/project_configuration.rb
100
113
  - lib/almirah/project_template.rb
101
114
  - lib/almirah/project_utility.rb