indoctrinatr-tools 0.16.0 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +9 -39
  3. data/.rubocop.yml +2 -3
  4. data/.ruby-version +1 -0
  5. data/CHANGELOG.md +9 -1
  6. data/LICENSE +1 -1
  7. data/README.md +5 -6
  8. data/Rakefile +5 -20
  9. data/cucumber.yml +1 -1
  10. data/exe/indoctrinatr +4 -0
  11. data/indoctrinatr-tools.gemspec +24 -24
  12. data/lib/indoctrinatr/templates/documentation/indoctrinatr-technical-documentation-content.tex.erb +4 -4
  13. data/lib/indoctrinatr/templates/documentation/indoctrinatr-technical-documentation.sty +0 -15
  14. data/lib/indoctrinatr/tools/command_autocomplete_helpers.rb +9 -0
  15. data/lib/indoctrinatr/tools/commands/bash_completions.rb +21 -0
  16. data/lib/indoctrinatr/tools/commands/check.rb +26 -0
  17. data/lib/indoctrinatr/tools/commands/completion_commands.rb +25 -0
  18. data/lib/indoctrinatr/tools/commands/demo.rb +22 -0
  19. data/lib/indoctrinatr/tools/commands/doc.rb +28 -0
  20. data/lib/indoctrinatr/tools/commands/pack.rb +26 -0
  21. data/lib/indoctrinatr/tools/commands/parse.rb +26 -0
  22. data/lib/indoctrinatr/tools/commands/pdf.rb +39 -0
  23. data/lib/indoctrinatr/tools/commands/pdf_with_field_names.rb +28 -0
  24. data/lib/indoctrinatr/tools/commands/scaffold.rb +26 -0
  25. data/lib/indoctrinatr/tools/commands/version.rb +13 -0
  26. data/lib/indoctrinatr/tools/commands/workflow.rb +38 -0
  27. data/lib/indoctrinatr/tools/commands/zsh_completions.rb +25 -0
  28. data/lib/indoctrinatr/tools/commands.rb +21 -0
  29. data/lib/indoctrinatr/tools/configuration_extractor.rb +11 -13
  30. data/lib/indoctrinatr/tools/content_for_tex_files.rb +5 -3
  31. data/lib/indoctrinatr/tools/default_values.rb +1 -3
  32. data/lib/indoctrinatr/tools/field_name_values.rb +3 -5
  33. data/lib/indoctrinatr/tools/pdf_generator.rb +3 -3
  34. data/lib/{redcloth_latex_formatter_patch/patch.rb → indoctrinatr/tools/redcloth_formatters_latex_patch.rb} +14 -16
  35. data/lib/indoctrinatr/tools/template_documentation_content.rb +72 -23
  36. data/lib/indoctrinatr/tools/template_documentation_source_file.rb +9 -14
  37. data/lib/indoctrinatr/tools/transactions/template_pack_default_values_compiler.rb +67 -0
  38. data/lib/indoctrinatr/tools/transactions/template_pack_default_values_parser.rb +82 -0
  39. data/lib/indoctrinatr/tools/transactions/template_pack_demo.rb +104 -0
  40. data/lib/indoctrinatr/tools/transactions/template_pack_documentation.rb +223 -0
  41. data/lib/indoctrinatr/tools/transactions/template_pack_error_checker.rb +127 -0
  42. data/lib/indoctrinatr/tools/transactions/template_pack_fieldnames_creator.rb +97 -0
  43. data/lib/indoctrinatr/tools/transactions/template_pack_packer.rb +73 -0
  44. data/lib/indoctrinatr/tools/transactions/template_pack_scaffold.rb +73 -0
  45. data/lib/indoctrinatr/tools/version.rb +1 -1
  46. data/lib/indoctrinatr_tools.rb +12 -0
  47. metadata +90 -135
  48. checksums.yaml.gz.sig +0 -3
  49. data/.coveralls.yml +0 -1
  50. data/.travis.yml +0 -16
  51. data/bin/indoctrinatr +0 -182
  52. data/certs/dkd-reuschling.pem +0 -20
  53. data/features/autocompletion_support.feature +0 -9
  54. data/features/demo.feature +0 -17
  55. data/features/doc_keepauxfiles.feature +0 -13
  56. data/features/documentation.feature +0 -20
  57. data/features/fieldnames_pdf.feature +0 -9
  58. data/features/fieldnames_pdf_auxfiles.feature +0 -10
  59. data/features/pack.feature +0 -11
  60. data/features/parse.feature +0 -6
  61. data/features/pdf.feature +0 -15
  62. data/features/pdf_keepauxfiles.feature +0 -11
  63. data/features/pdf_with_timestamp.feature +0 -8
  64. data/features/scaffold.feature +0 -23
  65. data/features/step_definitions/common.rb +0 -3
  66. data/features/step_definitions/indoctrinatr_cli.rb +0 -11
  67. data/features/support/env.rb +0 -1
  68. data/features/version.feature +0 -5
  69. data/features/workflow.feature +0 -9
  70. data/lib/indoctrinatr/tools/directory_helpers.rb +0 -19
  71. data/lib/indoctrinatr/tools/template_pack_default_values_compiler.rb +0 -47
  72. data/lib/indoctrinatr/tools/template_pack_default_values_parser.rb +0 -55
  73. data/lib/indoctrinatr/tools/template_pack_demo.rb +0 -23
  74. data/lib/indoctrinatr/tools/template_pack_documentation.rb +0 -132
  75. data/lib/indoctrinatr/tools/template_pack_error_checker.rb +0 -108
  76. data/lib/indoctrinatr/tools/template_pack_fieldnames_creator.rb +0 -79
  77. data/lib/indoctrinatr/tools/template_pack_helpers.rb +0 -69
  78. data/lib/indoctrinatr/tools/template_pack_packer.rb +0 -49
  79. data/lib/indoctrinatr/tools/template_pack_scaffold.rb +0 -57
  80. data/lib/indoctrinatr/tools.rb +0 -9
  81. data/spec/fixtures/test/configuration.yaml +0 -26
  82. data/spec/fixtures/test/test.tex.erb +0 -15
  83. data/spec/indoctrinatr/templates/configuration_file_spec.rb +0 -9
  84. data/spec/indoctrinatr/templates/tex_file_spec.rb +0 -9
  85. data/spec/indoctrinatr/tools/textile_support_spec.rb +0 -18
  86. data/spec/indoctrinatr/tools/version_spec.rb +0 -8
  87. data/spec/redcloth_latex_formatter_patch/patch_spec.rb +0 -34
  88. data/spec/spec_helper.rb +0 -2
  89. data.tar.gz.sig +0 -3
  90. metadata.gz.sig +0 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6a20a3417d2320bbee925716116c0abe837b378e4de871a4e90784435be78a69
