teuton 2.1.9 → 2.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +15 -12
- data/bin/check_teuton +0 -2
- data/docs/changelog/ideas.md +132 -0
- data/docs/changelog/v2.1.md +14 -122
- data/docs/changelog/v2.2.md +52 -28
- data/docs/changelog/version2.1.md +4 -0
- data/docs/commands/README.md +58 -15
- data/docs/commands/example_check.md +0 -4
- data/docs/commands/example_run.md +0 -4
- data/docs/dsl/README.md +1 -1
- data/docs/dsl/definition/result.md +1 -0
- data/docs/dsl/definition/run_remote.md +12 -6
- data/docs/dsl/definition/target.md +9 -10
- data/docs/dsl/execution/export.md +27 -20
- data/docs/install/README.md +13 -18
- data/docs/install/vagrant_docker.md +1 -1
- data/docs/learn/README.md +8 -8
- data/docs/learn/example-01-target.md +25 -25
- data/docs/learn/example-02-config.md +38 -49
- data/docs/learn/example-03-remote-hosts.md +22 -22
- data/docs/learn/{example-11-first-test.md → example-04-new-test.md} +23 -24
- data/docs/learn/{example-04-use.md → example-05-use.md} +6 -6
- data/docs/learn/{example-05-debug.md → example-06-debug.md} +8 -8
- data/docs/learn/{example-06-log.md → example-07-log.md} +7 -7
- data/docs/learn/example-08-readme.md +59 -0
- data/docs/learn/example-09-preserve.md +41 -0
- data/docs/videos.md +19 -0
- data/lib/teuton/application.rb +22 -3
- data/lib/teuton/case_manager/case/builtin/main.rb +3 -19
- data/lib/teuton/case_manager/case/builtin/package.rb +7 -6
- data/lib/teuton/case_manager/case/builtin/service.rb +9 -8
- data/lib/teuton/case_manager/case/builtin/teuton_file.rb +28 -0
- data/lib/teuton/case_manager/case/builtin/teuton_host.rb +31 -0
- data/lib/teuton/case_manager/case/builtin/user.rb +8 -7
- data/lib/teuton/case_manager/case/case.rb +1 -1
- data/lib/teuton/case_manager/case/dsl/goto.rb +2 -2
- data/lib/teuton/case_manager/case/dsl/log.rb +1 -1
- data/lib/teuton/case_manager/case/dsl/macro.rb +4 -1
- data/lib/teuton/case_manager/case/dsl/send.rb +2 -1
- data/lib/teuton/case_manager/case/play.rb +2 -0
- data/lib/teuton/case_manager/case/result/ext_compare.rb +16 -0
- data/lib/teuton/case_manager/case/result/result.rb +1 -1
- data/lib/teuton/case_manager/case/runner.rb +30 -4
- data/lib/teuton/case_manager/case_manager.rb +1 -1
- data/lib/teuton/case_manager/dsl.rb +10 -0
- data/lib/teuton/case_manager/export_manager.rb +24 -5
- data/lib/teuton/case_manager/utils.rb +1 -1
- data/lib/teuton/{project/laboratory → check}/builtin.rb +0 -0
- data/lib/teuton/{project/laboratory → check}/dsl.rb +40 -28
- data/lib/teuton/{project/laboratory → check}/laboratory.rb +3 -8
- data/lib/teuton/{project/laboratory → check}/show.rb +53 -59
- data/lib/teuton/cli.rb +85 -14
- data/lib/teuton/{project/readme → readme}/dsl.rb +0 -0
- data/lib/teuton/{project/readme → readme}/lang.rb +1 -1
- data/lib/teuton/{project/readme → readme}/readme.rb +22 -18
- data/lib/teuton/report/formatter/array_formatter.rb +13 -1
- data/lib/teuton/report/formatter/base_formatter.rb +18 -5
- data/lib/teuton/{project/skeleton.rb → skeleton.rb} +8 -20
- data/lib/teuton/utils/configfile_reader.rb +121 -0
- data/lib/teuton/{project → utils}/name_file_finder.rb +46 -26
- data/lib/teuton/version.rb +8 -0
- data/lib/teuton.rb +39 -32
- metadata +109 -61
- data/lib/teuton/case_manager/case/dsl/deprecated.rb +0 -14
- data/lib/teuton/cli/check.rb +0 -38
- data/lib/teuton/cli/main.rb +0 -6
- data/lib/teuton/cli/play.rb +0 -38
- data/lib/teuton/cli/readme.rb +0 -26
- data/lib/teuton/cli/version.rb +0 -12
- data/lib/teuton/project/configfile_reader.rb +0 -49
- data/lib/teuton/project/project.rb +0 -80
metadata
CHANGED
@@ -1,29 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: teuton
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Vargas Ruiz
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-05-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: colorize
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 0.8.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 0.8.1
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rainbow
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '3.0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '3.0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: net-sftp
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -44,14 +58,14 @@ dependencies:
|
|
44
58
|
requirements:
|
45
59
|
- - "~>"
|
46
60
|
- !ruby/object:Gem::Version
|
47
|
-
version: '5.
|
61
|
+
version: '5.0'
|
48
62
|
type: :runtime
|
49
63
|
prerelease: false
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
66
|
- - "~>"
|
53
67
|
- !ruby/object:Gem::Version
|
54
|
-
version: '5.
|
68
|
+
version: '5.0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: net-telnet
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -67,19 +81,33 @@ dependencies:
|
|
67
81
|
- !ruby/object:Gem::Version
|
68
82
|
version: '0.1'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
84
|
+
name: os
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
72
86
|
requirements:
|
73
87
|
- - "~>"
|
74
88
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
89
|
+
version: '1.1'
|
76
90
|
type: :runtime
|
77
91
|
prerelease: false
|
78
92
|
version_requirements: !ruby/object:Gem::Requirement
|
79
93
|
requirements:
|
80
94
|
- - "~>"
|
81
95
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
96
|
+
version: '1.1'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: json_pure
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '2.2'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '2.2'
|
83
111
|
- !ruby/object:Gem::Dependency
|
84
112
|
name: thor
|
85
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -136,6 +164,20 @@ dependencies:
|
|
136
164
|
- - "~>"
|
137
165
|
- !ruby/object:Gem::Version
|
138
166
|
version: '0.74'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: yard
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - "~>"
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0.9'
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - "~>"
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0.9'
|
139
181
|
description: |2
|
140
182
|
Intrastructure test, useful for:
|
141
183
|
(1) Sysadmin teachers to evaluate students remote machines.
|
@@ -153,42 +195,47 @@ extensions: []
|
|
153
195
|
extra_rdoc_files:
|
154
196
|
- README.md
|
155
197
|
- LICENSE
|
156
|
-
- docs/learn/example-03-remote-hosts.md
|
157
|
-
- docs/learn/example-05-debug.md
|
158
|
-
- docs/learn/example-02-config.md
|
159
|
-
- docs/learn/example-11-first-test.md
|
160
|
-
- docs/learn/videos.md
|
161
|
-
- docs/learn/example-06-log.md
|
162
|
-
- docs/learn/example-04-use.md
|
163
|
-
- docs/learn/example-01-target.md
|
164
|
-
- docs/learn/README.md
|
165
|
-
- docs/changelog/v2.1.md
|
166
|
-
- docs/changelog/v2.2.md
|
167
|
-
- docs/changelog/contributions.md
|
168
|
-
- docs/changelog/servidor-de-retos.md
|
169
|
-
- docs/changelog/v2.0.md
|
170
|
-
- docs/commands/example_run.md
|
171
198
|
- docs/commands/README.md
|
172
199
|
- docs/commands/example_check.md
|
200
|
+
- docs/commands/example_run.md
|
201
|
+
- docs/learn/README.md
|
202
|
+
- docs/learn/example-01-target.md
|
203
|
+
- docs/learn/example-02-config.md
|
204
|
+
- docs/learn/example-03-remote-hosts.md
|
205
|
+
- docs/learn/example-04-new-test.md
|
206
|
+
- docs/learn/example-05-use.md
|
207
|
+
- docs/learn/example-06-debug.md
|
208
|
+
- docs/learn/example-07-log.md
|
209
|
+
- docs/learn/example-08-readme.md
|
210
|
+
- docs/learn/example-09-preserve.md
|
211
|
+
- docs/learn/videos.md
|
212
|
+
- docs/dsl/README.md
|
213
|
+
- docs/dsl/setting/get.md
|
214
|
+
- docs/dsl/setting/set.md
|
173
215
|
- docs/dsl/definition/result.md
|
174
|
-
- docs/dsl/definition/target.md
|
175
|
-
- docs/dsl/definition/group.md
|
176
216
|
- docs/dsl/definition/expect.md
|
177
|
-
- docs/dsl/definition/
|
217
|
+
- docs/dsl/definition/group.md
|
178
218
|
- docs/dsl/definition/run_remote.md
|
219
|
+
- docs/dsl/definition/run_local.md
|
220
|
+
- docs/dsl/definition/target.md
|
179
221
|
- docs/dsl/execution/export.md
|
180
222
|
- docs/dsl/execution/play.md
|
181
223
|
- docs/dsl/execution/send.md
|
182
224
|
- docs/dsl/execution/show.md
|
183
|
-
- docs/dsl/setting/set.md
|
184
|
-
- docs/dsl/setting/get.md
|
185
|
-
- docs/dsl/README.md
|
186
225
|
- docs/Challenge-Server-Project.md
|
187
|
-
- docs/
|
188
|
-
- docs/install/vagrant_docker.md
|
189
|
-
- docs/install/scripts.md
|
226
|
+
- docs/videos.md
|
190
227
|
- docs/install/README.md
|
191
228
|
- docs/install/manual.md
|
229
|
+
- docs/install/modes_of_use.md
|
230
|
+
- docs/install/scripts.md
|
231
|
+
- docs/install/vagrant_docker.md
|
232
|
+
- docs/changelog/v2.2.md
|
233
|
+
- docs/changelog/v2.0.md
|
234
|
+
- docs/changelog/servidor-de-retos.md
|
235
|
+
- docs/changelog/contributions.md
|
236
|
+
- docs/changelog/v2.1.md
|
237
|
+
- docs/changelog/ideas.md
|
238
|
+
- docs/changelog/version2.1.md
|
192
239
|
files:
|
193
240
|
- LICENSE
|
194
241
|
- README.md
|
@@ -196,10 +243,12 @@ files:
|
|
196
243
|
- bin/teuton
|
197
244
|
- docs/Challenge-Server-Project.md
|
198
245
|
- docs/changelog/contributions.md
|
246
|
+
- docs/changelog/ideas.md
|
199
247
|
- docs/changelog/servidor-de-retos.md
|
200
248
|
- docs/changelog/v2.0.md
|
201
249
|
- docs/changelog/v2.1.md
|
202
250
|
- docs/changelog/v2.2.md
|
251
|
+
- docs/changelog/version2.1.md
|
203
252
|
- docs/commands/README.md
|
204
253
|
- docs/commands/example_check.md
|
205
254
|
- docs/commands/example_run.md
|
@@ -225,21 +274,25 @@ files:
|
|
225
274
|
- docs/learn/example-01-target.md
|
226
275
|
- docs/learn/example-02-config.md
|
227
276
|
- docs/learn/example-03-remote-hosts.md
|
228
|
-
- docs/learn/example-04-
|
229
|
-
- docs/learn/example-05-
|
230
|
-
- docs/learn/example-06-
|
231
|
-
- docs/learn/example-
|
277
|
+
- docs/learn/example-04-new-test.md
|
278
|
+
- docs/learn/example-05-use.md
|
279
|
+
- docs/learn/example-06-debug.md
|
280
|
+
- docs/learn/example-07-log.md
|
281
|
+
- docs/learn/example-08-readme.md
|
282
|
+
- docs/learn/example-09-preserve.md
|
232
283
|
- docs/learn/videos.md
|
284
|
+
- docs/videos.md
|
233
285
|
- lib/teuton.rb
|
234
286
|
- lib/teuton/application.rb
|
235
287
|
- lib/teuton/case_manager/case/builtin/main.rb
|
236
288
|
- lib/teuton/case_manager/case/builtin/package.rb
|
237
289
|
- lib/teuton/case_manager/case/builtin/service.rb
|
290
|
+
- lib/teuton/case_manager/case/builtin/teuton_file.rb
|
291
|
+
- lib/teuton/case_manager/case/builtin/teuton_host.rb
|
238
292
|
- lib/teuton/case_manager/case/builtin/user.rb
|
239
293
|
- lib/teuton/case_manager/case/case.rb
|
240
294
|
- lib/teuton/case_manager/case/close.rb
|
241
295
|
- lib/teuton/case_manager/case/config.rb
|
242
|
-
- lib/teuton/case_manager/case/dsl/deprecated.rb
|
243
296
|
- lib/teuton/case_manager/case/dsl/expect.rb
|
244
297
|
- lib/teuton/case_manager/case/dsl/getset.rb
|
245
298
|
- lib/teuton/case_manager/case/dsl/goto.rb
|
@@ -265,28 +318,19 @@ files:
|
|
265
318
|
- lib/teuton/case_manager/report.rb
|
266
319
|
- lib/teuton/case_manager/show.rb
|
267
320
|
- lib/teuton/case_manager/utils.rb
|
321
|
+
- lib/teuton/check/builtin.rb
|
322
|
+
- lib/teuton/check/dsl.rb
|
323
|
+
- lib/teuton/check/laboratory.rb
|
324
|
+
- lib/teuton/check/show.rb
|
268
325
|
- lib/teuton/cli.rb
|
269
|
-
- lib/teuton/cli/check.rb
|
270
|
-
- lib/teuton/cli/main.rb
|
271
|
-
- lib/teuton/cli/play.rb
|
272
|
-
- lib/teuton/cli/readme.rb
|
273
|
-
- lib/teuton/cli/version.rb
|
274
326
|
- lib/teuton/files/README.md
|
275
327
|
- lib/teuton/files/config.yaml
|
276
328
|
- lib/teuton/files/start.rb
|
277
329
|
- lib/teuton/files/template/case.html
|
278
330
|
- lib/teuton/files/template/resume.html
|
279
|
-
- lib/teuton/
|
280
|
-
- lib/teuton/
|
281
|
-
- lib/teuton/
|
282
|
-
- lib/teuton/project/laboratory/laboratory.rb
|
283
|
-
- lib/teuton/project/laboratory/show.rb
|
284
|
-
- lib/teuton/project/name_file_finder.rb
|
285
|
-
- lib/teuton/project/project.rb
|
286
|
-
- lib/teuton/project/readme/dsl.rb
|
287
|
-
- lib/teuton/project/readme/lang.rb
|
288
|
-
- lib/teuton/project/readme/readme.rb
|
289
|
-
- lib/teuton/project/skeleton.rb
|
331
|
+
- lib/teuton/readme/dsl.rb
|
332
|
+
- lib/teuton/readme/lang.rb
|
333
|
+
- lib/teuton/readme/readme.rb
|
290
334
|
- lib/teuton/report/close.rb
|
291
335
|
- lib/teuton/report/formatter/array_formatter.rb
|
292
336
|
- lib/teuton/report/formatter/base_formatter.rb
|
@@ -307,12 +351,16 @@ files:
|
|
307
351
|
- lib/teuton/report/formatter/yaml_formatter.rb
|
308
352
|
- lib/teuton/report/report.rb
|
309
353
|
- lib/teuton/report/show.rb
|
354
|
+
- lib/teuton/skeleton.rb
|
355
|
+
- lib/teuton/utils/configfile_reader.rb
|
356
|
+
- lib/teuton/utils/name_file_finder.rb
|
310
357
|
- lib/teuton/utils/verbose.rb
|
311
|
-
|
358
|
+
- lib/teuton/version.rb
|
359
|
+
homepage: https://github.com/teuton-software/teuton
|
312
360
|
licenses:
|
313
361
|
- GPL-3.0
|
314
362
|
metadata: {}
|
315
|
-
post_install_message:
|
363
|
+
post_install_message:
|
316
364
|
rdoc_options: []
|
317
365
|
require_paths:
|
318
366
|
- lib
|
@@ -320,15 +368,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
320
368
|
requirements:
|
321
369
|
- - ">="
|
322
370
|
- !ruby/object:Gem::Version
|
323
|
-
version: 2.5.
|
371
|
+
version: 2.5.9
|
324
372
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
325
373
|
requirements:
|
326
374
|
- - ">="
|
327
375
|
- !ruby/object:Gem::Version
|
328
376
|
version: '0'
|
329
377
|
requirements: []
|
330
|
-
rubygems_version: 3.1.
|
331
|
-
signing_key:
|
378
|
+
rubygems_version: 3.1.6
|
379
|
+
signing_key:
|
332
380
|
specification_version: 4
|
333
381
|
summary: Teuton (Teuton Software)
|
334
382
|
test_files: []
|
@@ -1,14 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# DSL#request, DSL#target2
|
4
|
-
module DSL
|
5
|
-
def request(text)
|
6
|
-
raise "Deprecated request #{text}"
|
7
|
-
# do nothing by now
|
8
|
-
end
|
9
|
-
|
10
|
-
def command(p_command, args = {})
|
11
|
-
@action[:command] = p_command
|
12
|
-
tempfile(args[:tempfile]) if args[:tempfile]
|
13
|
-
end
|
14
|
-
end
|
data/lib/teuton/cli/check.rb
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# CLI#test
|
4
|
-
class CLI < Thor
|
5
|
-
map ['t', '-t', '--test', 'test'] => 'check'
|
6
|
-
option :c, type: :boolean
|
7
|
-
option :cname, type: :string
|
8
|
-
option :cpath, type: :string
|
9
|
-
desc 'check [OPTIONS] DIRECTORY',
|
10
|
-
'Test or check challenge contents'
|
11
|
-
long_desc <<-LONGDESC
|
12
|
-
|
13
|
-
(1) teuton test path/to/dir/foo
|
14
|
-
, Test content of start.rb and config.yaml files.
|
15
|
-
|
16
|
-
(2) teuton test path/to/dir/foo -c
|
17
|
-
, Only test CONFIG information from config.yaml.
|
18
|
-
|
19
|
-
(3) teuton test path/to/dir/foo --cname=demo
|
20
|
-
, Test content of start.rb and demo.yaml files.
|
21
|
-
|
22
|
-
(4) teuton test path/to/file/foo.rb
|
23
|
-
, Test content of foo.rb and foo.yaml files.
|
24
|
-
|
25
|
-
(5) teuton test path/to/file/foo.rb -c
|
26
|
-
, Only test CONFIG information from foo.yaml.
|
27
|
-
|
28
|
-
(6) teuton test path/to/file/foo.rb --cname=demo
|
29
|
-
, Test content of foo.rb and demo.yaml files.
|
30
|
-
|
31
|
-
LONGDESC
|
32
|
-
##
|
33
|
-
# Verify or test Teuton test units syntax
|
34
|
-
# @param path_to_rb_file [String] Route to main rb Teuton file
|
35
|
-
def check(path_to_rb_file)
|
36
|
-
Project.check(path_to_rb_file, options)
|
37
|
-
end
|
38
|
-
end
|
data/lib/teuton/cli/main.rb
DELETED
data/lib/teuton/cli/play.rb
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# CLI#play
|
4
|
-
class CLI < Thor
|
5
|
-
map ['p', '-p', 'play', '--play', '--run', 'run'] => 'play'
|
6
|
-
option :export, type: :string
|
7
|
-
option :cname, type: :string
|
8
|
-
option :cpath, type: :string
|
9
|
-
option :case, type: :string
|
10
|
-
option :color, type: :boolean
|
11
|
-
option :quiet, type: :boolean
|
12
|
-
desc '[run] [OPTIONS] DIRECTORY',
|
13
|
-
'Run challenge from directory'
|
14
|
-
long_desc <<-LONGDESC
|
15
|
-
This function execute challenge from specified directory.
|
16
|
-
By default, show progress on the screen.
|
17
|
-
|
18
|
-
Let's see others options:
|
19
|
-
|
20
|
-
(1) teuton foo, run challenge from foo/start.rb with foo/config.yaml config file.
|
21
|
-
|
22
|
-
(2) teuton play foo, same as (1).
|
23
|
-
|
24
|
-
(3) teuton play --export=json foo, run challenge and export using json format.
|
25
|
-
Others output formats availables are: txt, colored_text, json, yaml.
|
26
|
-
|
27
|
-
(4) teuton play --cname=demo foo, run challenge from foo/start.rb with foo/demo.yaml config file.
|
28
|
-
|
29
|
-
(5) teuton foo/demo.rb, Run challenge from foo/demo.rb with foo/demo.yaml config file.
|
30
|
-
|
31
|
-
LONGDESC
|
32
|
-
##
|
33
|
-
# Execute Teuton test unit
|
34
|
-
# @param filepath [String] Route to main: rb file or folder
|
35
|
-
def play(filepath)
|
36
|
-
Project.play(filepath, options)
|
37
|
-
end
|
38
|
-
end
|
data/lib/teuton/cli/readme.rb
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# CLI#readme
|
4
|
-
class CLI < Thor
|
5
|
-
map ['--readme'] => 'readme'
|
6
|
-
option :lang, type: :string
|
7
|
-
desc 'readme DIRECTORY',
|
8
|
-
'Create README.md file from challenge contents'
|
9
|
-
long_desc <<-LONGDESC
|
10
|
-
|
11
|
-
(1) teuton readme foo
|
12
|
-
, Create README.md from foo/start.rb.
|
13
|
-
|
14
|
-
(2) teuton readme foo/demo.rb
|
15
|
-
, Create README.md from foo/demo.rb.
|
16
|
-
|
17
|
-
By default lang=es, but It's available lang=en too.
|
18
|
-
|
19
|
-
LONGDESC
|
20
|
-
##
|
21
|
-
# Create README from teuton test
|
22
|
-
# @param path_to_rb_file [String] Route to main rb Teuton file
|
23
|
-
def readme(path_to_rb_file)
|
24
|
-
Project.readme(path_to_rb_file, options)
|
25
|
-
end
|
26
|
-
end
|
data/lib/teuton/cli/version.rb
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Class method Teuton#version
|
4
|
-
class CLI < Thor
|
5
|
-
map ['v', '-v', '--version'] => 'version'
|
6
|
-
desc 'version', 'Show the program version'
|
7
|
-
##
|
8
|
-
# Display version
|
9
|
-
def version
|
10
|
-
puts "#{Application::NAME} (version #{Application::VERSION})"
|
11
|
-
end
|
12
|
-
end
|
@@ -1,49 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'yaml'
|
4
|
-
require 'json/pure'
|
5
|
-
|
6
|
-
# Functions that read data from ConfigFile using formats YAML and JSON
|
7
|
-
# * read
|
8
|
-
# * read_yaml
|
9
|
-
# * read_json
|
10
|
-
module ConfigFileReader
|
11
|
-
def self.read(filepath)
|
12
|
-
unless File.exist?(filepath)
|
13
|
-
data = {}
|
14
|
-
data[:global] = {}
|
15
|
-
data[:alias] = {}
|
16
|
-
data[:cases] = [{ tt_members: 'anonymous' }]
|
17
|
-
return data
|
18
|
-
end
|
19
|
-
return read_yaml(filepath) if File.extname(filepath) == '.yaml'
|
20
|
-
|
21
|
-
return read_json(filepath) if File.extname(filepath) == '.json'
|
22
|
-
|
23
|
-
raise "[ERROR] ConfigFileReader: #{filepath}"
|
24
|
-
end
|
25
|
-
|
26
|
-
def self.read_yaml(filepath)
|
27
|
-
begin
|
28
|
-
data = YAML.load(File.open(filepath))
|
29
|
-
rescue StandardError => e
|
30
|
-
puts "\n" + ('=' * 80)
|
31
|
-
puts "[ERROR] ConfigFileReader#read <#{filepath}>"
|
32
|
-
puts ' I suggest to revise file format!'
|
33
|
-
puts " #{e.message}\n" + ('=' * 80)
|
34
|
-
raise "[ERROR] ConfigFileReader <#{e}>"
|
35
|
-
end
|
36
|
-
data[:global] = data[:global] || {}
|
37
|
-
data[:alias] = data[:alias] || {}
|
38
|
-
data[:cases] = data[:cases] || []
|
39
|
-
data
|
40
|
-
end
|
41
|
-
|
42
|
-
def self.read_json(filepath)
|
43
|
-
data = JSON.parse(File.read(filepath), symbolize_names: true)
|
44
|
-
data[:global] = data[:global] || {}
|
45
|
-
data[:alias] = data[:alias] || {}
|
46
|
-
data[:cases] = data[:cases] || []
|
47
|
-
data
|
48
|
-
end
|
49
|
-
end
|
@@ -1,80 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative '../application'
|
4
|
-
require_relative 'name_file_finder'
|
5
|
-
|
6
|
-
# Project functions invoked by CLI project tool
|
7
|
-
# * test
|
8
|
-
# * play
|
9
|
-
# * process_input_case_option
|
10
|
-
# * readme
|
11
|
-
# * require_dsl_and_script
|
12
|
-
module Project ##
|
13
|
-
##
|
14
|
-
# Check teuton test syntax
|
15
|
-
# @param projectpath (String) Path to teuton test
|
16
|
-
# @param options (Array) Array of input options
|
17
|
-
def self.check(projectpath, options)
|
18
|
-
Application.instance.options.merge! options
|
19
|
-
NameFileFinder.find_filenames_for(projectpath)
|
20
|
-
NameFileFinder.puts_input_info_on_screen
|
21
|
-
require_dsl_and_script('laboratory/laboratory') # Define DSL keywords
|
22
|
-
|
23
|
-
app = Application.instance
|
24
|
-
lab = Laboratory.new(app.script_path, app.config_path)
|
25
|
-
# lab.show_requests if options[:r]
|
26
|
-
lab.show_config if options[:c]
|
27
|
-
lab.show_dsl unless options[:r] || options[:c]
|
28
|
-
end
|
29
|
-
|
30
|
-
##
|
31
|
-
# Run test
|
32
|
-
# @param projectpath (String) Path to teuton test
|
33
|
-
# @param options (Array) Array of input options
|
34
|
-
def self.play(projectpath, options)
|
35
|
-
Application.instance.options.merge! options
|
36
|
-
process_input_options
|
37
|
-
NameFileFinder.find_filenames_for(projectpath)
|
38
|
-
NameFileFinder.puts_input_info_on_screen
|
39
|
-
require_dsl_and_script('../case_manager/dsl') # Define DSL keywords
|
40
|
-
end
|
41
|
-
|
42
|
-
##
|
43
|
-
# Preprocess input options:
|
44
|
-
# * Convert input case options String to an Array of integers
|
45
|
-
# * Read color input option
|
46
|
-
def self.process_input_options
|
47
|
-
options = Application.instance.options
|
48
|
-
options['color'] = true if options['color'].nil?
|
49
|
-
Rainbow.enabled = options['color']
|
50
|
-
return if options['case'].nil?
|
51
|
-
|
52
|
-
a = options['case'].split(',')
|
53
|
-
options['case'] = a.collect!(&:to_i)
|
54
|
-
end
|
55
|
-
|
56
|
-
##
|
57
|
-
# Create Readme file for a test
|
58
|
-
# @param projectpath (String) Path to teuton test
|
59
|
-
# @param options (Array) Array of input options
|
60
|
-
def self.readme(projectpath, options)
|
61
|
-
Application.instance.options.merge! options
|
62
|
-
NameFileFinder.find_filenames_for(projectpath)
|
63
|
-
require_dsl_and_script('readme/readme') # Define DSL keywords
|
64
|
-
|
65
|
-
app = Application.instance
|
66
|
-
readme = Readme.new(app.script_path, app.config_path)
|
67
|
-
readme.show
|
68
|
-
end
|
69
|
-
|
70
|
-
def self.require_dsl_and_script(dslpath)
|
71
|
-
app = Application.instance
|
72
|
-
require_relative dslpath
|
73
|
-
begin
|
74
|
-
require_relative app.script_path
|
75
|
-
rescue SyntaxError => e
|
76
|
-
puts e.to_s
|
77
|
-
puts Rainbow.new("[ERROR] SyntaxError into file #{app.script_path}").red
|
78
|
-
end
|
79
|
-
end
|
80
|
-
end
|