clerq 0.3.3 → 0.3.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.
@@ -0,0 +1,34 @@
1
+ require 'clerq'
2
+ require 'minitest/autorun'
3
+ require_relative "../markup_node"
4
+ include Clerq::Entities
5
+
6
+ describe MarkupNode do
7
+ let(:node) {
8
+ root = Node.new
9
+ node = Node.new(id: 'id', title: 'Title', body: 'Body')
10
+ root << node
11
+ MarkupNode.new(node)
12
+ }
13
+
14
+ describe '#markup' do
15
+ let(:output) {
16
+ <<~EOF.strip
17
+ # Title {#id}
18
+
19
+ Attribute | Value
20
+ --------- | -----
21
+ id | id
22
+
23
+ Body
24
+ EOF
25
+ }
26
+
27
+ it 'must return markup' do
28
+ _(node.markup).must_equal output
29
+ end
30
+
31
+ it 'must replace links'
32
+ it 'must process macro'
33
+ end
34
+ end
Binary file
@@ -1,15 +1,25 @@
1
- % Clеrk SRS
2
- % generated by Clerq on November 8, 2019 at 20:16
1
+ % Clеrq SRS
2
+ % generated by Clerq on May 28, 2021 at 11:06
3
+ % default template
3
4
 
4
- # 1 Introduction
5
+ # Introduction
6
+ {{
7
+ skip_meta: true
8
+ }}
5
9
 
6
- ## 1.1 Purpose
10
+ ## Purpose
11
+ {{
12
+ skip_meta: true
13
+ }}
7
14
 
8
15
  The purpose of this document is to provide a demo project "Clerq Promo SRS" for all perspective Clerq users to introduce the system by example and provide a sandbox for experiments for the existing users.
9
16
 
10
17
  The other purpose (rather technical) is to have repository that provides all possible combinations of markup inside (links, ids, macros, etc.) to exercise in writing documents templates.
11
18
 
12
- ## 1.2 Scope
19
+ ## Scope
20
+ {{
21
+ skip_meta: true
22
+ }}
13
23
 
14
24
  This software system will be a command-line interface (CLI) that provides a set of tools related to requirements management tasks. The system will also provide the requirements repository structure and the format of the requirements sources.
15
25
 
@@ -17,7 +27,10 @@ The system does not provide any graphical user interface. Assumed that users cre
17
27
 
18
28
  Any features related to restricting access to the requirements repository or to the functions of the system are out of scope. Assumed that each project repository is under control of an SCM tool (Git, Subversion, etc.) and the SCM is in charge of user's access to the SCM artifacts.
19
29
 
20
- ## 1.3 Definitions, acronyms, and abbreviations
30
+ ## Definitions, acronyms, and abbreviations
31
+ {{
32
+ skip_meta: true
33
+ }}
21
34
 
22
35
  CLI
23
36
 
@@ -39,80 +52,59 @@ OS
39
52
 
40
53
  : Operations System
41
54
 