4
- data.tar.gz: 25119cb987c05ab753652ce16beca1a19e345bfa87fe6bfd957129bd8074ab1f
3
+ metadata.gz: 9ecf077d9fa4e157d3cab1a0a8cdbc0cfb0e78da076c3cc99248eb2d01223ac9
4
+ data.tar.gz: 24d93b0dccc5b43e4775870df136ee87d59b23f4f60de001d63f14b22ba41166
5
5
  SHA512:
6
- metadata.gz: fce3a5ed1d1ba3ddce352de0c068046867bf63b75e003e532c8c0f3b4ba2affaa1d1b6d1ef9a3115d522c37615f08f80d751d4e67c96f3639f7b82bc0631131b
7
- data.tar.gz: 4d126f8b3d4394b869a67bb76330dc16617980ccbd163cbe79e790eeace8b5c4412997b7d87c517894813fb8a8f3619be499bbe3bb2ca3195c50a998a0ae0fa6
6
+ metadata.gz: d64e22fed3f46f3a444177d5ca0391cc383222364b7d85a15de12566fd9e551b20d439393fefd1a1615fbb074acb0d5ee6e15a5a309ae485ee7b3c9ef5482b65
7
+ data.tar.gz: f5539d4547a696df5bd03becd16cf3f672ffd4b3746c69222018bb15705543f8d9f021a333bf8ec4be6a32936f22d2e717881174e87570db9d78fb8fe40c9ffc
data/.gitignore CHANGED
@@ -1,54 +1,24 @@
1
+ *.a
2
+ *.bundle
1
3
  *.gem
