Almirah 0.2.4 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/bin/almirah +4 -4
  3. data/lib/almirah/doc_fabric.rb +65 -65
  4. data/lib/almirah/doc_items/blockquote.rb +21 -21
  5. data/lib/almirah/doc_items/code_block.rb +26 -26
  6. data/lib/almirah/doc_items/controlled_paragraph.rb +112 -112
  7. data/lib/almirah/doc_items/controlled_table.rb +224 -224
  8. data/lib/almirah/doc_items/controlled_table_row.rb +22 -22
  9. data/lib/almirah/doc_items/doc_footer.rb +16 -16
  10. data/lib/almirah/doc_items/doc_item.rb +22 -20
  11. data/lib/almirah/doc_items/frontmatter.rb +9 -0
  12. data/lib/almirah/doc_items/heading.rb +93 -93
  13. data/lib/almirah/doc_items/image.rb +27 -27
  14. data/lib/almirah/doc_items/markdown_list.rb +156 -158
  15. data/lib/almirah/doc_items/markdown_table.rb +61 -63
  16. data/lib/almirah/doc_items/paragraph.rb +25 -27
  17. data/lib/almirah/doc_items/text_line.rb +296 -296
  18. data/lib/almirah/doc_items/todo_block.rb +21 -21
  19. data/lib/almirah/doc_parser.rb +378 -330
  20. data/lib/almirah/doc_types/base_document.rb +64 -70
  21. data/lib/almirah/doc_types/coverage.rb +95 -81
  22. data/lib/almirah/doc_types/index.rb +173 -169
  23. data/lib/almirah/doc_types/persistent_document.rb +17 -20
  24. data/lib/almirah/doc_types/protocol.rb +24 -24
  25. data/lib/almirah/doc_types/specification.rb +67 -67
  26. data/lib/almirah/doc_types/traceability.rb +142 -142
  27. data/lib/almirah/dom/doc_section.rb +25 -25
  28. data/lib/almirah/dom/document.rb +78 -72
  29. data/lib/almirah/navigation_pane.rb +16 -16
  30. data/lib/almirah/project.rb +287 -306
  31. data/lib/almirah/project_configuration.rb +41 -41
  32. data/lib/almirah/project_template.rb +298 -0
  33. data/lib/almirah/project_utility.rb +52 -0
  34. data/lib/almirah/search/specifications_db.rb +79 -83
  35. data/lib/almirah/templates/css/main.css +300 -300
  36. data/lib/almirah/templates/css/search.css +40 -40
  37. data/lib/almirah/templates/page.html +42 -42
  38. data/lib/almirah/templates/scripts/main.js +111 -111
  39. data/lib/almirah/templates/scripts/orama_search.js +138 -138
  40. data/lib/almirah.rb +93 -49
  41. metadata +28 -5
