indoctrinatr-tools 0.12.0 → 0.13.0
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.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/CHANGELOG.md +29 -0
- data/bin/indoctrinatr +24 -15
- data/features/pdf.feature +7 -3
- data/features/pdf_with_timestamp.feature +8 -0
- data/features/version.feature +1 -1
- data/indoctrinatr-tools.gemspec +1 -1
- data/lib/indoctrinatr/tools/template_pack_default_values_compiler.rb +4 -3
- data/lib/indoctrinatr/tools/template_pack_scaffold.rb +1 -1
- data/lib/indoctrinatr/tools/version.rb +1 -1
- data/spec/fixtures/test/configuration.yaml +26 -0
- data/spec/fixtures/test/test.tex.erb +15 -0
- data/spec/indoctrinatr/tools/version_spec.rb +1 -1
- metadata +12 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f608e2b3dd38aeff4ad0e7847b9db6be4e031d1
|
4
|
+
data.tar.gz: 1fd96a823d47002366b4db2c232c389db18c7a61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 099f97738d115567f79c905981d254783f9010ff043f5ed2b4cd6154b6087601c7ba8dea7898e57444a584eddfea1b9cf8aaf7476318afcc70b385f3f1ad8d37
|
7
|
+
data.tar.gz: 2f5161a411a8a14e20f623e9fcd7516d21e429da0b0364f68537315ea6edbb5a04d802b74b9780f535c2552ad9ec6fa47520ee663a7dbab02e0ba44a85f400ae
|
data/.travis.yml
CHANGED
@@ -9,7 +9,7 @@ cache:
|
|
9
9
|
- apt
|
10
10
|
before_install:
|
11
11
|
- sudo apt-get update && sudo wget https://github.com/scottkosty/install-tl-ubuntu/raw/master/install-tl-ubuntu && sudo chmod +x ./install-tl-ubuntu && sudo ./install-tl-ubuntu
|
12
|
-
- gem install bundler -v 1.
|
12
|
+
- gem install bundler -v 1.10.6
|
13
13
|
script:
|
14
14
|
- bundle exec indoctrinatr demo
|
15
15
|
- bundle exec rake test_with_coveralls
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# indoctrinatr-tools
|
2
|
+
|
3
|
+
## v0.13.0 (2016-05-27)
|
4
|
+
|
5
|
+
### features
|
6
|
+
|
7
|
+
* support for trailing slashes in template pack name
|
8
|
+
|
9
|
+
### changes
|
10
|
+
|
11
|
+
* refactoring
|
12
|
+
|
13
|
+
## v0.12.0 (2016-05-10)
|
14
|
+
|
15
|
+
### features
|
16
|
+
|
17
|
+
* added `check` command: This analyzes your template pack for major issues (#64232)
|
18
|
+
* add `pdf_with_field_names` command (#64694). This creates an example where the field names are shown
|
19
|
+
* add the example with fieldnames to technical documentation (#71536) - when it is successfully generated
|
20
|
+
* add `keep-aux-files` option to pdf generation (#66118)
|
21
|
+
* disable overwriting PDF examples for `doc` command (#71535)
|
22
|
+
|
23
|
+
### changes
|
24
|
+
|
25
|
+
* documentation doesn't break when description field is missing (#65001)
|
26
|
+
* @longtabu@ for attributes list in documentation (#66081)
|
27
|
+
* move examples after generation in `/doc` directory in template pack
|
28
|
+
* show attributes list documentation as landscape
|
29
|
+
* refactoring
|
data/bin/indoctrinatr
CHANGED
@@ -44,7 +44,10 @@ command :workflow do |c|
|
|
44
44
|
5. Run in shell: indoctrinatr check demo
|
45
45
|
Analyzes your Template Pack for potential errors
|
46
46
|
|
47
|
-
6. Run in shell: indoctrinatr
|
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
|
48
51
|
Creates demo.zip with all required file for upload to Indoctrinatr server
|
49
52
|
|
50
53
|
'
|
@@ -58,11 +61,17 @@ command :demo do |c|
|
|
58
61
|
end
|
59
62
|
end
|
60
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
|
+
|
61
70
|
desc 'Create a scaffold for a new Template Pack'
|
62
71
|
arg_name 'template-pack-name'
|
63
72
|
command :new do |c|
|
64
|
-
c.action do |
|
65
|
-
template_pack_name =
|
73
|
+
c.action do |global_options, _, _|
|
74
|
+
template_pack_name = global_options['template_pack_name']
|
66
75
|
TemplatePackScaffold.new(template_pack_name).call
|
67
76
|
end
|
68
77
|
end
|
@@ -70,8 +79,8 @@ end
|
|
70
79
|
desc 'Parse XeTeX file with ERB and default values of Template Pack'
|
71
80
|
arg_name 'template_pack_name'
|
72
81
|
command :parse do |c|
|
73
|
-
c.action do |
|
74
|
-
template_pack_name =
|
82
|
+
c.action do |global_options, _, _|
|
83
|
+
template_pack_name = global_options['template_pack_name']
|
75
84
|
TemplatePackDefaultValuesParser.new(template_pack_name).call
|
76
85
|
end
|
77
86
|
end
|
@@ -81,8 +90,8 @@ arg_name 'template_pack_name'
|
|
81
90
|
command :pdf do |c|
|
82
91
|
c.desc 'Keep generated aux files'
|
83
92
|
c.switch [:'keep-aux-files']
|
84
|
-
c.action do |
|
85
|
-
template_pack_name =
|
93
|
+
c.action do |global_options, options, _|
|
94
|
+
template_pack_name = global_options['template_pack_name']
|
86
95
|
keep_aux_files = options[:'keep-aux-files']
|
87
96
|
TemplatePackDefaultValuesParser.new(template_pack_name).call
|
88
97
|
TemplatePackDefaultValuesCompiler.new(template_pack_name, keep_aux_files).call
|
@@ -94,8 +103,8 @@ arg_name 'template_pack_name'
|
|
94
103
|
command :pdf_with_field_names do |c|
|
95
104
|
c.desc 'Keep generated aux files'
|
96
105
|
c.switch [:'keep-aux-files']
|
97
|
-
c.action do |
|
98
|
-
template_pack_name =
|
106
|
+
c.action do |global_options, options, _|
|
107
|
+
template_pack_name = global_options['template_pack_name']
|
99
108
|
keep_aux_files = options[:'keep-aux-files']
|
100
109
|
TemplatePackFieldnamesCreator.new(template_pack_name, keep_aux_files).call
|
101
110
|
end
|
@@ -106,8 +115,8 @@ arg_name 'template_pack_name'
|
|
106
115
|
command :doc do |c|
|
107
116
|
c.desc 'Keep generated aux files'
|
108
117
|
c.switch [:'keep-aux-files']
|
109
|
-
c.action do |
|
110
|
-
template_pack_name =
|
118
|
+
c.action do |global_options, options, _|
|
119
|
+
template_pack_name = global_options['template_pack_name']
|
111
120
|
keep_aux_files = options[:'keep-aux-files']
|
112
121
|
TemplatePackDocumentation.new(template_pack_name, keep_aux_files).call
|
113
122
|
end
|
@@ -116,8 +125,8 @@ end
|
|
116
125
|
desc 'Check for errors in the given source folder'
|
117
126
|
arg_name 'template_pack_name'
|
118
127
|
command :check do |c|
|
119
|
-
c.action do |
|
120
|
-
template_pack_name =
|
128
|
+
c.action do |global_options, _, _|
|
129
|
+
template_pack_name = global_options['template_pack_name']
|
121
130
|
TemplatePackErrorChecker.new(template_pack_name).call
|
122
131
|
end
|
123
132
|
end
|
@@ -125,8 +134,8 @@ end
|
|
125
134
|
desc 'Create a Template Pack from a given source folder'
|
126
135
|
arg_name 'template_pack_name'
|
127
136
|
command :pack do |c|
|
128
|
-
c.action do |
|
129
|
-
template_pack_name =
|
137
|
+
c.action do |global_options, _, _|
|
138
|
+
template_pack_name = global_options['template_pack_name']
|
130
139
|
TemplatePackPacker.new(template_pack_name).call
|
131
140
|
end
|
132
141
|
end
|
data/features/pdf.feature
CHANGED
@@ -2,10 +2,14 @@ Feature: Running the 'pdf' command
|
|
2
2
|
|
3
3
|
Background:
|
4
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`
|
5
7
|
|
6
8
|
Scenario: for a given 'demo' project
|
7
|
-
Given I have an Indoctrinatr project 'demo'
|
8
|
-
When I successfully run `indoctrinatr parse demo`
|
9
9
|
And I run `indoctrinatr pdf demo`
|
10
10
|
Then a file named "demo/doc/examples/demo_with_default_values.pdf" should exist
|
11
|
-
|
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
|
+
|
@@ -0,0 +1,8 @@
|
|
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/version.feature
CHANGED
data/indoctrinatr-tools.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
21
21
|
spec.require_paths = ['lib']
|
22
22
|
|
23
|
-
spec.add_development_dependency 'bundler', '~> 1.
|
23
|
+
spec.add_development_dependency 'bundler', '~> 1.10'
|
24
24
|
spec.add_development_dependency 'rake', '~> 11.1'
|
25
25
|
spec.add_development_dependency 'rspec', '~> 3.4'
|
26
26
|
spec.add_development_dependency 'cucumber', '~> 2.3'
|
@@ -33,13 +33,14 @@ module Indoctrinatr
|
|
33
33
|
make_pdf tex_with_default_values_file_path, pack_documentation_examples_dir_path, !@keep_aux_files
|
34
34
|
end
|
35
35
|
|
36
|
-
def rename_if_necessary
|
36
|
+
def rename_if_necessary # rubocop:disable Metrics/AbcSize
|
37
37
|
configuration = ConfigurationExtractor.new(template_pack_name).call # TODO: avoid repeated calling of the ConfigurationExtrator
|
38
38
|
@default_values = DefaultValues.new configuration
|
39
39
|
return if @default_values.customized_output_file_name == @default_values.default_file_name
|
40
40
|
|
41
|
-
|
42
|
-
FileUtils.
|
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)
|
43
44
|
end
|
44
45
|
end
|
45
46
|
end
|
@@ -23,7 +23,7 @@ module Indoctrinatr
|
|
23
23
|
private
|
24
24
|
|
25
25
|
def create_folder
|
26
|
-
fail 'Please specify a template pack name.' if template_pack_name.empty? # rubocop:disable Style/SignalException
|
26
|
+
fail 'Please specify a template pack name.' if template_pack_name.nil? || template_pack_name.empty? # rubocop:disable Style/SignalException
|
27
27
|
fail "A folder with name '#{template_pack_name}' already exists." if Dir.exist? path_name # rubocop:disable Style/SignalException
|
28
28
|
|
29
29
|
Dir.mkdir path_name
|
@@ -0,0 +1,26 @@
|
|
1
|
+
template_name: Hello World Template
|
2
|
+
output_file_name: '#{Time.now.year}_hello_world.pdf'
|
3
|
+
textual_description: |
|
4
|
+
This is your first _Indoctrinatr_ template. You can use _Textile_ syntax here to *highlight* important information.
|
5
|
+
|
6
|
+
Edit this template as you like. Read more at https://github.com/dkd/indoctrinatr.
|
7
|
+
fields:
|
8
|
+
-
|
9
|
+
name: variable1
|
10
|
+
label: Who is it?
|
11
|
+
presentation: text
|
12
|
+
default_value: "World"
|
13
|
+
description: "The first variable"
|
14
|
+
-
|
15
|
+
name: date
|
16
|
+
label: Date
|
17
|
+
presentation: date
|
18
|
+
default_value: '#{Time.now.year}-#{Time.now.month}-#{Time.now.day}'
|
19
|
+
-
|
20
|
+
name: variable2
|
21
|
+
label: Type of World
|
22
|
+
required: "true"
|
23
|
+
presentation: dropdown
|
24
|
+
default_value: "not enough"
|
25
|
+
available_options: "not enough, beautiful, your oyster, a template"
|
26
|
+
description: "The second variable. The description name can be very long and should adequately describe what the variable is for etc. pp."
|
@@ -0,0 +1,15 @@
|
|
1
|
+
% This is the official Indoctrinatr "Hello World Template".
|
2
|
+
\documentclass{article}
|
3
|
+
|
4
|
+
\begin{document}
|
5
|
+
\section{Hello <%= variable1 -%>}
|
6
|
+
|
7
|
+
The <%= variable1 -%> is <%= variable2 -%>!
|
8
|
+
|
9
|
+
Today is \textbf{<%= date -%>}.
|
10
|
+
|
11
|
+
% This is is the raw, unescaped input of \texttt{variable1}:
|
12
|
+
\begin{verbatim}
|
13
|
+
<%= raw_variable1 -%>
|
14
|
+
\end{verbatim}
|
15
|
+
\end{document}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: indoctrinatr-tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicolai Reuschling
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-05-
|
12
|
+
date: 2016-05-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '1.
|
20
|
+
version: '1.10'
|
21
21
|
type: :development
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: '1.
|
27
|
+
version: '1.10'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rake
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -208,6 +208,7 @@ files:
|
|
208
208
|
- ".rubocop.yml"
|
209
209
|
- ".rvmrc"
|
210
210
|
- ".travis.yml"
|
211
|
+
- CHANGELOG.md
|
211
212
|
- Gemfile
|
212
213
|
- LICENSE
|
213
214
|
- README.md
|
@@ -226,6 +227,7 @@ files:
|
|
226
227
|
- features/parse.feature
|
227
228
|
- features/pdf.feature
|
228
229
|
- features/pdf_keepauxfiles.feature
|
230
|
+
- features/pdf_with_timestamp.feature
|
229
231
|
- features/scaffold.feature
|
230
232
|
- features/step_definitions/common.rb
|
231
233
|
- features/step_definitions/indoctrinatr_cli.rb
|
@@ -262,6 +264,8 @@ files:
|
|
262
264
|
- lib/indoctrinatr/tools/template_pack_scaffold.rb
|
263
265
|
- lib/indoctrinatr/tools/version.rb
|
264
266
|
- lib/redcloth_latex_formatter_patch/patch.rb
|
267
|
+
- spec/fixtures/test/configuration.yaml
|
268
|
+
- spec/fixtures/test/test.tex.erb
|
265
269
|
- spec/indoctrinatr/templates/configuration_file_spec.rb
|
266
270
|
- spec/indoctrinatr/templates/tex_file_spec.rb
|
267
271
|
- spec/indoctrinatr/tools/textile_support_spec.rb
|
@@ -289,7 +293,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
289
293
|
requirements:
|
290
294
|
- LaTeX development enviroment
|
291
295
|
rubyforge_project:
|
292
|
-
rubygems_version: 2.
|
296
|
+
rubygems_version: 2.4.8
|
293
297
|
signing_key:
|
294
298
|
specification_version: 4
|
295
299
|
summary: indoctrinatr-tools provides a set of command line tools for Indoctrinatr
|
@@ -306,12 +310,15 @@ test_files:
|
|
306
310
|
- features/parse.feature
|
307
311
|
- features/pdf.feature
|
308
312
|
- features/pdf_keepauxfiles.feature
|
313
|
+
- features/pdf_with_timestamp.feature
|
309
314
|
- features/scaffold.feature
|
310
315
|
- features/step_definitions/common.rb
|
311
316
|
- features/step_definitions/indoctrinatr_cli.rb
|
312
317
|
- features/support/env.rb
|
313
318
|
- features/version.feature
|
314
319
|
- features/workflow.feature
|
320
|
+
- spec/fixtures/test/configuration.yaml
|
321
|
+
- spec/fixtures/test/test.tex.erb
|
315
322
|
- spec/indoctrinatr/templates/configuration_file_spec.rb
|
316
323
|
- spec/indoctrinatr/templates/tex_file_spec.rb
|
317
324
|
- spec/indoctrinatr/tools/textile_support_spec.rb
|