teuton 3.0.0 → 3.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6457f61d7c6f0742818aec1243f33c984290c995f8335dd5ec0eb25a5347d597
4
- data.tar.gz: 492e246083b98fb2359f2a9af92b07beba9dc7182b1f5b8feefc8a243dfde571
3
+ metadata.gz: 93e9ece06ffba48858ef89bfdf6e4e0cddd095d84f6a8fb3de32f1e0c2c713f7
4
+ data.tar.gz: a905a098f5ca254323d6eb1b72c4f9970b39082091cc17075f7c02f23cd87997
5
5
  SHA512:
6
- metadata.gz: d7b9b06aaa49a3c3db146d917ae0e586613ec901e624b41f7aad8d8767a2b32e571f76ac692146590c596de0b9d5c682d9f114da7dac38069ff42696f38f0713
7
- data.tar.gz: 9a667ece87588ea4a48a39a462b8a19267acde5ff8f535302d59acedb790a5d9cf768c646092dd00266bfba2290aa3c987c930a9333f897aadede35169b5d8e4
6
+ metadata.gz: 66f9d13f1526f42dd7d68e5e195e9bd304f152ba3447cdc723ed0f417dd299d848bc6867fcc5b03ef1d0848c541c545571e727fe65ec29782ab6944ec7f8beb1
7
+ data.tar.gz: 8b5e6b841e08a31f2cfbb76b40377b0dd2eaf63b021c458dfe6908ca04a077be6b61fd4a5e27a04e01d5b34fc62ff9a3fa9df1ecff3d207c2b8315a381f956e4
data/README.md CHANGED
@@ -83,33 +83,60 @@ Consult the generated [output files](examples/02-target/output.d/)
83
83
 
84
84
  # Documentation
85
85
 
86
- * Installation
86
+ 1. Installation
87
87
  * [Teuton installation](docs/install/t-node.md)
88
88
  * [SSH/Telnet installation](docs/install/s-node.md)
