teuton 2.3.5 → 2.3.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -5
  3. data/bin/teuton +1 -1
  4. data/docs/CHANGELOG.md +8 -0
  5. data/docs/changelog/v2.4.md +16 -0
  6. data/docs/dsl/definition/expect.md +11 -7
  7. data/docs/dsl/definition/result.md +7 -6
  8. data/docs/dsl/definition/run_local.md +0 -1
  9. data/docs/dsl/definition/target.md +1 -1
  10. data/docs/dsl/execution/export.md +14 -16
  11. data/docs/dsl/execution/send.md +12 -12
  12. data/docs/dsl/setting/get.md +5 -5
  13. data/docs/es/exit_code.md +59 -0
  14. data/docs/es/guess_os.md +28 -0
  15. data/docs/{Challenge-Server-Project.md → ideas/Challenge-Server-Project.md} +0 -0
  16. data/docs/{changelog → ideas}/contributions.md +0 -0
  17. data/docs/{changelog → ideas}/ideas.md +0 -0
  18. data/docs/{changelog → ideas}/servidor-de-retos.md +0 -0
  19. data/docs/learn/{example-01-target.md → 01-target.md} +1 -3
  20. data/docs/learn/{example-02-config.md → 02-config.md} +1 -3
  21. data/docs/learn/{example-03-remote-hosts.md → 03-remote_hosts.md} +10 -10
  22. data/docs/learn/{example-04-new-test.md → 04-new_test.md} +8 -16
  23. data/docs/learn/{example-05-use.md → 05-use.md} +1 -3
  24. data/docs/learn/{example-06-debug.md → 06-debug.md} +1 -3
  25. data/docs/learn/{example-07-log.md → 07-log.md} +1 -3
  26. data/docs/learn/{example-08-readme.md → 08-readme.md} +1 -3
  27. data/docs/learn/{example-09-preserve.md → 09-preserve.md} +7 -4
  28. data/docs/learn/10-result.md +36 -0
  29. data/docs/learn/11-moodle_id.md +19 -0
  30. data/docs/learn/12-get_vars.md +37 -0
  31. data/docs/learn/13-include.md +59 -0
  32. data/docs/learn/16-exit_codes.md +24 -0
  33. data/docs/learn/README.md +19 -17
  34. data/lib/teuton/application.rb +24 -17
  35. data/lib/teuton/case_manager/case/builtin/main.rb +2 -3
  36. data/lib/teuton/case_manager/case/builtin/package.rb +2 -3
  37. data/lib/teuton/case_manager/case/builtin/service.rb +4 -5
  38. data/lib/teuton/case_manager/case/builtin/teuton_file.rb +3 -4
  39. data/lib/teuton/case_manager/case/builtin/teuton_host.rb +5 -6
  40. data/lib/teuton/case_manager/case/builtin/user.rb +1 -2
  41. data/lib/teuton/case_manager/case/case.rb +27 -27
  42. data/lib/teuton/case_manager/case/close.rb +2 -2
  43. data/lib/teuton/case_manager/case/config.rb +14 -14
  44. data/lib/teuton/case_manager/case/dsl/expect.rb +46 -39
  45. data/lib/teuton/case_manager/case/dsl/goto.rb +2 -2
  46. data/lib/teuton/case_manager/case/dsl/log.rb +5 -6
  47. data/lib/teuton/case_manager/case/dsl/macro.rb +11 -7
  48. data/lib/teuton/case_manager/case/dsl/main.rb +8 -8
  49. data/lib/teuton/case_manager/case/dsl/send.rb +12 -14
  50. data/lib/teuton/case_manager/case/dsl/unique.rb +1 -3
  51. data/lib/teuton/case_manager/case/main.rb +5 -5
  52. data/lib/teuton/case_manager/case/play.rb +1 -1
  53. data/lib/teuton/case_manager/case/result/ext_array.rb +9 -9
  54. data/lib/teuton/case_manager/case/result/ext_compare.rb +44 -58
  55. data/lib/teuton/case_manager/case/result/ext_filter.rb +20 -8
  56. data/lib/teuton/case_manager/case/result/result.rb +19 -18
  57. data/lib/teuton/case_manager/case/runner.rb +53 -60
  58. data/lib/teuton/case_manager/case_manager.rb +15 -15
  59. data/lib/teuton/case_manager/check_cases.rb +1 -4
  60. data/lib/teuton/case_manager/dsl.rb +5 -5
  61. data/lib/teuton/case_manager/export_manager.rb +8 -19
  62. data/lib/teuton/case_manager/hall_of_fame.rb +4 -6
  63. data/lib/teuton/case_manager/main.rb +4 -5
  64. data/lib/teuton/case_manager/report.rb +21 -16
  65. data/lib/teuton/case_manager/show.rb +2 -2
  66. data/lib/teuton/case_manager/utils.rb +13 -14
  67. data/lib/teuton/check/builtin.rb +5 -1
  68. data/lib/teuton/check/dsl.rb +10 -11
  69. data/lib/teuton/check/laboratory.rb +13 -15
  70. data/lib/teuton/check/show.rb +33 -35
  71. data/lib/teuton/cli.rb +31 -35
  72. data/lib/teuton/files/start.rb +3 -6
  73. data/lib/teuton/readme/dsl.rb +12 -6
  74. data/lib/teuton/readme/lang.rb +20 -21
  75. data/lib/teuton/readme/readme.rb +40 -42
  76. data/lib/teuton/report/close.rb +1 -8
  77. data/lib/teuton/report/formatter/array_formatter.rb +28 -39
  78. data/lib/teuton/report/formatter/base_formatter.rb +2 -13
  79. data/lib/teuton/report/formatter/csv_formatter.rb +12 -18
  80. data/lib/teuton/report/formatter/formatter_factory.rb +31 -29
  81. data/lib/teuton/report/formatter/html_formatter.rb +37 -21
  82. data/lib/teuton/report/formatter/json_formatter.rb +2 -8
  83. data/lib/teuton/report/formatter/list_formatter.rb +6 -12
  84. data/lib/teuton/report/formatter/moodle_csv_formatter.rb +3 -6
  85. data/lib/teuton/report/formatter/resume_array_formatter.rb +1 -1
  86. data/lib/teuton/report/formatter/resume_html_formatter.rb +29 -19
  87. data/lib/teuton/report/formatter/resume_json_formatter.rb +2 -3
  88. data/lib/teuton/report/formatter/resume_list_formatter.rb +4 -4
  89. data/lib/teuton/report/formatter/resume_txt_formatter.rb +14 -18
  90. data/lib/teuton/report/formatter/resume_yaml_formatter.rb +1 -9
  91. data/lib/teuton/report/formatter/txt_formatter.rb +19 -22
  92. data/lib/teuton/report/formatter/xml_formatter.rb +29 -37
  93. data/lib/teuton/report/formatter/yaml_formatter.rb +2 -12
  94. data/lib/teuton/report/report.rb +10 -10
  95. data/lib/teuton/report/show.rb +14 -33
  96. data/lib/teuton/skeleton.rb +6 -14
  97. data/lib/teuton/utils/configfile_reader.rb +22 -21
  98. data/lib/teuton/utils/name_file_finder.rb +21 -26
  99. data/lib/teuton/utils/verbose.rb +1 -2
  100. data/lib/teuton/version.rb +3 -4
  101. data/lib/teuton.rb +5 -6
  102. metadata +60 -86
  103. data/bin/check_teuton +0 -41
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: teuton
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.5
4
+ version: 2.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Vargas Ruiz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-22 00:00:00.000000000 Z
11
+ date: 2022-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize
@@ -80,20 +80,6 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0.1'
83
- - !ruby/object:Gem::Dependency
84
- name: os
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: '1.1'
90
- type: :runtime
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "~>"
95
- - !ruby/object:Gem::Version
96
- version: '1.1'
97
83
  - !ruby/object:Gem::Dependency
