indoctrinatr-tools 0.15.0 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +9 -39
  3. data/.rubocop.yml +11 -6
  4. data/.ruby-version +1 -0
  5. data/CHANGELOG.md +14 -0
  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 +28 -29
  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 +4 -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} +17 -19
  35. data/lib/indoctrinatr/tools/template_documentation_content.rb +72 -23
  36. data/lib/indoctrinatr/tools/template_documentation_helpers.rb +1 -1
  37. data/lib/indoctrinatr/tools/template_documentation_source_file.rb +9 -14
  38. data/lib/indoctrinatr/tools/template_pack_configuration.rb +2 -1
  39. data/lib/indoctrinatr/tools/transactions/template_pack_default_values_compiler.rb +67 -0
  40. data/lib/indoctrinatr/tools/transactions/template_pack_default_values_parser.rb +82 -0
  41. data/lib/indoctrinatr/tools/transactions/template_pack_demo.rb +104 -0
  42. data/lib/indoctrinatr/tools/transactions/template_pack_documentation.rb +223 -0
  43. data/lib/indoctrinatr/tools/transactions/template_pack_error_checker.rb +127 -0
  44. data/lib/indoctrinatr/tools/transactions/template_pack_fieldnames_creator.rb +97 -0
  45. data/lib/indoctrinatr/tools/transactions/template_pack_packer.rb +73 -0
  46. data/lib/indoctrinatr/tools/transactions/template_pack_scaffold.rb +73 -0
  47. data/lib/indoctrinatr/tools/version.rb +1 -1
  48. data/lib/indoctrinatr_tools.rb +12 -0
  49. metadata +106 -141
  50. checksums.yaml.gz.sig +0 -0
  51. data/.arcconfig +0 -9
  52. data/.coveralls.yml +0 -1
  53. data/.travis.yml +0 -15
  54. data/bin/indoctrinatr +0 -185
  55. data/certs/dkd-reuschling.pem +0 -22
  56. data/features/autocompletion_support.feature +0 -9
  57. data/features/demo.feature +0 -17
  58. data/features/doc_keepauxfiles.feature +0 -13
  59. data/features/documentation.feature +0 -20
  60. data/features/fieldnames_pdf.feature +0 -9
  61. data/features/fieldnames_pdf_auxfiles.feature +0 -10
  62. data/features/pack.feature +0 -11
  63. data/features/parse.feature +0 -6
  64. data/features/pdf.feature +0 -15
  65. data/features/pdf_keepauxfiles.feature +0 -11
  66. data/features/pdf_with_timestamp.feature +0 -8
  67. data/features/scaffold.feature +0 -23
  68. data/features/step_definitions/common.rb +0 -3
  69. data/features/step_definitions/indoctrinatr_cli.rb +0 -11
  70. data/features/support/env.rb +0 -1
  71. data/features/version.feature +0 -5
  72. data/features/workflow.feature +0 -9
  73. data/lib/indoctrinatr/tools/directory_helpers.rb +0 -18
  74. data/lib/indoctrinatr/tools/template_pack_default_values_compiler.rb +0 -47
  75. data/lib/indoctrinatr/tools/template_pack_default_values_parser.rb +0 -55
  76. data/lib/indoctrinatr/tools/template_pack_demo.rb +0 -23
  77. data/lib/indoctrinatr/tools/template_pack_documentation.rb +0 -132
  78. data/lib/indoctrinatr/tools/template_pack_error_checker.rb +0 -104
  79. data/lib/indoctrinatr/tools/template_pack_fieldnames_creator.rb +0 -79
  80. data/lib/indoctrinatr/tools/template_pack_helpers.rb +0 -68
  81. data/lib/indoctrinatr/tools/template_pack_packer.rb +0 -49
  82. data/lib/indoctrinatr/tools/template_pack_scaffold.rb +0 -57
  83. data/lib/indoctrinatr/tools.rb +0 -9
  84. data/spec/fixtures/test/configuration.yaml +0 -26
  85. data/spec/fixtures/test/test.tex.erb +0 -15
  86. data/spec/indoctrinatr/templates/configuration_file_spec.rb +0 -9
  87. data/spec/indoctrinatr/templates/tex_file_spec.rb +0 -9
  88. data/spec/indoctrinatr/tools/textile_support_spec.rb +0 -18
  89. data/spec/indoctrinatr/tools/version_spec.rb +0 -8
  90. data/spec/redcloth_latex_formatter_patch/patch_spec.rb +0 -34
  91. data/spec/spec_helper.rb +0 -2
  92. data.tar.gz.sig +0 -0
  93. metadata.gz.sig +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 569e7656b8197682d1109ec495b26d331f08ffe7
4
- data.tar.gz: 6c63a429e5457f4fd3f3809417c943e72bc06952
2
+ SHA256:
3
+ metadata.gz: 9ecf077d9fa4e157d3cab1a0a8cdbc0cfb0e78da076c3cc99248eb2d01223ac9
4
+ data.tar.gz: 24d93b0dccc5b43e4775870df136ee87d59b23f4f60de001d63f14b22ba41166
5
5
  SHA512:
