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.
- checksums.yaml +5 -5
- data/.gitignore +9 -39
- data/.rubocop.yml +11 -6
- data/.ruby-version +1 -0
- data/CHANGELOG.md +14 -0
- data/LICENSE +1 -1
- data/README.md +5 -6
- data/Rakefile +5 -20
- data/cucumber.yml +1 -1
- data/exe/indoctrinatr +4 -0
- data/indoctrinatr-tools.gemspec +28 -29
- data/lib/indoctrinatr/templates/documentation/indoctrinatr-technical-documentation-content.tex.erb +4 -4
- data/lib/indoctrinatr/templates/documentation/indoctrinatr-technical-documentation.sty +0 -15
- data/lib/indoctrinatr/tools/command_autocomplete_helpers.rb +9 -0
- data/lib/indoctrinatr/tools/commands/bash_completions.rb +21 -0
- data/lib/indoctrinatr/tools/commands/check.rb +26 -0
- data/lib/indoctrinatr/tools/commands/completion_commands.rb +25 -0
- data/lib/indoctrinatr/tools/commands/demo.rb +22 -0
- data/lib/indoctrinatr/tools/commands/doc.rb +28 -0
- data/lib/indoctrinatr/tools/commands/pack.rb +26 -0
- data/lib/indoctrinatr/tools/commands/parse.rb +26 -0
- data/lib/indoctrinatr/tools/commands/pdf.rb +39 -0
- data/lib/indoctrinatr/tools/commands/pdf_with_field_names.rb +28 -0
- data/lib/indoctrinatr/tools/commands/scaffold.rb +26 -0
- data/lib/indoctrinatr/tools/commands/version.rb +13 -0
- data/lib/indoctrinatr/tools/commands/workflow.rb +38 -0
- data/lib/indoctrinatr/tools/commands/zsh_completions.rb +25 -0
- data/lib/indoctrinatr/tools/commands.rb +21 -0
- data/lib/indoctrinatr/tools/configuration_extractor.rb +11 -13
- data/lib/indoctrinatr/tools/content_for_tex_files.rb +5 -3
- data/lib/indoctrinatr/tools/default_values.rb +1 -3
- data/lib/indoctrinatr/tools/field_name_values.rb +4 -5
- data/lib/indoctrinatr/tools/pdf_generator.rb +3 -3
- data/lib/{redcloth_latex_formatter_patch/patch.rb → indoctrinatr/tools/redcloth_formatters_latex_patch.rb} +17 -19
- data/lib/indoctrinatr/tools/template_documentation_content.rb +72 -23
- data/lib/indoctrinatr/tools/template_documentation_helpers.rb +1 -1
- data/lib/indoctrinatr/tools/template_documentation_source_file.rb +9 -14
- data/lib/indoctrinatr/tools/template_pack_configuration.rb +2 -1
- data/lib/indoctrinatr/tools/transactions/template_pack_default_values_compiler.rb +67 -0
- data/lib/indoctrinatr/tools/transactions/template_pack_default_values_parser.rb +82 -0
- data/lib/indoctrinatr/tools/transactions/template_pack_demo.rb +104 -0
- data/lib/indoctrinatr/tools/transactions/template_pack_documentation.rb +223 -0
- data/lib/indoctrinatr/tools/transactions/template_pack_error_checker.rb +127 -0
- data/lib/indoctrinatr/tools/transactions/template_pack_fieldnames_creator.rb +97 -0
- data/lib/indoctrinatr/tools/transactions/template_pack_packer.rb +73 -0
- data/lib/indoctrinatr/tools/transactions/template_pack_scaffold.rb +73 -0
- data/lib/indoctrinatr/tools/version.rb +1 -1
- data/lib/indoctrinatr_tools.rb +12 -0
- metadata +106 -141
- checksums.yaml.gz.sig +0 -0
- data/.arcconfig +0 -9
- data/.coveralls.yml +0 -1
- data/.travis.yml +0 -15
- data/bin/indoctrinatr +0 -185
- data/certs/dkd-reuschling.pem +0 -22
- data/features/autocompletion_support.feature +0 -9
- data/features/demo.feature +0 -17
- data/features/doc_keepauxfiles.feature +0 -13
- data/features/documentation.feature +0 -20
- data/features/fieldnames_pdf.feature +0 -9
- data/features/fieldnames_pdf_auxfiles.feature +0 -10
- data/features/pack.feature +0 -11
- data/features/parse.feature +0 -6
- data/features/pdf.feature +0 -15
- data/features/pdf_keepauxfiles.feature +0 -11
- data/features/pdf_with_timestamp.feature +0 -8
- data/features/scaffold.feature +0 -23
- data/features/step_definitions/common.rb +0 -3
- data/features/step_definitions/indoctrinatr_cli.rb +0 -11
- data/features/support/env.rb +0 -1
- data/features/version.feature +0 -5
- data/features/workflow.feature +0 -9
- data/lib/indoctrinatr/tools/directory_helpers.rb +0 -18
- data/lib/indoctrinatr/tools/template_pack_default_values_compiler.rb +0 -47
- data/lib/indoctrinatr/tools/template_pack_default_values_parser.rb +0 -55
- data/lib/indoctrinatr/tools/template_pack_demo.rb +0 -23
- data/lib/indoctrinatr/tools/template_pack_documentation.rb +0 -132
- data/lib/indoctrinatr/tools/template_pack_error_checker.rb +0 -104
- data/lib/indoctrinatr/tools/template_pack_fieldnames_creator.rb +0 -79
- data/lib/indoctrinatr/tools/template_pack_helpers.rb +0 -68
- data/lib/indoctrinatr/tools/template_pack_packer.rb +0 -49
- data/lib/indoctrinatr/tools/template_pack_scaffold.rb +0 -57
- data/lib/indoctrinatr/tools.rb +0 -9
- data/spec/fixtures/test/configuration.yaml +0 -26
- data/spec/fixtures/test/test.tex.erb +0 -15
- data/spec/indoctrinatr/templates/configuration_file_spec.rb +0 -9
- data/spec/indoctrinatr/templates/tex_file_spec.rb +0 -9
- data/spec/indoctrinatr/tools/textile_support_spec.rb +0 -18
- data/spec/indoctrinatr/tools/version_spec.rb +0 -8
- data/spec/redcloth_latex_formatter_patch/patch_spec.rb +0 -34
- data/spec/spec_helper.rb +0 -2
- data.tar.gz.sig +0 -0
- metadata.gz.sig +0 -0
data/bin/indoctrinatr
DELETED
@@ -1,185 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'gli'
|
4
|
-
require 'indoctrinatr/tools/version'
|
5
|
-
require 'indoctrinatr/tools/template_pack_demo'
|
6
|
-
require 'indoctrinatr/tools/template_pack_scaffold'
|
7
|
-
require 'indoctrinatr/tools/template_pack_packer'
|
8
|
-
require 'indoctrinatr/tools/template_pack_default_values_parser'
|
9
|
-
require 'indoctrinatr/tools/template_pack_default_values_compiler'
|
10
|
-
require 'indoctrinatr/tools/template_pack_fieldnames_creator'
|
11
|
-
require 'indoctrinatr/tools/template_pack_documentation'
|
12
|
-
require 'indoctrinatr/tools/template_pack_error_checker'
|
13
|
-
|
14
|
-
include GLI::App
|
15
|
-
include Indoctrinatr::Tools
|
16
|
-
|
17
|
-
program_desc 'Create and manage Template Packs for Indoctrinatr'
|
18
|
-
version Indoctrinatr::Tools::VERSION
|
19
|
-
config_file '.indoctrinatr.rc'
|
20
|
-
|
21
|
-
desc 'Display current version'
|
22
|
-
command :version do |c|
|
23
|
-
c.action do
|
24
|
-
puts Indoctrinatr::Tools::VERSION
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
desc 'Display the suggested workflow'
|
29
|
-
command :workflow do |c|
|
30
|
-
c.action do
|
31
|
-
puts 'The workflow for a project (e.g. demo) typically looks like this:
|
32
|
-
|
33
|
-
1. Run in shell: indoctrinatr new demo
|
34
|
-
Creates a new Indoctrinatr Template Pack in the folder demo
|
35
|
-
|
36
|
-
2. Edit demo.tex.erb and configuration.yaml according to needs
|
37
|
-
|
38
|
-
3. Run in shell: indoctrinatr parse demo
|
39
|
-
Parses tex file demo_with_default_values.tex with ERB and default values from configuration.yaml
|
40
|
-
|
41
|
-
4. Run in shell: indoctrinatr pdf demo
|
42
|
-
Compiles PDF from demo_with_default_values.tex
|
43
|
-
|
44
|
-
5. Run in shell: indoctrinatr check demo
|
45
|
-
Analyzes your Template Pack for potential errors
|
46
|
-
|
47
|
-
6. Run in shell: indoctrinatr doc demo
|
48
|
-
Creates a technical documentation for the Template Pack
|
49
|
-
|
50
|
-
7. Run in shell: indoctrinatr pack demo
|
51
|
-
Creates demo.zip with all required file for upload to Indoctrinatr server
|
52
|
-
|
53
|
-
'
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
desc 'Create, compile and pack a demo project'
|
58
|
-
command :demo do |c|
|
59
|
-
c.action do
|
60
|
-
TemplatePackDemo.new('demo').call
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
pre do |global_options, _, _, args|
|
65
|
-
# modify template_pack_name argument. This removes a trailing '/' that we get when users use tab completion
|
66
|
-
global_options['template_pack_name'] = File.split(args[0])[1] unless args.empty?
|
67
|
-
true # pre condition returns false when nothing is done
|
68
|
-
end
|
69
|
-
|
70
|
-
desc 'Create a scaffold for a new Template Pack'
|
71
|
-
arg_name 'template-pack-name'
|
72
|
-
command :new do |c|
|
73
|
-
c.action do |global_options, _, _|
|
74
|
-
template_pack_name = global_options['template_pack_name']
|
75
|
-
TemplatePackScaffold.new(template_pack_name).call
|
76
|
-
end
|
77
|
-
end
|
78
|
-
|
79
|
-
desc 'Parse XeTeX file with ERB and default values of Template Pack'
|
80
|
-
arg_name 'template_pack_name'
|
81
|
-
command :parse do |c|
|
82
|
-
c.action do |global_options, _, _|
|
83
|
-
template_pack_name = global_options['template_pack_name']
|
84
|
-
TemplatePackDefaultValuesParser.new(template_pack_name).call
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
desc 'Compile PDF with default values'
|
89
|
-
arg_name 'template_pack_name'
|
90
|
-
command :pdf do |c|
|
91
|
-
c.desc 'Keep generated aux files'
|
92
|
-
c.switch [:'keep-aux-files']
|
93
|
-
c.action do |global_options, options, _|
|
94
|
-
template_pack_name = global_options['template_pack_name']
|
95
|
-
keep_aux_files = options[:'keep-aux-files']
|
96
|
-
TemplatePackDefaultValuesParser.new(template_pack_name).call
|
97
|
-
TemplatePackDefaultValuesCompiler.new(template_pack_name, keep_aux_files).call
|
98
|
-
end
|
99
|
-
end
|
100
|
-
|
101
|
-
desc 'Compile PDF with Variable Names as values'
|
102
|
-
arg_name 'template_pack_name'
|
103
|
-
command :pdf_with_field_names do |c|
|
104
|
-
c.desc 'Keep generated aux files'
|
105
|
-
c.switch [:'keep-aux-files']
|
106
|
-
c.action do |global_options, options, _|
|
107
|
-
template_pack_name = global_options['template_pack_name']
|
108
|
-
keep_aux_files = options[:'keep-aux-files']
|
109
|
-
TemplatePackFieldnamesCreator.new(template_pack_name, keep_aux_files).call
|
110
|
-
end
|
111
|
-
end
|
112
|
-
|
113
|
-
desc 'Create a documentation from a given source folder'
|
114
|
-
arg_name 'template_pack_name'
|
115
|
-
command :doc do |c|
|
116
|
-
c.desc 'Keep generated aux files'
|
117
|
-
c.switch [:'keep-aux-files']
|
118
|
-
c.action do |global_options, options, _|
|
119
|
-
template_pack_name = global_options['template_pack_name']
|
120
|
-
keep_aux_files = options[:'keep-aux-files']
|
121
|
-
TemplatePackDocumentation.new(template_pack_name, keep_aux_files).call
|
122
|
-
end
|
123
|
-
end
|
124
|
-
|
125
|
-
desc 'Check for errors in the given source folder'
|
126
|
-
arg_name 'template_pack_name'
|
127
|
-
command :check do |c|
|
128
|
-
c.action do |global_options, _, _|
|
129
|
-
template_pack_name = global_options['template_pack_name']
|
130
|
-
TemplatePackErrorChecker.new(template_pack_name).call
|
131
|
-
end
|
132
|
-
end
|
133
|
-
|
134
|
-
desc 'Create a Template Pack from a given source folder'
|
135
|
-
arg_name 'template_pack_name'
|
136
|
-
command :pack do |c|
|
137
|
-
c.action do |global_options, _, _|
|
138
|
-
template_pack_name = global_options['template_pack_name']
|
139
|
-
TemplatePackPacker.new(template_pack_name).call
|
140
|
-
end
|
141
|
-
end
|
142
|
-
|
143
|
-
desc 'Display instructions for bash completion'
|
144
|
-
command :bashcompletion do |c|
|
145
|
-
c.action do
|
146
|
-
puts 'Add this to your .bashrc (and open up a new shell):
|
147
|
-
|
148
|
-
complete -F get_indoctrinatr_targets indoctrinatr
|
149
|
-
function get_indoctrinatr_targets()
|
150
|
-
{
|
151
|
-
if [ -z $2 ] ; then
|
152
|
-
COMPREPLY=(`indoctrinatr help -c`)
|
153
|
-
else
|
154
|
-
COMPREPLY=(`indoctrinatr help -c $2`)
|
155
|
-
fi
|
156
|
-
}
|
157
|
-
|
158
|
-
'
|
159
|
-
end
|
160
|
-
end
|
161
|
-
|
162
|
-
# thanks to http://devopsbox.es/posts/2013/10-31-the-cleanest-gli-bash-zsh-tab-completion.html
|
163
|
-
desc 'Display instructions for zsh completion'
|
164
|
-
command :zshcompletion do |c|
|
165
|
-
c.action do
|
166
|
-
puts 'Add this to your .zshrc (and open up a new shell):
|
167
|
-
|
168
|
-
if [[ -n ${ZSH_VERSION-} ]]; then
|
169
|
-
autoload -U +X bashcompinit && bashcompinit
|
170
|
-
fi
|
171
|
-
|
172
|
-
complete -F get_indoctrinatr_commands indoctrinatr
|
173
|
-
function get_indoctrinatr_commands()
|
174
|
-
{
|
175
|
-
local binary="indoctrinatr"
|
176
|
-
help_params=${COMP_WORDS[@]:1}
|
177
|
-
clean_params=${help_params//-*([^ ])?( )}
|
178
|
-
COMPREPLY=(`$binary help -c $clean_params`)
|
179
|
-
}
|
180
|
-
|
181
|
-
'
|
182
|
-
end
|
183
|
-
end
|
184
|
-
|
185
|
-
exit run(ARGV)
|
data/certs/dkd-reuschling.pem
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
-----BEGIN CERTIFICATE-----
|
2
|
-
MIIDjjCCAnagAwIBAgIBATANBgkqhkiG9w0BAQUFADBGMRswGQYDVQQDDBJuaWNv
|
3
|
-
bGFpLnJldXNjaGxpbmcxEzARBgoJkiaJk/IsZAEZFgNka2QxEjAQBgoJkiaJk/Is
|
4
|
-
ZAEZFgJkZTAeFw0xNjA5MTQwODI4MDFaFw0xNzA5MTQwODI4MDFaMEYxGzAZBgNV
|
5
|
-
BAMMEm5pY29sYWkucmV1c2NobGluZzETMBEGCgmSJomT8ixkARkWA2RrZDESMBAG
|
6
|
-
CgmSJomT8ixkARkWAmRlMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA
|
7
|
-
vlHNuOcO6oCtv59swqYd181lxf2sCVwajmLuXC0EiYfwMCKRlelLmmYOH61arTCJ
|
8
|
-
iUaoGOCE9HCt1ZxVkN/bcSIqMO4MNbRuq2o2DrBsKWSMaCvUYTJi6F+JyKlL/XFY
|
9
|
-
Pc9NoIyT1FJ5UnDC3M0lBsvJOdRkjxuK5pImv+lei3ZarIL/7TP511fMjTRbrzo1
|
10
|
-
GltFvcM1HaXk/n2DU2IevCI+PNaP6+IiAJe3iPnDElxmYQO4lAhkt2RwtyntcYyk
|
11
|
-
Wc2w5yvsEy/Dj/k0lL/tAb+fuPfEw6sJGmt53fjrGVSgbmx5W67ua8KGQ4WV4SSQ
|
12
|
-
qia8AR2ILljAHZl3USm2SQIDAQABo4GGMIGDMAkGA1UdEwQCMAAwCwYDVR0PBAQD
|
13
|
-
AgSwMB0GA1UdDgQWBBRsKZ1MC723dEnBg972E4nclYGV+jAkBgNVHREEHTAbgRlu
|
14
|
-
aWNvbGFpLnJldXNjaGxpbmdAZGtkLmRlMCQGA1UdEgQdMBuBGW5pY29sYWkucmV1
|
15
|
-
c2NobGluZ0Bka2QuZGUwDQYJKoZIhvcNAQEFBQADggEBAJ16ezxNfUUADQ4y3PwM
|
16
|
-
2+E26mJS0sUegKaL+YjD9egiEJkA5BPGhd9+FbRy9eNN4G86G161v97odCSXwGSE
|
17
|
-
Mnk0CbTpL7i/OdxgwE2xyxaf3pGU5Qw676Vu1rSvTUdYzu8W8OvmH5BVq3o7TPqW
|
18
|
-
JKgPr7MayKysuMrevACFOMzLxxcyHOxs096U/0ei93La54dqCUBA449Wt9aufwGP
|
19
|
-
5ioQ8Y60Ugn6PY1YT48+dvM53frMrYA8/ts51cItvU9iJAfYIeE7Zfi9XBRxZ0W6
|
20
|
-
HOu/JTkMVu8oWst3Fhxdqaqw1a1uFYiG5VkcX0hsPUFS+ZDJhAhi1eu5Pea1dZq4
|
21
|
-
CZs=
|
22
|
-
-----END CERTIFICATE-----
|
@@ -1,9 +0,0 @@
|
|
1
|
-
Feature: Checking autocompletion
|
2
|
-
Scenario: Running the 'bashcompletion' command
|
3
|
-
When I successfully run `indoctrinatr bashcompletion`
|
4
|
-
Then the output should contain "get_indoctrinatr_targets()"
|
5
|
-
|
6
|
-
Scenario: Running the 'zshcompletion' command
|
7
|
-
When I successfully run `indoctrinatr zshcompletion`
|
8
|
-
Then the output should contain "autoload -U +X bashcompinit && bashcompinit"
|
9
|
-
And the output should contain "get_indoctrinatr_commands()"
|
data/features/demo.feature
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
Feature: Running the "demo" command
|
2
|
-
|
3
|
-
Background:
|
4
|
-
Given the default aruba exit timeout is 60 seconds
|
5
|
-
|
6
|
-
Scenario:
|
7
|
-
When I successfully run `indoctrinatr demo`
|
8
|
-
Then a file named "demo/doc/demo_technical_documentation.pdf" should exist
|
9
|
-
And a directory named "demo" should exist
|
10
|
-
And a directory named "demo/assets" should exist
|
11
|
-
And the following files should exist:
|
12
|
-
| demo/configuration.yaml |
|
13
|
-
| demo/demo.tex.erb |
|
14
|
-
| demo/doc/examples/demo_with_default_values.tex |
|
15
|
-
| demo/doc/examples/demo_with_default_values.pdf |
|
16
|
-
| demo/doc/demo_technical_documentation.pdf |
|
17
|
-
| demo.zip |
|
@@ -1,13 +0,0 @@
|
|
1
|
-
Feature: Running the 'doc' command with keepauxfiles
|
2
|
-
|
3
|
-
Background:
|
4
|
-
Given the default aruba exit timeout is 40 seconds
|
5
|
-
|
6
|
-
Scenario: creating documentation for given project
|
7
|
-
Given I do not have a 'demo' project
|
8
|
-
When I successfully run `indoctrinatr new demo`
|
9
|
-
And I successfully run `indoctrinatr doc demo --keep-aux-files`
|
10
|
-
Then the output should match /A documentation for 'demo' has been successfully generated/
|
11
|
-
Then a file named "demo/doc/demo_technical_documentation.pdf" should exist
|
12
|
-
And a file named "demo/doc/indoctrinatr-technical-documentation.log" should exist
|
13
|
-
And a file named "demo/doc/indoctrinatr-technical-documentation.tex" should exist
|
@@ -1,20 +0,0 @@
|
|
1
|
-
Feature: Running the 'doc' command
|
2
|
-
|
3
|
-
Background:
|
4
|
-
Given the default aruba exit timeout is 40 seconds
|
5
|
-
Given I do not have a 'demo' project
|
6
|
-
When I successfully run `indoctrinatr new demo`
|
7
|
-
|
8
|
-
Scenario: creating documentation for given project
|
9
|
-
And I successfully run `indoctrinatr doc demo`
|
10
|
-
Then the output should match /Example with field names has been automatically generated for the documentation/
|
11
|
-
Then the output should match /A documentation for 'demo' has been successfully generated/
|
12
|
-
Then a file named "demo/doc/demo_technical_documentation.pdf" should exist
|
13
|
-
|
14
|
-
Scenario: creating the documentation without overwriting a FieldNames PDF example
|
15
|
-
And I successfully run `indoctrinatr pdf_with_field_names demo`
|
16
|
-
Then a file named "demo/doc/examples/demo_with_fieldname_values.pdf" should exist
|
17
|
-
And I successfully run `indoctrinatr doc demo`
|
18
|
-
Then the output should not match /Example with field names has been automatically generated for the documentation/
|
19
|
-
Then the output should match /A documentation for 'demo' has been successfully generated/
|
20
|
-
Then a file named "demo/doc/demo_technical_documentation.pdf" should exist
|
@@ -1,9 +0,0 @@
|
|
1
|
-
Feature: Running the 'pdf_with_field_names' command
|
2
|
-
|
3
|
-
Background:
|
4
|
-
Given the default aruba exit timeout is 20 seconds
|
5
|
-
|
6
|
-
Scenario: for a given 'demo' project
|
7
|
-
Given I have an Indoctrinatr project 'demo'
|
8
|
-
And I run `indoctrinatr pdf_with_field_names demo`
|
9
|
-
Then a file named "demo/doc/examples/demo_with_fieldname_values.pdf" should exist
|
@@ -1,10 +0,0 @@
|
|
1
|
-
Feature: Running the 'pdf_with_field_names' command with keepauxfiles
|
2
|
-
|
3
|
-
Background:
|
4
|
-
Given the default aruba exit timeout is 20 seconds
|
5
|
-
|
6
|
-
Scenario: for a given 'demo' project
|
7
|
-
Given I have an Indoctrinatr project 'demo'
|
8
|
-
And I run `indoctrinatr pdf_with_field_names demo --keep-aux-files`
|
9
|
-
Then a file named "demo/doc/examples/demo_with_fieldname_values.pdf" should exist
|
10
|
-
And a file named "demo/doc/examples/demo_with_fieldname_values.log" should exist
|
data/features/pack.feature
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
Feature: Running the 'pack' command
|
2
|
-
|
3
|
-
Background:
|
4
|
-
Given the default aruba exit timeout is 20 seconds
|
5
|
-
|
6
|
-
Scenario:
|
7
|
-
Given I have an Indoctrinatr project 'demo'
|
8
|
-
When I successfully run `indoctrinatr parse demo`
|
9
|
-
And I run `indoctrinatr pdf demo`
|
10
|
-
And I run `indoctrinatr pack demo`
|
11
|
-
Then a file named "demo.zip" should exist
|
data/features/parse.feature
DELETED
data/features/pdf.feature
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
Feature: Running the 'pdf' command
|
2
|
-
|
3
|
-
Background:
|
4
|
-
Given the default aruba exit timeout is 20 seconds
|
5
|
-
Given I have an Indoctrinatr project 'demo'
|
6
|
-
When I successfully run `indoctrinatr parse demo`
|
7
|
-
|
8
|
-
Scenario: for a given 'demo' project
|
9
|
-
And I run `indoctrinatr pdf demo`
|
10
|
-
Then a file named "demo/doc/examples/demo_with_default_values.pdf" should exist
|
11
|
-
|
12
|
-
Scenario: for a given 'demo' project and usage with tab-completion
|
13
|
-
And I run `indoctrinatr pdf demo/`
|
14
|
-
Then a file named "demo/doc/examples/demo_with_default_values.pdf" should exist
|
15
|
-
|
@@ -1,11 +0,0 @@
|
|
1
|
-
Feature: Running the 'pdf' command with keepauxfiles option
|
2
|
-
|
3
|
-
Background:
|
4
|
-
Given the default aruba exit timeout is 20 seconds
|
5
|
-
|
6
|
-
Scenario: for a given 'demo' project
|
7
|
-
Given I have an Indoctrinatr project 'demo'
|
8
|
-
And I run `indoctrinatr pdf demo --keep-aux-files`
|
9
|
-
Then a file named "demo/doc/examples/demo_with_default_values.pdf" should exist
|
10
|
-
And a file named "demo/doc/examples/demo_with_default_values.log" should exist
|
11
|
-
# there is not (an easy) way to use the current timestamp. Therefore the template for the 'new' command should not be static
|
@@ -1,8 +0,0 @@
|
|
1
|
-
Feature: Running the 'pdf' command with timestamp in filename
|
2
|
-
Scenario: using the test fixture
|
3
|
-
Given I use the fixture named "test"
|
4
|
-
When I cd to "../"
|
5
|
-
When I run the Indoctrinatr command 'parse test'
|
6
|
-
And I run `indoctrinatr pdf test`
|
7
|
-
# String interpolation for "file named should exist" does not work. Therefore less strict regexp matching:
|
8
|
-
Then a file matching %r<test/doc/examples/\d{4}_hello_world\.pdf> should exist
|
data/features/scaffold.feature
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
Feature: Running the 'new' command
|
2
|
-
|
3
|
-
Scenario: with a valid name 'demo'
|
4
|
-
Given I do not have a 'demo' project
|
5
|
-
When I successfully run `indoctrinatr new demo`
|
6
|
-
Then the output should match /A template pack scaffold was created in folder 'demo'. Happy templating…/
|
7
|
-
And a directory named "demo" should exist
|
8
|
-
And a directory named "demo/assets" should exist
|
9
|
-
And the following files should exist:
|
10
|
-
| demo/configuration.yaml |
|
11
|
-
| demo/demo.tex.erb |
|
12
|
-
|
13
|
-
Scenario: with an empty name
|
14
|
-
Given I do not have a 'demo' project
|
15
|
-
When I run `indoctrinatr new`
|
16
|
-
Then the exit status should be 1
|
17
|
-
And the output should match /Please specify a template pack name/
|
18
|
-
|
19
|
-
Scenario: with the same name as an existing directory
|
20
|
-
Given I have an Indoctrinatr project 'demo'
|
21
|
-
When I run `indoctrinatr new demo`
|
22
|
-
Then the exit status should be 1
|
23
|
-
And the output should match /A folder with name 'demo' already exists/
|
@@ -1,11 +0,0 @@
|
|
1
|
-
Given(/^I do not have (?:a|an) '(.*)' project$/) do |project_name|
|
2
|
-
FileUtils.rm_rf project_name
|
3
|
-
end
|
4
|
-
|
5
|
-
Given(/^I have an Indoctrinatr project '(.*)'$/) do |project_name|
|
6
|
-
step "I run the Indoctrinatr command 'new #{project_name}'"
|
7
|
-
end
|
8
|
-
|
9
|
-
When(/^I run the Indoctrinatr command '(.*)'$/) do |command|
|
10
|
-
step "I successfully run `indoctrinatr #{command}`"
|
11
|
-
end
|
data/features/support/env.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
require 'aruba/cucumber'
|
data/features/version.feature
DELETED
data/features/workflow.feature
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
Feature: Running the "workflow" command
|
2
|
-
|
3
|
-
Scenario:
|
4
|
-
When I successfully run `indoctrinatr workflow`
|
5
|
-
Then the output should contain "new"
|
6
|
-
Then the output should contain "parse"
|
7
|
-
Then the output should contain "pdf"
|
8
|
-
Then the output should contain "check"
|
9
|
-
Then the output should contain "pack"
|
@@ -1,18 +0,0 @@
|
|
1
|
-
module Indoctrinatr
|
2
|
-
module Tools
|
3
|
-
module DirectoryHelpers
|
4
|
-
def print_dirtree_style directory = '.'
|
5
|
-
Dir.glob("#{directory}/**/*").inject [] do |entries, entry| # list entries recursively
|
6
|
-
nesting = entry.count(File::SEPARATOR) + 1 # nesting starts with 2, because for \dirtree 1 is root
|
7
|
-
name = entry.split(File::SEPARATOR).last
|
8
|
-
entries.push ".#{nesting} #{name}. " # formatting for \dirtree: .<level><space><text-node>.<space>
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
def list_files_of_type directory = '.', types = %w[erb rb yaml sty tex] # default file types for template docs
|
13
|
-
# found and modified from http://stackoverflow.com/a/3504307/1796645
|
14
|
-
Dir.glob("#{directory}/**/*.{#{types.join(',')}}") # recursively list files of type in types array
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
@@ -1,47 +0,0 @@
|
|
1
|
-
require 'indoctrinatr/tools/configuration_extractor'
|
2
|
-
require 'indoctrinatr/tools/pdf_generator'
|
3
|
-
require 'fileutils'
|
4
|
-
|
5
|
-
module Indoctrinatr
|
6
|
-
module Tools
|
7
|
-
class TemplatePackDefaultValuesCompiler
|
8
|
-
include TemplatePackHelpers
|
9
|
-
include PdfGenerator
|
10
|
-
|
11
|
-
attr_accessor :template_pack_name
|
12
|
-
|
13
|
-
def initialize template_pack_name, keep_aux_files = false
|
14
|
-
@template_pack_name = template_pack_name
|
15
|
-
@keep_aux_files = keep_aux_files
|
16
|
-
end
|
17
|
-
|
18
|
-
def call
|
19
|
-
check_for_folder
|
20
|
-
compile_tex_file
|
21
|
-
rename_if_necessary
|
22
|
-
end
|
23
|
-
|
24
|
-
def pdf_exists?
|
25
|
-
check_for_folder
|
26
|
-
file_path = pdf_with_default_values_file_path ConfigurationExtractor.new(template_pack_name).call
|
27
|
-
File.exist? file_path
|
28
|
-
end
|
29
|
-
|
30
|
-
private
|
31
|
-
|
32
|
-
def compile_tex_file
|
33
|
-
make_pdf tex_with_default_values_file_path, pack_documentation_examples_dir_path, !@keep_aux_files
|
34
|
-
end
|
35
|
-
|
36
|
-
def rename_if_necessary # rubocop:disable Metrics/AbcSize
|
37
|
-
configuration = ConfigurationExtractor.new(template_pack_name).call # TODO: avoid repeated calling of the ConfigurationExtrator
|
38
|
-
@default_values = DefaultValues.new configuration
|
39
|
-
return if @default_values.customized_output_file_name == @default_values.default_file_name
|
40
|
-
|
41
|
-
custom_filepath = pack_documentation_examples_dir_path + @default_values.customized_output_file_name
|
42
|
-
FileUtils.rm custom_filepath if File.exist? custom_filepath
|
43
|
-
FileUtils.mv(pack_documentation_examples_dir_path + @default_values.default_file_name, custom_filepath)
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
@@ -1,55 +0,0 @@
|
|
1
|
-
require 'indoctrinatr/tools/template_pack_helpers'
|
2
|
-
require 'indoctrinatr/tools/default_values'
|
3
|
-
require 'indoctrinatr/tools/configuration_extractor'
|
4
|
-
require 'erubis'
|
5
|
-
require 'to_latex'
|
6
|
-
|
7
|
-
module Indoctrinatr
|
8
|
-
module Tools
|
9
|
-
class TemplatePackDefaultValuesParser
|
10
|
-
include TemplatePackHelpers
|
11
|
-
|
12
|
-
attr_accessor :template_pack_name, :configuration, :default_values, :tex_file_content, :parsed_tex_file_content
|
13
|
-
|
14
|
-
def initialize template_pack_name
|
15
|
-
@template_pack_name = template_pack_name
|
16
|
-
end
|
17
|
-
|
18
|
-
def call
|
19
|
-
check_for_folder
|
20
|
-
read_config_file
|
21
|
-
read_tex_file
|
22
|
-
parse_tex_file
|
23
|
-
write_tex_file
|
24
|
-
show_success
|
25
|
-
end
|
26
|
-
|
27
|
-
private
|
28
|
-
|
29
|
-
def read_config_file
|
30
|
-
@configuration = ConfigurationExtractor.new(template_pack_name).call
|
31
|
-
@default_values = DefaultValues.new @configuration
|
32
|
-
@default_values._use_default_values
|
33
|
-
end
|
34
|
-
|
35
|
-
def read_tex_file
|
36
|
-
@tex_file_content = File.read tex_file_path
|
37
|
-
end
|
38
|
-
|
39
|
-
def parse_tex_file
|
40
|
-
@parsed_tex_file_content = Erubis::Eruby.new(@tex_file_content).result(default_values.retrieve_binding)
|
41
|
-
end
|
42
|
-
|
43
|
-
def write_tex_file
|
44
|
-
# Create directory to avoid file creation errors
|
45
|
-
Dir.mkdir(pack_documentation_dir_path) unless Dir.exist?(pack_documentation_dir_path)
|
46
|
-
Dir.mkdir(pack_documentation_examples_dir_path) unless Dir.exist?(pack_documentation_examples_dir_path)
|
47
|
-
File.write tex_with_default_values_file_path, parsed_tex_file_content
|
48
|
-
end
|
49
|
-
|
50
|
-
def show_success
|
51
|
-
puts "The template pack '#{template_pack_name}' has been successfully parsed with default values."
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
require 'indoctrinatr/tools/template_pack_helpers'
|
2
|
-
|
3
|
-
module Indoctrinatr
|
4
|
-
module Tools
|
5
|
-
class TemplatePackDemo
|
6
|
-
include TemplatePackHelpers
|
7
|
-
|
8
|
-
attr_accessor :template_pack_name
|
9
|
-
|
10
|
-
def initialize template_pack_name
|
11
|
-
@template_pack_name = template_pack_name
|
12
|
-
end
|
13
|
-
|
14
|
-
def call
|
15
|
-
TemplatePackScaffold.new(template_pack_name).call
|
16
|
-
TemplatePackDefaultValuesParser.new(template_pack_name).call
|
17
|
-
TemplatePackDefaultValuesCompiler.new(template_pack_name).call
|
18
|
-
TemplatePackDocumentation.new(template_pack_name).call
|
19
|
-
TemplatePackPacker.new(template_pack_name).call
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|