98
84
  name: json_pure
99
85
  requirement: !ruby/object:Gem::Requirement
@@ -142,42 +128,14 @@ dependencies:
142
128
  requirements:
143
129
  - - "~>"
144
130
  - !ruby/object:Gem::Version
145
- version: '5.11'
146
- type: :development
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - "~>"
151
- - !ruby/object:Gem::Version
152
- version: '5.11'
153
- - !ruby/object:Gem::Dependency
154
- name: rubocop
155
- requirement: !ruby/object:Gem::Requirement
156
- requirements:
157
- - - "~>"
158
- - !ruby/object:Gem::Version
159
- version: '0.74'
131
+ version: '5.15'
160
132
  type: :development
161
133
  prerelease: false
162
134
  version_requirements: !ruby/object:Gem::Requirement
163
135
  requirements:
164
136
  - - "~>"
165
137
  - !ruby/object:Gem::Version
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'
138
+ version: '5.15'
181
139
  description: |2
182
140
  Intrastructure test, useful for:
183
141
  (1) Sysadmin teachers to evaluate students remote machines.
@@ -190,64 +148,69 @@ description: |2
190
148
  email: teuton.software@protonmail.com
191
149
  executables:
192
150
  - teuton
193
- - check_teuton
194
151
  extensions: []