4
+ *.iml
5
+ *.o
2
6
  *.rbc
7
+ *.so
3
8
  .bundle
4
9
  .config
10
+ .idea
5
11
  .yardoc
6
- Gemfile.lock
7
- InstalledFiles
8
12
  _yardoc
9
13
  coverage
10
14
  doc/
15
+ Gemfile.lock
16
+ InstalledFiles
11
17
  lib/bundler/man
18
+ mkmf.log
12
19
  pkg
13
20
  rdoc
14
21
  spec/reports
15
22
  test/tmp
16
23
  test/version_tmp
17
24
  tmp
18
- *.bundle
19
- *.so
20
- *.o
21
- *.a
22
- mkmf.log
23
-
24
- # Created by https://www.gitignore.io
25
-
26
- ### Intellij ###
27
- # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm
28
-
29
- *.iml
30
-
31
- ## Directory-based project format:
32
- .idea/
33
- # if you remove the above rule, at least ignore the following:
34
-
35
- # User-specific stuff:
36
- # .idea/workspace.xml
37
- # .idea/tasks.xml
38
- # .idea/dictionaries
39
-
40
- # Sensitive or high-churn files:
41
- # .idea/dataSources.ids
42
- # .idea/dataSources.xml
43
- # .idea/sqlDataSources.xml
44
- # .idea/dynamic.xml
45
- # .idea/uiDesigner.xml
46
-
47
- # Gradle:
48
- # .idea/gradle.xml
49
- # .idea/libraries
50
-
51
- # Mongo Explorer plugin:
52
- # .idea/mongoSettings.xml
53
-
54
- # End gitignore.io generated block
data/.rubocop.yml CHANGED
@@ -3,7 +3,8 @@ require:
3
3
  - rubocop-rspec
4
4
 
5
5
  AllCops:
6
- TargetRubyVersion: 2.5
6
+ NewCops: enable
7
+ TargetRubyVersion: 3.1
7
8
  ExtraDetails: true
8
9
  DisplayStyleGuide: true
9
10
  DisplayCopNames: true
@@ -14,8 +15,6 @@ Style/FrozenStringLiteralComment:
14
15
  Enabled: false
15
16
  Layout/LineLength:
16
17
  Max: 240
17
- Style/MethodDefParentheses:
18
- EnforcedStyle: require_no_parentheses
19
18
  Style/Documentation:
20
19
  Enabled: false
21
20
  Metrics/MethodLength:
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.1
data/CHANGELOG.md CHANGED
@@ -1,6 +1,14 @@
1
1
  # indoctrinatr-tools
2
2
 
3
- ## v0.15.0 (2020-02-14)
3
+ ## v0.17.0 (2022-12-01)
4
+
5
+ ### changes
6
+
7
+ * migrate to `dry-cli` and `dry-transaction`
8
+ * move to Ruby `~> 3.0` versions (3.0, 3.1)
9
+ * drop support for Ruby 2.x versions
10
+
11
+ ## v0.16.0 (2020-02-14)
4
12
 
5
13
  ### changes
6
14
 
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2014-2020 Indoctrinatr Development Team, dkd Internet Service GmbH, Frankfurt am Main
3
+ Copyright (c) 2014-2022 Indoctrinatr Development Team, dkd Internet Service GmbH, Frankfurt am Main
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -6,12 +6,12 @@
6
6
 