data/lib/almirah.rb CHANGED
@@ -1,49 +1,93 @@
1
- require "thor"
2
- require_relative "almirah/project"
3
- require_relative "almirah/project_configuration"
4
-
5
- class CLI < Thor
6
- option :results
7
- desc "please <project_folder>", "say <project_folder>"
8
- def please(project_folder)
9
- a = Almirah.new project_folder
10
- if options[:results]
11
- a.results( options[:results] )
12
- else
13
- a.default()
14
- end
15
- end
16
-
17
- desc "transform <project_folder>", "say <project_folder>"
18
- def transform(project_folder)
19
- a = Almirah.new project_folder
20
- a.transform "docx"
21
- end
22
- end
23
-
24
- class Almirah
25
-
26
- attr_accessor :project
27
-
28
- def initialize(project_folder)
29
- config = ProjectConfiguration.new project_folder
30
- @project = Project.new config
31
- end
32
-
33
- def getGemRoot()
34
- File.expand_path './..', File.dirname(__FILE__)
35
- end
36
-
37
- def results( test_run )
38
- @project.specifications_and_results test_run
39
- end
40
-
41
- def transform( file_extension )
42
- @project.transform file_extension
43
- end
44
-
45
- def default()
46
- @project.specifications_and_protocols
47
- end
48
-
49
- end
1
+ require 'thor'
2
+ require_relative 'almirah/project'
3
+ require_relative 'almirah/project_configuration'
4
+ require_relative 'almirah/project_template'
5
+ require_relative 'almirah/project_utility'
6
+
7
+ class CLI < Thor
8
+ option :run
9
+ desc 'please <project_folder>', 'Processes the folder'
10
+ long_desc <<-LONGDESC
11
+ Creates HTML representation of markdown files stored in <project_folder>
12
+
13
+ Use --run option to specify exact test run ID for processing if required.
14
+
15
+ For example: almirah please my_project --run 003
16
+
17
+ LONGDESC
18
+ def please(project_folder)
19
+ a = Almirah.new project_folder
20
+ if options[:run]
21
+ a.run(options[:run])
22
+ else
23
+ a.default
24
+ end
25
+ end
26
+
27
+ desc 'Creates project from template', ''
28
+ long_desc <<-LONGDESC
29
+ Creates default project structure in the <project_name> folder
30
+ LONGDESC
31
+ def create(project_name)
32
+ Almirah.create_new_project_structure project_name
33
+ end
34
+
35
+ option :run
36
+ desc 'combine <project_folder>', 'Combines all the test protocols'
37
+ long_desc <<-LONGDESC
38
+ Combines all the test protocols from the <project_folder>/tests/protocols folder
39
+
40
+ Use --run option to specify exact test run ID from <project_folder>/tests/runs folder.
41
+
42
+ For example: almirah combine my_project --run 003
43
+
44
+ Result is stored as <project_folder>/build/combined.md
45
+ LONGDESC
46
+ def combine(project_folder)
47
+ Almirah.create_project_utility project_folder
48
+ if options[:run]
49
+ Almirah.combine_run(options[:run])
50
+ else
51
+ Almirah.combine_protocols
52
+ end
53
+ end
54
+ end
55
+
56
+ class Almirah
57
+ attr_accessor :project
58
+ attr_accessor :project_utility
59
+
60
+ def initialize(project_folder)
61
+ config = ProjectConfiguration.new project_folder
62
+ @project = Project.new config
63
+ end
64
+
65
+ def getGemRoot
66
+ File.expand_path './..', File.dirname(__FILE__)
67
+ end
68
+
69
+ def run(test_run)
70
+ @project.specifications_and_results test_run
71
+ end
72
+
73
+ def self.create_new_project_structure(project_name)
74
+ ProjectTemplate.new project_name
75
+ end
76
+
77
+ def self.create_project_utility(project_folder)
78
+ config = ProjectConfiguration.new project_folder
79
+ @project_utility = ProjectUtility.new config
80
+ end
81
+
82
+ def self.combine_protocols
83
+ @project_utility.combine_protocols
84
+ end
85
+
86
+ def self.combine_run(test_run)
87
+ @project_utility.combine_run test_run
88
+ end
89
+
90
+ def default
91
+ @project.specifications_and_protocols
92
+ end
93
+ end
metadata CHANGED
@@ -1,15 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Almirah
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oleksandr Ivanov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-29 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2024-08-17 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: thor
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 1.3.1
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '1.3'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 1.3.1
13
33
  description: The software part of the Almirah framework
14
34
  email: oleksandr.ivanov.development@gmail.com
15
35
  executables:
@@ -27,6 +47,7 @@ files:
27
47
  - lib/almirah/doc_items/controlled_table_row.rb
28
48
  - lib/almirah/doc_items/doc_footer.rb
29
49
  - lib/almirah/doc_items/doc_item.rb
50
+ - lib/almirah/doc_items/frontmatter.rb
30
51
  - lib/almirah/doc_items/heading.rb
31
52
  - lib/almirah/doc_items/image.rb
32
53
  - lib/almirah/doc_items/markdown_list.rb
@@ -47,6 +68,8 @@ files:
47
68
  - lib/almirah/navigation_pane.rb
48
69
  - lib/almirah/project.rb
49
70
  - lib/almirah/project_configuration.rb
71
+ - lib/almirah/project_template.rb
72
+ - lib/almirah/project_utility.rb
50
73
  - lib/almirah/search/specifications_db.rb
51
74
  - lib/almirah/templates/css/main.css
52
75
  - lib/almirah/templates/css/search.css
@@ -65,14 +88,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
65
88
  requirements:
66
89
  - - ">="
67
90
  - !ruby/object:Gem::Version
68
- version: '0'
91
+ version: '3.0'
69
92
  required_rubygems_version: !ruby/object:Gem::Requirement
70
93
  requirements:
71
94
  - - ">="
72
95
  - !ruby/object:Gem::Version
73
96
  version: '0'
74
97
  requirements: []
75
- rubygems_version: 3.5.9
98
+ rubygems_version: 3.5.17
76
99
  signing_key:
77
100
  specification_version: 4
78
101
  summary: Almirah