195
152
  extra_rdoc_files:
196
153
  - README.md
197
154
  - LICENSE
155
+ - docs/CHANGELOG.md
156
+ - docs/changelog/v2.0.md
157
+ - docs/changelog/v2.1.md
158
+ - docs/changelog/v2.2.md
159
+ - docs/changelog/v2.4.md
160
+ - docs/changelog/version2.1.md
198
161
  - docs/commands/README.md
199
162
  - docs/commands/example_check.md
200
163
  - 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
164
  - docs/dsl/README.md
213
- - docs/dsl/setting/get.md
214
- - docs/dsl/setting/set.md
215
- - docs/dsl/definition/result.md
216
165
  - docs/dsl/definition/expect.md
217
166
  - docs/dsl/definition/group.md
218
- - docs/dsl/definition/run_remote.md
167
+ - docs/dsl/definition/result.md
219
168
  - docs/dsl/definition/run_local.md
169
+ - docs/dsl/definition/run_remote.md
220
170
  - docs/dsl/definition/target.md
221
171
  - docs/dsl/execution/export.md
222
172
  - docs/dsl/execution/play.md
223
173
  - docs/dsl/execution/send.md
224
174
  - docs/dsl/execution/show.md
225
- - docs/Challenge-Server-Project.md
226
- - docs/videos.md
175
+ - docs/dsl/setting/get.md
176
+ - docs/dsl/setting/set.md
177
+ - docs/es/exit_code.md
178
+ - docs/es/guess_os.md
179
+ - docs/ideas/Challenge-Server-Project.md
180
+ - docs/ideas/contributions.md
181
+ - docs/ideas/ideas.md
182
+ - docs/ideas/servidor-de-retos.md
227
183
  - docs/install/README.md
228
184
  - docs/install/manual.md
229
185
  - docs/install/modes_of_use.md
230
186
  - docs/install/scripts.md
231
187
  - 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
188
+ - docs/learn/01-target.md
189
+ - docs/learn/02-config.md
190
+ - docs/learn/03-remote_hosts.md
191
+ - docs/learn/04-new_test.md
192
+ - docs/learn/05-use.md
193
+ - docs/learn/06-debug.md
194
+ - docs/learn/07-log.md
195
+ - docs/learn/08-readme.md
196
+ - docs/learn/09-preserve.md
197
+ - docs/learn/10-result.md
198
+ - docs/learn/11-moodle_id.md
199
+ - docs/learn/12-get_vars.md
200
+ - docs/learn/13-include.md
201
+ - docs/learn/16-exit_codes.md
202
+ - docs/learn/README.md
203
+ - docs/learn/videos.md
204
+ - docs/videos.md
239
205
  files:
240
206
  - LICENSE
241
207
  - README.md
242
- - bin/check_teuton
243
208
  - bin/teuton