7
7
  ## Installation
8
8
 
9
- [![Gem Version](https://badge.fury.io/rb/indoctrinatr-tools.svg)](http://badge.fury.io/rb/indoctrinatr-tools) [![Coverage Status](https://coveralls.io/repos/dkd/indoctrinatr-tools/badge.svg?branch=development&service=github)](https://coveralls.io/github/dkd/indoctrinatr-tools?branch=development) master [![Travis CI Status: master](https://travis-ci.org/dkd/indoctrinatr-tools.svg?branch=master)](https://travis-ci.org/dkd/indoctrinatr-tools) development [![Travis CI Status: development](https://travis-ci.org/dkd/indoctrinatr-tools.svg?branch=development)](https://travis-ci.org/dkd/indoctrinatr-tools)
9
+ [![Gem Version](https://badge.fury.io/rb/indoctrinatr-tools.svg)](http://badge.fury.io/rb/indoctrinatr-tools)
10
10
 
11
11
 
12
12
  1. Install XeTeX:
13
13
 
14
- Mac OS X: [MacTeX](https://tug.org/mactex/)
14
+ Mac OS X: [MacTeX](https://tug.org/mactex/) (e.g. `brew install mactex`)
15
15
 
16
16
  Debian/Ubuntu:
17
17
 
@@ -30,7 +30,7 @@
30
30
 
31
31
  * `latexmk`
32
32
  * for the template documentation
33
- * Tested against TeX Live 2014
33
+ * Tested against TeX Live 2022
34
34
  * `dirtree`
35
35
  * `datetime2`
36
36
 
@@ -49,8 +49,6 @@ Command | Description
49
49
  `indoctrinatr pack project_name` | Creates a Template Pack from a given project folder
50
50
  `indoctrinatr demo` | Creates, parses, and compiles a demo project
51
51
  `indoctrinatr workflow` | Displays a suggested workflow
52
- `indoctrinatr bashcompletion` | Displays instructions for bash completion
53
- `indoctrinatr zshcompletion` | Displays instructions for zsh completion
54
52
 
55
53
  The commands `pdf`, `pdf_with_field_names` and `doc` have a `keep-aux-files` option. This is helpful if you run in into LaTeX errors, want to inspect the .log file and run LaTeX for yourself again.
56
54
 
@@ -69,7 +67,7 @@ What you think of Indoctrinatr and Indoctrinatr Tools? Drop us a line (<opensour
69
67
  We are also looking forward to your [GitHub Pull Requests](https://help.github.com/articles/using-pull-requests/).
70
68
 
71
69
  Manual testing: After cloning the repo, run `bundle exec bin/indoctrinatr` inside the directory for testing your own development changes.
72
- Automatic testing: run `rake test_with_coveralls`
70
+ Automatic testing: run `rspec`
73
71
 
74
72
  ## License
75
73
 
@@ -80,5 +78,6 @@ Indoctrinatr and Indoctrinatr Tools are licensed under the terms and conditions
80
78
  [![dkd](assets/images/dkd_logo.png)](https://dkd.de/)
81
79
 
82
80
  * Luka Lüdicke (development)
81
+ * Eike Henrich (development)
83
82
  * Nicolai Reuschling (development)
84
83
  * Søren Schaffstein (idea, product management)
data/Rakefile CHANGED
@@ -7,26 +7,11 @@ require 'rspec/core/rake_task'
7
7
  RSpec::Core::RakeTask.new('spec')
8
8
  task default: :spec
9
9
 
10
- require 'cucumber'
11
- require 'cucumber/rake/task'
12
- Cucumber::Rake::Task.new(:features) do |t|
13
- t.cucumber_opts = 'features --format pretty'
14
- end
15
-
16
- require 'coveralls/rake/task'
17
- Coveralls::RakeTask.new
18
- task test_with_coveralls: [:rubocop, :spec, :features, 'coveralls:push']
19
-
20
- desc 'Start up IRB session with Indoctrinatr Tools loaded'
21
- task :console do
22
- exec 'irb -r indoctrinatr/tools -I ./lib'
23
- end
24
-
25
10
  desc 'Run demo'
26
11
  task :demo do
27
- puts `bin/indoctrinatr new demo`
28
- puts `bin/indoctrinatr parse demo`
29
- puts `bin/indoctrinatr pdf demo`
30
- puts `bin/indoctrinatr doc demo`
31
- puts `bin/indoctrinatr pack demo`
12
+ puts `exe/indoctrinatr new demo`
13
+ puts `exe/indoctrinatr parse demo`
14
+ puts `exe/indoctrinatr pdf demo`
15
+ puts `exe/indoctrinatr doc demo`
16
+ puts `exe/indoctrinatr pack demo`
32
17
  end
data/cucumber.yml CHANGED
@@ -1 +1 @@
1
- default: --format=progress
1
+ default: --format=progress --publish-quiet
data/exe/indoctrinatr ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require 'bundler/setup'
3
+
4
+ require_relative '../lib/indoctrinatr_tools'
@@ -5,39 +5,39 @@ require 'indoctrinatr/tools/version'
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'indoctrinatr-tools'
7
7
  spec.version = Indoctrinatr::Tools::VERSION
8
- spec.authors = ['Nicolai Reuschling', 'Luka Lüdicke']
9
- spec.email = ['nicolai.reuschling@dkd.de', 'luka.luedicke@dkd.de']
8
+ spec.authors = ['Nicolai Reuschling', 'Eike Henrich']
9
+ spec.email = ['nicolai.reuschling@dkd.de', 'eike.henrich@dkd.de']
10
10
  spec.summary = 'indoctrinatr-tools provides a set of command line tools for Indoctrinatr (an Open Source Software project by dkd Internet Service GmbH, Frankfurt am Main, Germany).'
11
- # spec.description = %q{TODO: Write a longer description. Optional.}
12
- spec.homepage = ''
11
+ spec.homepage = 'https://github.com/dkd/indoctrinatr'
13
12
  spec.license = 'MIT'
14
13
 
15
- spec.required_ruby_version = '~> 2.5'
14
+ spec.required_ruby_version = '~> 3.1'
16
15
 
17
- spec.files = `git ls-files -z`.split("\x0")
18
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
16
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
17
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ end
19
+ spec.bindir = 'exe'
20
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
21
  spec.require_paths = ['lib']
21
22
 
22
- spec.add_development_dependency 'aruba', '~> 0.14'
23
- spec.add_development_dependency 'bundler', '~> 2.0'
24
- spec.add_development_dependency 'coveralls', '~> 0.8'
25
- spec.add_development_dependency 'cucumber', '~> 3.0'
26
- spec.add_development_dependency 'pry', '~> 0.11'
27
- spec.add_development_dependency 'rake', '~> 13.0'
28
- spec.add_development_dependency 'rspec', '~> 3.7'
29
- spec.add_development_dependency 'rubocop', '~> 0.79'
30
- spec.add_development_dependency 'rubocop-performance', '~> 1.3'
31
- spec.add_development_dependency 'rubocop-rspec', '~> 1.22'
23
+ spec.add_development_dependency 'aruba', '~> 2.1'
24
+ spec.add_development_dependency 'bundler', '~> 2.0'
25
+ spec.add_development_dependency 'cucumber', '~> 8.0'
26
+ spec.add_development_dependency 'rake', '~> 13.0'
27
+ spec.add_development_dependency 'rspec', '~> 3.10'
28
+ spec.add_development_dependency 'rubocop', '~> 1.0'
29
+ spec.add_development_dependency 'rubocop-performance', '~> 1.10'
30
+ spec.add_development_dependency 'rubocop-rspec', '~> 2.0'
31
+ spec.add_development_dependency 'simplecov', '~> 0.21'
32
32
 
33
- spec.add_dependency 'erubis', '~> 2.7'
34
- spec.add_dependency 'gli', '~> 2.16'
33
+ spec.add_dependency 'dry-cli', '~> 1.0'
34
+ spec.add_dependency 'dry-transaction', '~> 0.13'
35
+ spec.add_dependency 'erubis', '~> 2.7'
35
36
  spec.add_dependency 'RedCloth', '~> 4.3'
36
- spec.add_dependency 'rubyzip', '~> 2'
37
+ spec.add_dependency 'rubyzip', '~> 2'
37
38
  spec.add_dependency 'to_latex', '~> 0.5'
38
-
39
- spec.cert_chain = ['certs/dkd-reuschling.pem']
40
- spec.signing_key = File.expand_path('~/.ssh/gem-private_key.pem') if $PROGRAM_NAME.end_with?('gem')
39
+ spec.add_dependency 'zeitwerk', '~> 2.6'
41
40
 
42
41
  spec.requirements << 'LaTeX development enviroment'
42
+ spec.metadata['rubygems_mfa_required'] = 'true'
43
43
  end
@@ -25,10 +25,10 @@
25
25
  \begin{landscape}
26
26
  \chapter{Variables}
27
27
 
28
- \begin{longtabu}{ l l X l X }
29
- \tabletoprule
28
+ \begin{longtable}{ l l l l l }
29
+ % \tabletoprule
30
30
  \textbf{Variable} & \textbf{Presentation} & \textbf{Default Value} & \textbf{Required} & \textbf{Description} \\
31
- \tabletoprule
31
+ % \tabletoprule
32
32
  \endhead
33
33
  <% @attributes.each do |attribute| %>
34
34
  \texttt{<%= attribute['name'].to_latex -%>}
@@ -37,5 +37,5 @@
37
37
  & <%= 'true' if attribute['required'] == 'true' -%> <%# empty if false or not set. Wish by Søren for better readability-%>
38
38
  & <%= attribute['description'].to_latex if attribute['description'] -%>\\ <%# if condition to ignore errors on empty description field -%>
39
39
  <% end %>
40
- \end{longtabu}
40
+ \end{longtable}
41
41
  \end{landscape}
@@ -157,24 +157,9 @@
157
157
  \MakeOuterQuote{"}
158
158
 
159
159
 
160
- % package for better table creation
161
- \usepackage{tabu}
162
160
  % use "longtable" package to allow multi page tables
163
161
  \usepackage{longtable}
164
162
 
165
-
166
- % define horizontal lines for use in tables
167
- \newcommand{\tabletoprule}{\tabucline[1pt]{-}}
168
- \newcommand{\tablebottomrule}{\tabucline[1pt]{-}}
169
- \newcommand{\tablemiddlerule}{\tabucline[0.5pt]{-}}
170
- \newcommand{\tablesumrule}{\tabucline[0.5pt]{-}\tabucline[0.5pt]{-}}
171
-
172
- % increase spacing between table rows
173
- \tabulinesep=2mm
174
-
175
- % have alternating row colours in tables
176
- \rowcolors{1}{light-gray}{white}
177
-
178
163
  % allow row spanning in tables
179
164
  \usepackage{multirow}
180
165
 
@@ -0,0 +1,9 @@
1
+ module Indoctrinatr
2
+ module Tools
3
+ class CommandAutocompleteHelpers
4
+ def self.handle_autocomplete(path)
5
+ path.gsub(%r{(.*)(/$|\\$)}, '\1')
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,21 @@
1
+ module Indoctrinatr
2
+ module Tools
3
+ module Commands
4
+ class BashCompletions < Dry::CLI::Command
5
+ desc 'Print a guide how to add indoctrinatr-tools integration to .bashrc.'
6
+
7
+ def call(**)
8
+ puts <<~HEREDOC
9
+ Add this to your .bashrc (and open up a new shell):
10
+
11
+ complete -F get_indoctrinatr_targets indoctrinatr
12
+ function get_indoctrinatr_targets()
13
+ {
14
+ COMPREPLY=(`indoctrinatr completions`)
15
+ }
16
+ HEREDOC
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,26 @@
1
+ module Indoctrinatr
2
+ module Tools
3
+ module Commands
4
+ class Check < Dry::CLI::Command
5
+ desc 'Display the suggested workflow.'
6
+
7
+ argument :template_pack_name, desc: 'Name of template pack'
8
+
9
+ def call(template_pack_name:, **)
10
+ template_pack_name = CommandAutocompleteHelpers.handle_autocomplete(template_pack_name)
11
+
12
+ Indoctrinatr::Tools::Transactions::TemplatePackErrorChecker.new.call(template_pack_name) do |result|
13
+ result.success do |message|
14
+ puts message
15
+ end
16
+
17
+ result.failure do |message|
18
+ puts message
19
+ exit 1
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,25 @@
1
+ module Indoctrinatr
2
+ module Tools
3
+ module Commands
4
+ class CompletionCommands < Dry::CLI::Command
5
+ def call(**)
6
+ puts <<~HEREDOC
7
+ bashcompletion
8
+ check
9
+ completions
10
+ demo
11
+ doc
12
+ new
13
+ pack
14
+ parse
15
+ pdf
16
+ pdf_with_field_names
17
+ version
18
+ workflow
19
+ zshcompletion
20
+ HEREDOC
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,22 @@
1
+ module Indoctrinatr
2
+ module Tools
3
+ module Commands
4
+ class Demo < Dry::CLI::Command
5
+ desc 'Create, compile and pack a demo project.'
6
+
7
+ def call(**)
8
+ Indoctrinatr::Tools::Transactions::TemplatePackDemo.new.call('demo') do |result|
9
+ result.success do |message|
10
+ puts message
11
+ end
12
+
13
+ result.failure do |message|
14
+ puts message
15
+ exit 1
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,28 @@
1
+ module Indoctrinatr
2
+ module Tools
3
+ module Commands
4
+ class Doc < Dry::CLI::Command
5
+ desc 'Create a documentation from a given source folder.'
6
+
7
+ argument :template_pack_name, desc: 'Name of template pack'
8
+ option :keep_aux_files, type: :boolean, default: false, desc: 'The option to keep aux files'
9
+
10
+ def call(template_pack_name:, **options)
11
+ template_pack_name = CommandAutocompleteHelpers.handle_autocomplete(template_pack_name)
12
+ keep_aux_files = options.fetch(:keep_aux_files)
13
+
14
+ Indoctrinatr::Tools::Transactions::TemplatePackDocumentation.new.call(template_pack_name:, keep_aux_files:) do |result|
15
+ result.success do |message|
16
+ puts message
17
+ end
18
+
19
+ result.failure do |message|
20
+ puts message
21
+ exit 1
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,26 @@
1
+ module Indoctrinatr
2
+ module Tools
3
+ module Commands
4
+ class Pack < Dry::CLI::Command
5
+ desc 'Create a Template Pack from a given source folder.'
6
+
7
+ argument :template_pack_name, desc: 'Name of template pack'
8
+
9
+ def call(template_pack_name:, **)
10
+ template_pack_name = CommandAutocompleteHelpers.handle_autocomplete(template_pack_name)
11
+
12
+ Indoctrinatr::Tools::Transactions::TemplatePackPacker.new.call(template_pack_name) do |result|
13
+ result.success do |message|
14
+ puts message
15
+ end
16
+
17
+ result.failure do |message|
18
+ puts message
19
+ exit 1
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,26 @@
1
+ module Indoctrinatr
2
+ module Tools
3
+ module Commands
4
+ class Parse < Dry::CLI::Command
5
+ desc 'Parse XeTeX file with ERB and default values of Template Pack.'
6
+
7
+ argument :template_pack_name, desc: 'Name of template pack'
8
+
9
+ def call(template_pack_name:, **)
10
+ template_pack_name = CommandAutocompleteHelpers.handle_autocomplete(template_pack_name)
11
+
12
+ Indoctrinatr::Tools::Transactions::TemplatePackDefaultValuesParser.new.call(template_pack_name) do |result|
13
+ result.success do |message|
14
+ puts message
15
+ end
16
+
17
+ result.failure do |message|
18
+ puts message
19
+ exit 1
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,39 @@
1
+ module Indoctrinatr
2
+ module Tools
3
+ module Commands
4
+ class Pdf < Dry::CLI::Command
5
+ desc 'Compile PDF with default values.'
6
+
7
+ argument :template_pack_name, desc: 'Name of template pack'
8
+ option :keep_aux_files, type: :boolean, default: false, desc: 'The option to keep aux files'
9
+
10
+ def call(template_pack_name:, **options)
11
+ template_pack_name = CommandAutocompleteHelpers.handle_autocomplete(template_pack_name)
12
+ keep_aux_files = options.fetch(:keep_aux_files)
13
+
14
+ Indoctrinatr::Tools::Transactions::TemplatePackDefaultValuesParser.new.call(template_pack_name) do |result|
15
+ result.success do |message|
16
+ puts message
17
+ end
18
+
19
+ result.failure do |message|
20
+ puts message
21
+ exit 1
22
+ end
23
+ end
24
+
25
+ Indoctrinatr::Tools::Transactions::TemplatePackDefaultValuesCompiler.new.call(template_pack_name:, keep_aux_files:) do |result|
26
+ result.success do |message|
27
+ puts message
28
+ end
29
+
30
+ result.failure do |message|
31
+ puts message
32
+ exit 1
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,28 @@
1
+ module Indoctrinatr
2
+ module Tools
3
+ module Commands
4
+ class PdfWithFieldNames < Dry::CLI::Command
5
+ desc 'Compile PDF with Variable Names as values.'
6
+
7
+ argument :template_pack_name, desc: 'Name of template pack'
8
+ option :keep_aux_files, type: :boolean, default: false, desc: 'The option to keep aux files'
9
+
10
+ def call(template_pack_name:, **options)
11
+ template_pack_name = CommandAutocompleteHelpers.handle_autocomplete(template_pack_name)
12
+ keep_aux_files = options.fetch(:keep_aux_files)
13
+
14
+ Indoctrinatr::Tools::Transactions::TemplatePackFieldnamesCreator.new.call(template_pack_name:, keep_aux_files:) do |result|
15
+ result.success do |message|
16
+ puts message
17
+ end
18
+
19
+ result.failure do |message|
20
+ puts message
21
+ exit 1
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,26 @@
1
+ module Indoctrinatr
2
+ module Tools
3
+ module Commands
4
+ class Scaffold < Dry::CLI::Command
5
+ desc 'Scaffold new project.'
6
+
7
+ argument :template_pack_name, desc: 'Name of template pack'
8
+
9
+ def call(template_pack_name: '', **)
10
+ template_pack_name = CommandAutocompleteHelpers.handle_autocomplete(template_pack_name)
11
+
12
+ Indoctrinatr::Tools::Transactions::TemplatePackScaffold.new.call(template_pack_name) do |result|
13
+ result.success do |message|
14
+ puts message
15
+ end
16
+
17
+ result.failure do |message|
18
+ puts message
19
+ exit 1
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,13 @@
1
+ module Indoctrinatr
2
+ module Tools
3
+ module Commands
4
+ class Version < Dry::CLI::Command
5
+ desc 'Print installed version of indoctrinatr-tools.'
6
+
7
+ def call(*)
8
+ puts Indoctrinatr::Tools::VERSION
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end