6
- metadata.gz: 6b44dc06e7ed80e07cecf71dc5d0732429aaaaa3849f0cdbe8c6fecb58a86a21d68fa12251bd7d587ef0645277d9cc33822986b099afe589f0254505cb51b7c7
7
- data.tar.gz: de94350496af62ada8b9ee9cb35487a2ca51be6d89fd840b0ec2e218065d874ab151722dbea7eb1b4d30f757f985afe4b30b678374904283f7773c754388611c
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
@@ -1,15 +1,20 @@
1
- require: rubocop-rspec
1
+ require:
2
+ - rubocop-performance
3
+ - rubocop-rspec
2
4
 
3
5
  AllCops:
4
- AllCops:
5
- TargetRubyVersion: 2.2
6
+ NewCops: enable
7
+ TargetRubyVersion: 3.1
8
+ ExtraDetails: true
9
+ DisplayStyleGuide: true
10
+ DisplayCopNames: true
6
11
  Exclude:
7
12
  - tmp/**/*
8
13
  - vendor/**/*
9
- Metrics/LineLength:
14
+ Style/FrozenStringLiteralComment:
15
+ Enabled: false
16
+ Layout/LineLength:
10
17
  Max: 240
11
- Style/MethodDefParentheses:
12
- EnforcedStyle: require_no_parentheses
13
18
  Style/Documentation:
14
19
  Enabled: false
15
20
  Metrics/MethodLength:
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # indoctrinatr-tools
2
2
 
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)
12
+
13
+ ### changes
14
+
15
+ * updated infrastructure
16
+
3
17
  ## v0.15.0 (2017-04-16)
4
18
 
5
19
  ### changes
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2014-2017 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) [![Dependency Status](https://gemnasium.com/badges/github.com/dkd/indoctrinatr-tools.svg)](https://gemnasium.com/github.com/dkd/indoctrinatr-tools) 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'
@@ -1,44 +1,43 @@
1
- # coding: utf-8
2
-
3
- lib = File.expand_path('../lib', __FILE__)
1
+ lib = File.expand_path('lib', __dir__)
4
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
3
  require 'indoctrinatr/tools/version'
6
4
 
7
- Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
5
+ Gem::Specification.new do |spec|
8
6
  spec.name = 'indoctrinatr-tools'
9
7
  spec.version = Indoctrinatr::Tools::VERSION
10
- spec.authors = ['Nicolai Reuschling', 'Luka Lüdicke']
11
- 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']
12
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).'
13
- # spec.description = %q{TODO: Write a longer description. Optional.}
14
- spec.homepage = ''
11
+ spec.homepage = 'https://github.com/dkd/indoctrinatr'
15
12
  spec.license = 'MIT'
16
13
 
17
- spec.required_ruby_version = '~> 2.2'
14
+ spec.required_ruby_version = '~> 3.1'
18
15
 
19
- spec.files = `git ls-files -z`.split("\x0")
20
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
21
- 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) }
22
21
  spec.require_paths = ['lib']
23
22
 
24
- spec.add_development_dependency 'bundler', '~> 1.14'
25
- spec.add_development_dependency 'rake', '~> 12.0'
26
- spec.add_development_dependency 'rspec', '~> 3.5'
27
- spec.add_development_dependency 'cucumber', '~> 2.4'
28
- spec.add_development_dependency 'aruba', '~> 0.14'
29
- spec.add_development_dependency 'rubocop', '~> 0.48'
30
- spec.add_development_dependency 'rubocop-rspec', '~> 1.15'
31
- spec.add_development_dependency 'pry', '~> 0.10'
32
- spec.add_development_dependency 'coveralls', '~> 0.8'
33
-
34
- spec.add_dependency 'gli', '~> 2.16'
35
- spec.add_dependency 'rubyzip', '~> 1.2'
36
- spec.add_dependency 'erubis', '~> 2.7'
37
- spec.add_dependency 'to_latex', '~> 0.5'
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
+
33
+ spec.add_dependency 'dry-cli', '~> 1.0'
34
+ spec.add_dependency 'dry-transaction', '~> 0.13'
35
+ spec.add_dependency 'erubis', '~> 2.7'
38
36
  spec.add_dependency 'RedCloth', '~> 4.3'
39
-
40
- spec.cert_chain = ['certs/dkd-reuschling.pem']
41
- spec.signing_key = File.expand_path('~/.ssh/gem-private_key.pem') if $PROGRAM_NAME.end_with?('gem')
37
+ spec.add_dependency 'rubyzip', '~> 2'
38
+ spec.add_dependency 'to_latex', '~> 0.5'
39
+ spec.add_dependency 'zeitwerk', '~> 2.6'
42
40
 
43
41
  spec.requirements << 'LaTeX development enviroment'
42
+ spec.metadata['rubygems_mfa_required'] = 'true'
44
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