244
- - docs/Challenge-Server-Project.md
245
- - docs/changelog/contributions.md
246
- - docs/changelog/ideas.md
247
- - docs/changelog/servidor-de-retos.md
209
+ - docs/CHANGELOG.md
248
210
  - docs/changelog/v2.0.md
249
211
  - docs/changelog/v2.1.md
250
212
  - docs/changelog/v2.2.md
213
+ - docs/changelog/v2.4.md
251
214
  - docs/changelog/version2.1.md
252
215
  - docs/commands/README.md
253
216
  - docs/commands/example_check.md
@@ -265,21 +228,32 @@ files:
265
228
  - docs/dsl/execution/show.md
266
229
  - docs/dsl/setting/get.md
267
230
  - docs/dsl/setting/set.md
231
+ - docs/es/exit_code.md
232
+ - docs/es/guess_os.md
233
+ - docs/ideas/Challenge-Server-Project.md
234
+ - docs/ideas/contributions.md
235
+ - docs/ideas/ideas.md
236
+ - docs/ideas/servidor-de-retos.md
268
237
  - docs/install/README.md
269
238
  - docs/install/manual.md
270
239
  - docs/install/modes_of_use.md
271
240
  - docs/install/scripts.md
272
241
  - docs/install/vagrant_docker.md
242
+ - docs/learn/01-target.md
243
+ - docs/learn/02-config.md
244
+ - docs/learn/03-remote_hosts.md
245
+ - docs/learn/04-new_test.md
246
+ - docs/learn/05-use.md
247
+ - docs/learn/06-debug.md
248
+ - docs/learn/07-log.md
249
+ - docs/learn/08-readme.md
250
+ - docs/learn/09-preserve.md
251
+ - docs/learn/10-result.md
252
+ - docs/learn/11-moodle_id.md
253
+ - docs/learn/12-get_vars.md
254
+ - docs/learn/13-include.md
255
+ - docs/learn/16-exit_codes.md
273
256
  - docs/learn/README.md
274
- - docs/learn/example-01-target.md
275
- - docs/learn/example-02-config.md
276
- - docs/learn/example-03-remote-hosts.md
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
283
257
  - docs/learn/videos.md
284
258
  - docs/videos.md
285
259
  - lib/teuton.rb
@@ -375,7 +349,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
375
349
  - !ruby/object:Gem::Version
376
350
  version: '0'
377
351
  requirements: []
378
- rubygems_version: 3.1.6
352
+ rubygems_version: 3.3.3
379
353
  signing_key:
380
354
  specification_version: 4
381
355
  summary: Teuton (Infrastructure test)
data/bin/check_teuton DELETED
@@ -1,41 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'yaml'
4
-
5
- module CheckTeuton
6
- ##
7
- # Start check_teuton
8
- # @param arg (String) First input argument
9
- def self.start(arg)
10
- show_help if arg.nil? or arg == 'help'
11
- run(arg)
12
- end
13
-
14
- def self.show_help()
15
- puts "check_teuton"
16
- puts " help => Show this help"
17
- puts " PATH/TO/CASE/YAML => Read yaml for Nagios/Icinga"
18
- exit 0
19
- end
20
-
21
- def self.run(filename)
22
- unless File.exist?(filename)
23
- puts "UNKNOWN - File not found! (#{filename})"
24
- exit 3
25
- end
26
- data = YAML.load(File.read(filename))
27
- testname = data[:config][:tt_testname]
28
- grade = data[:results][:grade].to_i
29
- if grade == 100
30
- puts "OK - #{testname}/case-#{data[:results][:case_id]} Grade=100%"
31
- exit 0
32
- elsif grade < 50
33
- puts "CRITICAL - #{testname}/case-#{data[:results][:case_id]} Grade=0%"
34
- exit 2
35
- end
36
- puts "WARNING - #{testname}/case-#{data[:results][:case_id]} Grade=#{grade}%"
37
- exit 1
38
- end
39
- end
40
-
41
- CheckTeuton.start(ARGV[0])