42
- [//]: # (to use the extension `--from markdown+definition_lists`)
43
-
44
- ## 1.4 References
55
+ ## References
56
+ {{
57
+ skip_meta: true
58
+ }}
45
59
 
46
60
  1. [Markdown Guide](https://www.markdownguide.org/)
47
- 2. [Pandoc Users Guide](https://pandoc.org/MANUAL.html)
48
- 3. [Git Documentation](https://git-scm.com/doc)
61
+ 2. [Pandoc User's Guide](https://pandoc.org/MANUAL.html)
62
+ 3. [Git User's Manual](https://git-scm.com/docs/user-manual.html)
49
63
 
50
- ## 1.5 Overview
64
+ ## Overview
65
+ {{
66
+ skip_meta: true
67
+ }}
51
68
 
52
69
  The remaining sections of this document provide user requirements and functional requirements of the system.
53
70
 
54
- The next chapter [2 User stories](#us) introduces the system from User Stories' point of view and establishes the context for the functional requirements. The chapter is organized by user roles.
71
+ The next chapter [[us]] introduces the system from User Stories' point of view and establishes the context for the functional requirements. The chapter is organized by user roles.
55
72
 
56
- The following chapter [3 Functional requirements](#fr) describes detailed requirements for functions and user interfaces that are based on user stories from the previous chapter. The chapter is structured around system components and is written primarily for developers and quality assurance specialists.
73
+ The following chapter [[fr]] describes detailed requirements for functions and user interfaces that are based on user stories from the previous chapter. The chapter is structured around system components and is written primarily for developers and quality assurance specialists.
57
74
 
58
- # 2 User stories
75
+ # User stories
76
+ {{
77
+ skip_meta: true
78
+ }}
59
79
 
60
80
  ## Reader
61
81
 
62
- Attribute | Value
63
- --------- | -----
64
- id | us.reader
65
-
66
82
  A requirements reader uses requirements in his day to day work as an input for other project activities or participates in the requirements review process.
67
83
 
68
- ### Chose a presentation format
69
-
70
- Attribute | Value
71
- --------- | -----
72
- id | us.reader.01
84
+ ### Presentation format
73
85
 
74
86
  As a reader, I want to get requirements in a particular document format (PDF, Html, MS Word, OpenDocument, etc.), so that I can use my usual tools to work with the document.
75
87
 
76
88
  ## Writer
77
89
 
78
- Attribute | Value
79
- --------- | -----
80
- id | us.writer
81
-
82
90
  A requirements writer / author / developer / analyst
83
91
 
84
92
  ### README, HOW-TO
85
93
 
86
- Attribute | Value
87
- --------- | -----
88
- id | us.writer.01
89
-
90
94
  As a requirements analyst who visits the project promo page, I want to get some introduction to the project and its features, so that I understand how close it meets my needs.
91
95
 
92
96
  {{@@skip it just requires that the project should have README.md}}
93
97
 
94
98
  ### Write in plain text files
95
99
 
96
- Attribute | Value
97
- --------- | -----
98
- id | us.writer.02
99
-
100
100
  As a requirements writer, I want to develop and store requirements in plain text, so that my readers and I would not need to install any specialized software to work with requirements.
101
101
 
102
102
  ### Using of lightweight markup language
103
103
 
104
- Attribute | Value
105
- --------- | -----
106
- id | us.writer.03
107
-
108
104
  As a requirements writer, when I work on the requirements text, I want to use a lightweight markup language (LML), so that it still plain text and, at the same time, I have basic formatting capabilities of style and structure of a text, lists, and tables.
109
105
 
110
106
  ### Set of separate files
111
107
 
112
- Attribute | Value
113
- --------- | -----
114
- id | us.writer.04
115
-
116
108
  As a requirements writer, when I develop requirements, I want to structure the entire set of requirements as a set of separate files and folders, so that I have a high degree of agility but some drawbacks also ...
117
109
 
118
110
  * I can write different complex topics in different files and folders;
@@ -122,42 +114,24 @@ As a requirements writer, when I develop requirements, I want to structure the e
122
114
 
123
115
  ### Requirements subordination and order
124
116
 
125
- Attribute | Value
126
- --------- | -----
127
- id | us.writer.05
128
-
129
117
  As a drawback for the previous story when I have requirements in separated files, I need an ability to specify requirements subordination and output order through separated files, so that I can combine all requirements into the consistent repository.
130
118
 
131
119
  ### Supporting Metadata
132
120
 
133
- Attribute | Value
134
- --------- | -----
135
- id | us.writer.06
136
-
137
121
  As a requirements writer, when I develop requirements, I want to mark requirements text by some metadata (source, author, dependencies, etc.), so that I can use the metadata for tagging, searching, selection, referring, etc.
138
122
 
139
123
  ### Supporting Links
140
124
 
141
- Attribute | Value
142
- --------- | -----
143
- id | us.writer.07
144
-
145
125
  As a requirements writer, when I develop requirements, I want to link those with each other through simple references, so that I refer from one requirement to others.
146
126
 
147
127
  ### Requirements templates
148
128
 
149
- Attribute | Value
150
- --------- | -----
151
- id | us.writer.08
152
-
153
129
  As a requirements writer, when I develop requirements, I want to create and use requirements templates, so that I simplify my work, improve productivity and provide basic writing style.
154
130
 
155
131
  ### Checking repository
156
-
157
- Attribute | Value
158
- --------- | -----
159
- id | us.writer.09
160
- topic | true
132
+ {{
133
+ topic: true
134
+ }}
161
135
 
162
136
  As a requirements writer, I want to check requirements repository for different possible errors, so that I fix the errors and have consistent repository.
163
137
 
@@ -170,128 +144,71 @@ Manual files writing and writing in separate files especially can cause the foll
170
144
 
171
145
  ### Querying requirements
172
146
 
173
- Attribute | Value
174
- --------- | -----
175
- id | us.writer.10
176
-
177
147
  As a requirements writer, at any time, I want to query requirements (based on its attributes such "id", "title", "body", and metadata), so that I can have different subsets of requirements based on my needs.
178
148
 
179
149
  ### Combining into documents
180
150
 
181
- Attribute | Value
182
- --------- | -----
183
- id | us.writer.11
184
-
185
151
  As a requirements writer, at any time, I want to combine requirements to a single consistent requirements specification, so that I can have requirements draft and releases.
186
152
 
187
153
  ### Providing unique identifiers
188
154
 
189
- Attribute | Value
190
- --------- | -----
191
- id | us.writer.12
192
-
193
155
  As a requirements writer, I want to have automatically created unique identifiers for the requirements where it omitted, so that I will always have unique identifiers for all requirements.
194
156
 
195
157
  ### Document templates
196
158
 
197
- Attribute | Value
198
- --------- | -----
199
- id | us.writer.13
200
-
201
159
  As a requirement writer, I want the system support ability to chose different templates for documents, so that I can have templates for different purposes (drafts and releases) and even software products (GitHub Markdown, Gitlab Markdown, Pandoc Markdown to convert to docx, odt, or pdf.)
202
160
 
203
161
  ### Create own document template
204
162
 
205
- Attribute | Value
206
- --------- | -----
207
- id | us.writer.14
208
-
209
163
  As a requirements writer, I want to have ability to create my own templates or modify existing templates, so than I can do template tuning for my needs.
210
164
 
211
165
  ### Script automation
212
166
 
213
- Attribute | Value
214
- --------- | -----
215
- id | us.writer.15
216
-
217
167
  As a requirements analyst, I want have ability to automate my working tasks related to requirements, so that I can write scripts related to publishing, reviewing or deriving other artifacts based on the requirements (backlog, estimation sheet, traceability matrix, etc.).
218
168
 
219
- # 3 Functional requirements
169
+ # Functional requirements
170
+ {{
171
+ skip_meta: true
172
+ }}
220
173
 
221
174
  ## Components
222
175
 
223
- Attribute | Value
224
- --------- | -----
225
- id | cmp
226
-
227
176
  The system shall provide the following components:
228
177
 
229
178
  {{@@list}}
230
179
 
231
180
  ### Node
232
181
 
233
- Attribute | Value
234
- --------- | -----
235
- id | cmp.node
236
-
237
182
  The system shall provide the `Node` component that represents one single node of a document. The component shall provide the following function:
238
183
 
239
184
  {{@@list}}
240
185
 
241
186
  #### Read node from markup text
242
187
 
243
- Attribute | Value
244
- --------- | -----
245
- id | cmp.node.read
246
-
247
- The system shall provide the ability to read node from lightweight markup language (markdown) to [Node entity](#ent-node).
188
+ The system shall provide the ability to read node from lightweight markup language (markdown) to [[ent.node]].
248
189
 
249
190
  #### Write node to markup text
250
191
 
251
- Attribute | Value
252
- --------- | -----
253
- id | cmp.node.write
254
-
255
- The system shall provide the ability to write node from [Node entity](#ent-node) to lightweight markup language (markdown).
192
+ The system shall provide the ability to write node from [[ent.node]] to lightweight markup language (markdown).
256
193
 
257
194
  ### Repository
258
195
 
259
- Attribute | Value
260
- --------- | -----
261
- id | cmp.repo
262
-
263
196
  #### Read repository
264
197
 
265
- Attribute | Value
266
- --------- | -----
267
- id | cmp.repo.read
268
-
269
- The system shall provide the function to read repository from separate files and folders and combine it to [Node entity](#ent-node) under root document node.
198
+ The system shall provide the function to read repository from separate files and folders and combine it to [[ent.node]] under root document node.
270
199
 
271
200
  #### Query repository
272
201
 
273
- Attribute | Value
274
- --------- | -----
275
- id | cmp.repo.query
276
-
277
202
  The system shall provide the function to query repository by providing a query string
278
203
 
279
204
  ### Templates manager
280
205
 
281
- Attribute | Value
282
- --------- | -----
283
- id | cmp.tt
284
-
285
206
  The system shall provide `Template manager` component. The component shall provide the following functions:
286
207
 
287
208
  {{@@list}}
288
209
 
289
210
  #### Find template
290
211
 
291
- Attribute | Value
292
- --------- | -----
293
- id | cmp.tt.find
294
-
295
212
  The system shall provide function `find` for templates
296
213
 
297
214
  __Input__
@@ -302,30 +219,22 @@ id | String | Yes | Template identifier
302
219
 
303
220
  __Output__
304
221
 
305
- Template body (see [Template entity](#ent-tt)) by provided template `id` parameter.
222
+ Template body (see [[ent.tt]]) by provided template `id` parameter.
306
223
 
307
224
  ### Writer
308
225
 
309
- Attribute | Value
310
- --------- | -----
311
- id | cmp.writer
312
-
313
226
  The system shall provide the `Writer component`. The component shall provide functions of writing requirements repository to markup text.
314
227
 
315
228
  #### Write function
316
229
 
317
- Attribute | Value
318
- --------- | -----
319
- id | cmp.writer.write
320
-
321
230
  The `Writer` component shall provide the function `write`.
322
231
 
323
232
  __Input__
324
233
 
325
234
  Parameter | Type | Required | Description
326
235
  --------- | ---- | -------- | -----------
327
- node | Node | Yes | see [Node entity](#ent-node)
328
- template | Template | Yes | se [Template entity](#ent-tt)
236
+ node | Node | Yes | see [[ent.node]]
237
+ template | Template | Yes | se [[ent.tt]]
329
238
 
330
239
  __Output__
331
240
 
@@ -333,16 +242,8 @@ Text presentation of `node` parameter according to `template` parameter
333
242
 
334
243
  ## Entities
335
244
 
336
- Attribute | Value
337
- --------- | -----
338
- id | ent
339
-
340
245
  ### Node entity
341
246
 
342
- Attribute | Value
343
- --------- | -----
344
- id | ent.node
345
-
346
247
  The system shall provide `Node` entity that provide the following attributes:
347
248
 
348
249
  Attribute | Type | Required | Default | Description
@@ -355,10 +256,6 @@ items | Array<Node> | Yes | [] | Array of child nodes
355
256
 
356
257
  #### System node options
357
258
 
358
- Attribute | Value
359
- --------- | -----
360
- id | ent.node.01
361
-
362
259
  The system through node metadata shall provide the following system options:
363
260
 
364
261
  Option | Example | Description
@@ -369,10 +266,6 @@ order_index | order_index: .1 .2 | force the system to use specified order for c
369
266
 
370
267
  ### Template entity
371
268
 
372
- Attribute | Value
373
- --------- | -----
374
- id | ent.tt
375
-
376
269
  The system shall provide `Template` entity that provide the following attributes:
377
270
 
378
271
  Attribute | Type | Required | Default | Description
@@ -382,16 +275,8 @@ body | String | Yes | "" | Template body
382
275
 
383
276
  ## User Interface
384
277
 
385
- Attribute | Value
386
- --------- | -----
387
- id | ui
388
-
389
278
  ### CLI
390
279
 
391
- Attribute | Value
392
- --------- | -----
393
- id | cli
394
-
395
280
  The following requirements assumed that all CLI commands have to be called in a directory that contains a certain clerq project.
396
281
 
397
282
  The system shall provide the following CLI commands:
@@ -400,10 +285,6 @@ The system shall provide the following CLI commands:
400
285
 
401
286
  #### Project settings
402
287
 
403
- Attribute | Value
404
- --------- | -----
405
- id | cli.opt
406
-
407
288
  The system shall provide settings file for clerq project. It should be placed under root clerq project directory and called `clerq.yml`.
408
289
 
409
290
  Clerq project setting file shall provide the following options:
@@ -415,87 +296,47 @@ Clerq project setting file shall provide the following options:
415
296
 
416
297
  #### Getting version
417
298
 
418
- Attribute | Value
419
- --------- | -----
420
- id | cli.ver
421
-
422
299
  The system shall provide command `clerq --version`. When the user requests the command the system shall print its version.
423
300
 
424
301
  #### Help
425
302
 
426
- Attribute | Value
427
- --------- | -----
428
- id | cli.hlp
429
-
430
303
  The system shall provide command `clerq help`. When the user requests the command, the system shall print the list of all clerq CLI commands with a short description of each command.
431
304
 
432
305
  ##### Input parameters
433
306
 
434
- Attribute | Value
435
- --------- | -----
436
- id | cli.hlp.par
437
-
438
307
  The command shall provide the following input parameters:
439
308
 
440
309
  * `COMMAND`, string, optional, represent name for the command.
441
310
 
442
- #####
443
-
444
- Attribute | Value
445
- --------- | -----
446
- id | cli.hlp.01
311
+ ##### .01
447
312
 
448
313
  When the `COMMAND` parameter is provided, the system shall print the detailed description of the command with all supported parameters and options.
449
314
 
450
315
  #### Creating new project
451
316
 
452
- Attribute | Value
453
- --------- | -----
454
- id | cli.new
455
-
456
317
  The system shall provide command `clerq new`. When the user requests the command the system shall create a new clerq project according to input parameters.
457
318
 
458
319
  {{@@skip TODO what is the project?}}
459
320
 
460
321
  ##### Input parameters
461
322
 
462
- Attribute | Value
463
- --------- | -----
464
- id | cli.new.par
465
-
466
323
  The command shall provide the following input parameters:
467
324
 
468
325
  * `PROJECT`, string, required, represent the name of the new project.
469
326
 
470
- #####
471
-
472
- Attribute | Value
473
- --------- | -----
474
- id | cli.new.01
327
+ ##### .01
475
328
 
476
329
  When parameter `PROJECT` not provided, the system shall stop the command execution and print the error message `Parameter "PROJECT" required!`.
477
330
 
478
- #####
479
-
480
- Attribute | Value
481
- --------- | -----
482
- id | cli.new.02
331
+ ##### .02
483
332
 
484
333
  When parameter `PROJECT` provided and a directory called according to the parameter value exists, the system shall stop the command execution and print the error message `Directory "PROJECT" exists!`.
485
334
 
486
335
  #### Checking project
487
336
 
488
- Attribute | Value
489
- --------- | -----
490
- id | cli.chk
491
-
492
337
  The system shall provide command `clerq check`. When the user requests the command the system shall check the clerq repository for errors.
493
338
 
494
- #####
495
-
496
- Attribute | Value
497
- --------- | -----
498
- id | cli.chk.01
339
+ ##### .01
499
340
 
500
341
  When any errors have found during checking, the system shall print the errors grouped by error type. The following errors type shall be checked:
501
342
 
@@ -504,76 +345,45 @@ When any errors have found during checking, the system shall print the errors gr
504
345
  * Unknown/Wrong links;
505
346
  * Wrong order_index attribute.
506
347
 
507
- #####
508
-
509
- Attribute | Value
510
- --------- | -----
511
- id | cli.chk.02
348
+ ##### .02
512
349
 
513
350
  When errors have not found, the system shall print the message `No errors found. Everything is fine.`
514
351
 
515
352
  #### Building project
516
353
 
517
- Attribute | Value
518
- --------- | -----
519
- id | cli.bld
520
-
521
354
  The system shall provide command `clerq build`. When the user requests the command the system shall combine all requirements in the project repository and build the output document according to input parameters.
522
355
 
523
356
  ##### Input parameters
524
357
 
525
- Attribute | Value
526
- --------- | -----
527
- id | cli.bld.par
528
-
529
358
  The command shall provide the following input parameters:
530
359
 
531
360
  * `-o/--output`, string, optional, represent name for the output document;
532
361
  * `-t/--template TEMPLATE`, string, optional, represent a template for building the document;
533
362
  * `-q/--query QUERY`, string, optional, represent query string for requirements.
534
363
 
535
- #####
536
-
537
- Attribute | Value
538
- --------- | -----
539
- id | cli.bld.01
364
+ ##### .01
540
365
 
541
366
  When `-o/--output` parameter is not provided, the system shall use the default file name from settings of the project.
542
367
 
543
- #####
544
-
545
- Attribute | Value
546
- --------- | -----
547
- id | cli.bld.02
368
+ ##### .02
548
369
 
549
370
  When `-o/--output` parameter is provided, the system shall save the generated document under the provided name.
550
371
 
551
- #####
552
-
553
- Attribute | Value
554
- --------- | -----
555
- id | cli.bld.03
372
+ ##### .03
556
373
 
557
374
  When `-t/--template` parameter is not provided, the system shall use the default template from settings of the project.
558
375
 
559
- #####
560
-
561
- Attribute | Value
562
- --------- | -----
563
- id | cli.bld.04
376
+ ##### .04
564
377
 
565
378
  When `-t/--template` parameter is provided, the system shall check that the provided template exists and use it for document generation.
566
379
 
567
- #####
568
-
569
- Attribute | Value
570
- --------- | -----
571
- id | cli.bld.05
380
+ ##### .05
572
381
 
573
382
  When `-q/--query` parameter is provided, the system shall check if the provided query is correct query string and select requirements for building the document according to the query.
574
383
 
575
384
  # Appendix
385
+ {{
386
+ skip_meta: true
387
+ }}
576
388
 
577
389
  ![Clerq in Atom](assets/promo_light.png)
578
-
579
-