89
- * Teuton commands
90
- * [teuton config](docs/commands/config.md)
91
- * [teuton check](docs/commands/check.md)
92
- * [teuton help](docs/commands/help.md)
93
- * [teuton new](docs/commands/new.md)
94
- * [teuton readme](docs/commands/readme.md)
95
- * [teuton run](docs/commands/run.md)
96
- * [Learning guide](docs/learn/README.md). Learning to create tests by doing.
97
- * [Learning Examples](examples). The learning guide is based on these examples.
98
- * [Configuration file](docs/config_file.md)
99
- * [DSL - Language reference](docs/dsl/README.md). DSL used to define tests.
100
- * [expect](docs/dsl/expect.md)
101
- * [export](docs/dsl/export.md)
102
- * [get](docs/dsl/get.md)
103
- * [group](docs/dsl/group.md)
104
- * [play](docs/dsl/play.md)
105
- * [result](docs/dsl/result.md)
106
- * [run](docs/dsl/run.md)
107
- * [send](docs/dsl/send.md)
108
- * [set](docs/dsl/set.md)
109
- * [show](docs/dsl/show.md)
110
- * [target](docs/dsl/target.md)
111
- * [Modes of use](docs/modes_of_use.md): Classroom, contest, standalone.
112
- * [Blogs and videos](docs/videos.md)
89
+ 2. Teuton commands
90
+ * [teuton config](docs/commands/config.md): suggest config file.
91
+ * [teuton check](docs/commands/check.md): check test syntax.
92
+ * [teuton help](docs/commands/help.md): show command help.
93
+ * [teuton new](docs/commands/new.md): create new test.
94
+ * [teuton readme](docs/commands/readme.md): generate test documentation.
95
+ * [teuton run](docs/commands/run.md): run test.
96
+ 3. [Learning guide](docs/learn/README.md). Learn writing your own tests. [Examples](examples).
97
+ * [Create NEW test](docs/learn/01-cmd_new.md)
98
+ * [Evaluate TARGET](docs/learn/02-target.md)
99
+ * [Check REMOTE HOSTS](docs/learn/03-remote_hosts.md)
100
+ * [Read CONFIG file](docs/learn/04-config.md)
101
+ * [Use several files](docs/learn/05-use.md)
102
+ * [CHECK test syntax](docs/learn/06-cmd_check.md)
103
+ * [Target WEIGHT](docs/learn/07-target_weight.md)
104
+ * [UNIQUE values](docs/learn/08-unique_values.md)
105
+ * [SEND report copies to remote hosts](docs/learn/09-send.md)
106
+ * [DEBUG results](docs/learn/10-debug.md)
107
+ * [Export other FORMATS](docs/learn/11-export.md)
108
+ * [PRESERVE old reports](docs/learn/12-preserve.md)
109
+ * [Hide FEEDBACK from reports](docs/learn/13-feedback.md)
110
+ * [MOODLE](docs/learn/14-moodle_id.md)
111
+ * [Build README from test](docs/learn/15-readme.md)
112
+ * [INCLUDE more configuration files](docs/learn/16-include.md)
113
+ * [ALIAS](docs/learn/17-alias.md)
114
+ * [LOG messages](docs/learn/18-log.md)
115
+ * [Don't get params, just read vars](docs/learn/19-read_vars.md)
116
+ * [MACROS](docs/learn/20-macros.md)
117
+ * [Checking exit codes](docs/learn/21-exit_codes.md)
118
+ * [RESULT object](docs/learn/22-result.md)
119
+ * [How to test code](docs/learn/23-test-code.md)
120
+ * [How to test SQL and database](docs/learn/24-test-sql.md)
121
+ * [expect vs result](docs/learn/25-expect-result.md) TODO
122
+ * [EXPECT_SEQUENCE](docs/learn/26-expect_sequence.md)
123
+ * [RUN_SCRIPT](docs/learn/27-run_script.md)
124
+ * [UPLOAD](docs/learn/28-upload.md)
125
+ 4. [Configuration file](docs/config_file.md): Reserved params, configure hosts, etc.
126
+ 5. [Language reference](docs/dsl/README.md). DSL used to define tests.
127
+ * [expect](docs/dsl/expect.md): check run output with expectations.
128
+ * [export](docs/dsl/export.md): save evaluation reports.
129
+ * [get](docs/dsl/get.md): read config params.
130
+ * [group](docs/dsl/group.md): group targets.
131
+ * [play](docs/dsl/play.md): starts main execution.
132
+ * [result](docs/dsl/result.md): contains run output.
133
+ * [run](docs/dsl/run.md): execute command on local/remote host.
134
+ * [send](docs/dsl/send.md): send reports into remote machines.
135
+ * [set](docs/dsl/set.md): write new param.
136
+ * [show](docs/dsl/show.md): show progress on screen.
137
+ * [target](docs/dsl/target.md): define new target.
138
+ 6. [Modes of use](docs/modes_of_use.md): Classroom, contest, standalone.
139
+ 7. [More information](docs/more.md)
113
140
 
114
141
  # Contact
115
142
 
data/docs/devel/todo.md CHANGED
@@ -1,125 +1,77 @@
1
1
  [<< back](../../README.md)
2
2
 
3
- # Roadmap Teuton v3.0.0 - 20260209
3
+ # Roadmap Teuton v3.0.0 - 2026
4
4
 
5
- **Cambios menores:**
5
+ # 1. Revisar
6
6
 
7
+ * Revisar (tests): result.grep(a).grep(b)
7
8
  * "Limpiar" las funciones "deprecated"
8
- * Cambiar "teuton readme" por "teuton doc".
9
+ * Aplicar las recomendaciones del informe de seguridad de Andrés.
10
+ * Eliminar/limpiar toda referencia a Vagrant.
11
+ * verify get(:key) and get('key') works fine!
12
+ * Formatter: xml
13
+
14
+ # 2. Documentacion
15
+
16
+ * Nuevo repo `teuton-book`: para documentación, tutoriales en español.
17
+ * Documentar y hacer videos. Tener foros de la comunidad o presencia en reddit o stackoverflow.... o algo parecido???
18
+ * Snode Dockerfile with SSH server
19
+ * **ngrok**:
20
+ * Doc ngrok use. Use cases and tutorial
21
+ * Doc host1_route combined with ngrok
22
+ * **PENSAR**: Script to set **static IP**
23
+
24
+ # 3. Features
25
+
26
+ ## 3.1. teuton readme -> teuton doc
27
+
28
+ * Renombrar "teuton readme" por "teuton doc".
9
29
  * Modificar código, documentación y los ejemplos
10
30
  * Modificar los ejemplos de dvarrui/teuton-tests
11
31
  * Añadir opciones de lenguaje a `teuton doc`.
12
- * Por defecto se usará `lang=en`.
32
+ * Por defecto se usará `--lang=en`.
13
33
  * Pero poder especificar el idioma usando el paráemetro `lang`. Por ejemplo :`teuton doc --lang=es`
14
- * Ampliar las estadísticas de salida.
15
- * Improve RESUME report or create stat-report, with stat information.
16
- * the worst target/task/case,
17
- * the best target/task/case,
18
- * the slowest target/task/case,
19
- * the fastest target/task/case, etc.
20
- * Related targets: group of targets that always have the same state in every case.
21
34
 
22
- **Cambios mayores:**
35
+ ## 3.2. Feature: export stats on resume
23
36
 
24
- * Aplicar las recomendaciones del informe de seguridad de Andrés.
25
- * Crear nueva gema `teuton-panel` (v2) que sustituirá la versión obsoleta actual.
26
- * Modificar/ampliar las funciones de `teuton config` para facilitar el trabajo a `teuton-panel`.
27
- * tt_include
28
- * tt_include_params
29
- * aplanar/desaplanar config file.
30
- * Nueva feature "eventos".
31
- * [Propuesta](https://github.com/dvarrui/teuton-book/blob/main/docs/03.eventos/index.md)
32
- * Nueva gema `teuton-panel`
33
- * Nuevo repo `teuton-book`: para documentación, tutoriales en español.
34
-
35
- **teuton-panel (v2.0.0)**
36
-
37
- Consultar en el repostorio `teuton-panel`. EN PROCESO!!!
37
+ Ampliar las estadísticas de salida en el report `resume`:
38
+ * Improve RESUME report or create stat-report, with stat information.
39
+ * the worst target/task/case,
40
+ * the best target/task/case,
41
+ * the slowest target/task/case,
42
+ * the fastest target/task/case, etc.
43
+ * Related targets: group of targets that always have the same state in every case.
38
44
 
39
- * config cases IMPORTANTE:
40
- * config/remote:
41
- * accept-remote-config. activar/desactivar configuraciones remotas
42
- * Acceptar post formulario y vía get curl con ruta.
43
- * config/list: mostrar listado con info de alumnos
44
- * Elegir ubicación de almacenamiento de las configuraciones
45
- * run BAJA PRIORIDAD:
46
- * Ejecutar por el profesor
47
- * Todos
48
- * a una selección
49
- * El alumno solicita su propia ejecución vía curl
50
- * every: repeticiones en bucle de I iteraciones, cada T tiempo.
51
- * Elegir ubicación de almacenamiento de los informes
52
- * Al finalizar cada ejecución se muestre un listado con los resultados
53
- * readme/doc BAJA PRIORIDAD:
54
- * activar auto "teuton doc" a página web para los alumnos.
55
- * config panel:
56
- * panel/new: crear fichero de configuración del panel
57
- * panel/save: save configuración del panel
45
+ ## 3.3. Feature: Eventos
58
46
 
59
- ---
47
+ Nueva feature "eventos".
60
48
 
61
- # TODO list para el FUTURO
49
+ * La idea está documentada mejor en el enlace siguiente.
50
+ * [Propuesta](https://github.com/dvarrui/teuton-book/blob/main/docs/03.eventos/index.md)
62
51
 
63
- ## Ideas
52
+ Idea antigua: `ensure`
64
53
 
65
- Esta es una lista de ideas para que no se me olvide... lo podemos ir ajustando 😊
54
+ * ensure: es como un target pero que no puntua
55
+ * Puede puntuar 0, poner grade a 0, dejar un log y terminar
56
+ * Puede puntuar 0 y dejar un log
57
+ * Puede puntuar negativo y dejar un log
58
+ * para controlar los hacking de los alias/fake scripts
66
59
 
67
- * **IDEA**. Editor de tests:
68
- * Editor de tests ?! .... lo veo complejo... a menos que se empiece por una versión simplificada..
69
- * El DSL es tan sencillo que no le veo sentido a un editor de retos.
70
- * Pero si podemos aprovechar y crear una" librería " de los módulos más frecuentes?!... una ayuda para facilitar la creación de test... esto se puede emparejar con el editor de test...
71
- * **SEND**. `send :email_to => :members_emails`... esto requiere que cada caso tenga un email y que además el profesor tenga configurado el acceso a su cuenta de correo... para poder enviar copias de los informes....
72
- * **HELP**. When students demand help they could recibe some advises. More ideas: bonus, lives, etc.
73
- * **FEATURE - SAVE STATE**:
74
- * Save case state or progress. var/tesname/states.db ¿?
75
- * save partial grades. Before play challenge read previous moodle.cvs.
76
- * Then play challenge and when creates new moodle.csv... we could preseve old cases(grades) 100% for example.
77
- * Create 2 evaluation modes:
78
- 1. Evaluate targets (current mode): `start eval: :targets`
79
- 1. Evaluate task: `start eval: :groups` and perhaps add group weight?
80
- 1. config file with `tt_eval: groups`
81
- * Propuestas de sdelquin
82
- * Docker en vez de vagrant?? → https://www.cloudbees.com/blog/ssh-into-a-docker-container-how-to-execute-your-commands
83
- * Tablas "bonitas" en terminal → https://github.com/piotrmurach/tty-markdown#17-table
84
- * Documentación en https://readthedocs.org/ ??
85
- * **DOCUMENTACION**
86
- * Snode Dockerfile with SSH server
87
- * **PENSAR**: Script to set **static IP**
88
- * FEATURE: Auto Parse new input format, and detect parse errors
89
- * **FEATURE - EXPORT**. Sign reports generated with GPG... just to verify autenticity if needed.
90
- * **ngrok**:
91
- * Doc ngrok use. Use cases and tutorial
92
- * Doc host1_route combined with ngrok
93
- * **FEATURE**: Host object so "host(:debian)" return a Host object so
60
+ ## 3.4. Feature: libs vs macros
94
61
 
95
- ```
96
- h = host(:debian)
97
- h.ip -> get(:debian_ip)
98
- h.username -> get(:debian_username)
99
- h.password -> get(:debian_password)
100
- h.port
101
- h.route
102
- h.protocol
103
- ```
62
+ libs/module
104
63
 
105
- * **PENSAR**: Change export to show **command output** into reports.
64
+ * Cambiar las macros por lib/modules
65
+ * Permitir crear librerías reutilizables
66
+ * bloques "TRE" target/run/expect
67
+ * Conjuntos de bloques <TRE>
68
+ * cualquier lógica reutilizable
106
69
 
107
- ## Internal changes
70
+ ## 3.5 Integración con contenedores
108
71
 
109
- * Implement "scp" over Telnet ¿?
110
- * Default port values ssh/telnet and default username values (root, Administrator)
111
- * Use travis
112
- * `expect_equal "camaleon"`, same as `expect result.equal "camaleon"`.
113
- * REVISE: verify get(:key) and get('key') works fine!
114
- * REVISE: Formatter: xml
115
- * HallOfFame test
116
- * Rename Laboratory to Checker
117
- * Unify messages ERROR, INFO, WARN. etc
118
- * Add tt_label as alias of tt_members
119
- * **TEST**: actualizar las pruebas con vagrant para la versión actual. Mejora de la calidad del código.
120
- * **DOCS** PROMOCIONAR. Documentar y hacer videos. Tener foros de la comunidad o presencia en reddit o stackoverflow.... o algo parecido???
72
+ Modificar el DSL/configuración para mejorar la integración con los contenidores Docker/podman:
121
73
 
122
- ## Docker/podman integration
74
+ > * Docker en vez de vagrant?? → https://www.cloudbees.com/blog/ssh-into-a-docker-container-how-to-execute-your-commands
123
75
 
124
76
  Host definition example:
125
77
 
@@ -160,3 +112,107 @@ var
160
112
     ├── host1
161
113
     └── host2
162
114
  ```
115
+
116
+ ## 3.6 SEND email
117
+
118
+ * `send :email_to => :members_emails`... esto requiere que cada caso tenga un email y que además el profesor tenga configurado el acceso a su cuenta de correo... para poder enviar copias de los informes....
119
+
120
+ ## 3.7 varios
121
+
122
+ * **HELP**. When students demand help they could recibe some advises. More ideas: bonus, lives, etc.
123
+
124
+ # 4. Refactor internal code
125
+
126
+ ## 4.1. Host object
127
+
128
+ * Host object so "host(:debian)" return a Host object so
129
+
130
+ ```
131
+ h = host(:debian)
132
+ h.ip -> get(:debian_ip)
133
+ h.username -> get(:debian_username)
134
+ h.password -> get(:debian_password)
135
+ h.port
136
+ h.route
137
+ h.protocol
138
+ ```
139
+
140
+ ## 4.2 Cambios internos
141
+
142
+ * Default port values ssh/telnet and default username values (root, Administrator)
143
+ * `expect_equal "camaleon"`, same as `expect result.equal "camaleon"`.
144
+ * RENAME
145
+ * Laboratory to Checker
146
+ * Add tt_label as alias of tt_members
147
+ * Unify messages ERROR, INFO, WARN. etc
148
+ * **TEST**:
149
+ * HallOfFame test
150
+ * actualizar las pruebas con vagrant para la versión actual. Mejora de la calidad del código (Todo lo de Vagrant debería estar deprecated).
151
+
152
+ ## 4.3 FEATURE - SAVE STATE
153
+
154
+ * Save case state or progress. var/tesname/states.db ¿?
155
+ * save partial grades. Before play challenge read previous moodle.cvs.
156
+ * Then play challenge and when creates new moodle.csv... we could preseve old cases(grades) 100% for example.
157
+ * Create 2 evaluation modes:
158
+ 1. Evaluate targets (current mode): `start eval: :targets`
159
+ 1. Evaluate task: `start eval: :groups` and perhaps add group weight?
160
+ 1. config file with `tt_eval: groups`
161
+
162
+ ## 4.4 varios
163
+
164
+ * Implement "scp" over Telnet ¿?
165
+ * Use travis???
166
+ * **FEATURE - EXPORT**. Sign reports generated with GPG... just to verify autenticity if needed.
167
+ * **PENSAR**: Change export to show full command output into reports.
168
+ * Propuestas de sdelquin
169
+ * Tablas "bonitas" en terminal → https://github.com/piotrmurach/tty-markdown#17-table
170
+ * Documentación en https://readthedocs.org/ ??
171
+ * FEATURE: Auto Parse new input format, and detect parse errors
172
+
173
+ # 5. Proyectos
174
+
175
+ Empezó como un nuevo feature pero por su dimensión, funcionalidad y características ha derivado en su propio proyecto indepemndiente:
176
+
177
+ * La gema `teuton-panel`
178
+
179
+ ## 5.1. Nueva gema teuton-panel (v2.0.0)
180
+
181
+ > Consultar en el repostorio `teuton-panel`. EN PROCESO!!!
182
+
183
+ Este TO-DO debería estar en el propio repo de la nueva gema.
184
+
185
+ * Crear nueva gema `teuton-panel` (v2) que sustituirá la versión obsoleta actual.
186
+ * Modificar/ampliar las funciones de `teuton config` para facilitar el trabajo a `teuton-panel`.
187
+ * tt_include
188
+ * tt_include_params
189
+ * aplanar/desaplanar config file.
190
+ * En las pruebas hemos usado `sinatra` para implementarlo.
191
+
192
+ Funcionalidades del interfaz web:
193
+
194
+ * config cases:
195
+ * config/remote:
196
+ * accept-remote-config. activar/desactivar configuraciones remotas
197
+ * Aceptar post formulario y vía get curl con ruta.
198
+ * config/list: mostrar listado con info de alumnos
199
+ * Elegir ubicación de almacenamiento de las configuraciones
200
+ * run:
201
+ * Ejecutar por el profesor
202
+ * Todos
203
+ * Una selección de cases
204
+ * every: repeticiones en bucle de I iteraciones, cada T tiempo.
205
+ * El alumno solicita su propia ejecución vía curl
206
+ * Elegir ubicación de almacenamiento de los informes
207
+ * Al finalizar cada ejecución se muestre un listado con los resultados
208
+ * readme/doc:
209
+ * activar auto "teuton doc" a página web para los alumnos.
210
+ * config panel:
211
+ * panel/new: crear fichero de configuración del panel
212
+ * panel/save: save configuración del panel
213
+
214
+ ## 5.2 Editor de tests
215
+
216
+ * Editor de tests ?! .... lo veo complejo... a menos que se empiece por una versión simplificada..
217
+ * El DSL es tan sencillo que no le veo sentido a un editor de retos.
218
+ * Pero si podemos aprovechar y crear una" librería " de los módulos más frecuentes?!... una ayuda para facilitar la creación de test... esto se puede emparejar con el editor de test...
@@ -24,18 +24,19 @@ cases:
24
24
  - tt_members: student_3
25
25
  host1_ip: 127.0.0.1
26
26
  host1_password: secret_3
27
+ tt_skip: true
27
28
  ```
28
29
 
29
- Every remote host definition require some params:
30
+ Every remote host defines its owns params:
30
31
 
31
- | Param | Description | Default value |
32
- | ----- | -------------- | ------------- |
33
- | ip | Remote host IP | |
34
- | port | Remote host port | 22 |
32
+ | Param | Description | Default value |
33
+ | -------- | ------------------- | -------------- |
34
+ | ip | Remote host IP | IP or hostname |
35
+ | port | Remote host port | 22 |
35
36
  | username | Remote user account | Not required with public SSH id |
36
37
  | password | Remote user pasword | Not required with public SSH id |
37
- | protocol | SSH or Telner | SSH |
38
- | route | Defines host2 used as gateway to reach host | |
38
+ | protocol | SSH or Telnet | SSH |
39
+ | route | Defines intermediate host used as gateway to reach principal host | |
39
40
 
40
41
  ## Definition section
41
42
 
@@ -55,12 +56,12 @@ Execution:
55
56
 
56
57
  ```
57
58
  $ teuton run examples/03-remote_hosts
58
-
59
+
59
60
  CASE RESULTS
60
61
  +------+-----------+-------+-------+
61
62
  | CASE | MEMBERS | GRADE | STATE |
62
63
  | 01 | student_1 | 0.0 | ? |
63
- | 02 | student_2 | 0.0 | ? |
64
+ | - | - | 0.0 | S |
64
65
  | 03 | student_3 | 100.0 | ✔ |
65
66
  +------+-----------+-------+-------+
66
67
 
@@ -68,8 +69,8 @@ CONN ERRORS
68
69
  +------+-----------+-------+------------------+
69
70
  | CASE | MEMBERS | HOST | ERROR |
70
71
  | 01 | student_1 | host1 | host_unreachable |
71
- | 02 | student_2 | host1 | host_unreachable |
72
72
  +------+-----------+-------+------------------+
73
+
73
74
  ```
74
75
 
75
76
  Notice that case-03 is 100% and conection works. It is running on localhost because has localhost IP (127.0.0.1).
@@ -81,7 +82,6 @@ $ tree var/03-remote_hosts
81
82
 
82
83
  var/03-remote_hosts
83
84
  ├── case-01.txt
84
- ├── case-02.txt
85
85
  ├── case-03.txt
86
86
  ├── moodle.csv
87
87
  └── resume.txt
@@ -4,6 +4,8 @@
4
4
 
5
5
  * ES - [Introducción a Teuton](https://elpuig.xeill.net/Members/vcarceler/articulos/introduccion-a-teuton): iniciarse en el uso de Teutón gracias al fantástico artículo de Víctor Carceler.
6
6
  * ES - [Verificar prácticas de GNS3 con Teuton](https://elpuig.xeill.net/Members/juanmorote/articulos/verificar-practicas-de-gns3-con-teuton): GNS3 es un excelente simulador de red Open Source que además se entiende con Teuton a las mil maravillas.
7
+ * ES - [teuton-book](https://github.com/dvarrui/teuton-book): Documentación y tutoriales sobre Teuton en español.
8
+ * Mores examples at [teuton-tests](https://github.com/dvarrui/teuton-tests) GitHub repository.
7
9
 
8
10
  # Videos
9
11
 
@@ -4,10 +4,10 @@ require_relative "../../utils/verbose"
4
4
  module DSL
5
5
  def upload(localfilter, args = {})
6
6
  abslocalfilter = if File.absolute_path? localfilter
7
- localfilter
8
- else
9
- File.join(Project.value[:project_path], localfilter)
10
- end
7
+ localfilter
8
+ else
9
+ File.join(Project.value[:project_path], localfilter)
10
+ end
11
11
 
12
12
  Dir.glob(abslocalfilter).each do |abslocalpath|
13
13
  upload_one(abslocalpath, args)
@@ -28,8 +28,8 @@ module DSL
28
28
  Net::SFTP.start(
29
29
  host.ip, host.username, password: host.password, port: host.port
30
30
  ) { |sftp| sftp.upload!(localpath, remotepath) }
31
- verbose(Rainbow(Settings.letter(:upload)).green)
32
- rescue => e
31
+ verbose(Rainbow(Settings.letter[:upload]).green)
32
+ rescue StandardError => e
33
33
  log("Upload #{localfile} to #{host.ip}:#{remotepath}", :warn)
34
34
  log(e.to_s, :warn)
35
35
  verbose(Rainbow("!").green)
@@ -34,7 +34,7 @@ module ReportExtension
34
34
  skip: true,
35
35
  id: "-",
36
36
  grade: 0.0,
37
- letter: Settings.letter(:skip),
37
+ letter: Settings.letter[:skip],
38
38
  members: "-",
39
39
  conn_status: {},
40
40
  moodle_id: "",
@@ -42,7 +42,7 @@ module ReportExtension
42
42
  }
43
43
  else
44
44
  line[:skip] = false
45
- line[:id] = format("%<id>02d", {id: c.id.to_i})
45
+ line[:id] = format("%<id>02d", { id: c.id.to_i })
46
46
  line[:letter] = Settings.letter[:cross] if c.grade.zero?
47
47
  line[:letter] = Settings.letter[:error] if c.grade < 50.0
48
48
  line[:letter] = Settings.letter[:ok] if c.grade.to_i == 100
@@ -30,7 +30,7 @@ class BaseFormatter
30
30
 
31
31
  def trim(input)
32
32
  output = input.to_s
33
- output = "...#{input[input.size - 50, input.size]}" if output.size > 65
33
+ output = "...#{input[-50, input.size]}" if output.size > 65
34
34
  output.to_s
35
35
  end
36
36
  end
@@ -1,7 +1,7 @@
1
1
  module Teuton
2
- VERSION = "3.0.0"
3
- APPNAME = "teuton"
4
- GEMNAME = "teuton"
5
- DOCKERNAME = "dvarrui/#{GEMNAME}"
6
- HOMEPAGE = "https://github.com/teuton-software/teuton"
2
+ VERSION = "3.0.2".freeze
3
+ APPNAME = "teuton".freeze
4
+ GEMNAME = "teuton".freeze
5
+ DOCKERNAME = "dvarrui/#{GEMNAME}".freeze
6
+ HOMEPAGE = "https://github.com/teuton-software/teuton".freeze
7
7
  end
data/lib/teuton.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require_relative "teuton/utils/project"
2
+ require_relative "teuton/version"
2
3
 
3
4
  module Teuton
4
5
  def self.create(path_to_new_dir)
@@ -41,10 +42,13 @@ module Teuton
41
42
  # Load DSL file and then load script file
42
43
  require_relative dslpath
43
44
  begin
44
- require_relative Project.value[:script_path]
45
- rescue => e
46
- warn Rainbow.new("[ERROR] require_dsl_and_script: <#{e}>").bright.red
47
- warn Rainbow.new("[ERROR] Reading file #{Project.value[:script_path]}").bright.red
45
+ mainscriptfile = Project.value[:script_path]
46
+ require_relative mainscriptfile
47
+ rescue StandardError => e
48
+ warn Rainbow("[ERROR] #{e}").bright.red
49
+ e.backtrace&.first(3)&.each do |line|
50
+ warn Rainbow("[ERROR] #{line}").red
51
+ end
48
52
  exit 1
49
53
  end
50
54
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: teuton
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Vargas Ruiz
@@ -183,8 +183,8 @@ extra_rdoc_files:
183
183
  - docs/learn/28-upload.md
184
184
  - docs/learn/README.md
185
185
  - docs/modes_of_use.md
186
+ - docs/more.md
186
187
  - docs/tutorial/es/nginx/README.md
187
- - docs/videos.md
188
188
  files:
189
189
  - LICENSE
190
190
  - README.md
@@ -249,8 +249,8 @@ files:
249
249
  - docs/learn/28-upload.md
250
250
  - docs/learn/README.md
251
251
  - docs/modes_of_use.md
252
+ - docs/more.md
252
253
  - docs/tutorial/es/nginx/README.md
253
- - docs/videos.md
254
254
  - lib/teuton.rb
255
255
  - lib/teuton/case/builtin/main.rb
256
256
  - lib/teuton/case/builtin/package.rb