teuton 3.0.1 → 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: bb5b160c0ddb27676facfc27aab19a9ff581996431ff5a7d5e6ffe5f2a14e1e2
4
- data.tar.gz: 300caee6734f6ddee6d2ee3412c0dc46b4adaa50eaf0914f25827145a61c2993
3
+ metadata.gz: 93e9ece06ffba48858ef89bfdf6e4e0cddd095d84f6a8fb3de32f1e0c2c713f7
4
+ data.tar.gz: a905a098f5ca254323d6eb1b72c4f9970b39082091cc17075f7c02f23cd87997
5
5
  SHA512:
6
- metadata.gz: 778f4299795b919ce01eb8a2b43f288a36c54fb09fb8fa3deb5870350a5c36cd538f3870d8b666ab50cd25ec7742f7cce46e3002be837f8d15d7f3cece14158b
7
- data.tar.gz: de2a62514669a0ae9e5416d9e8c52f80eb56db81362ae9e4b84f234d83cf556d6f41864d060e016425b460fdfdf2d7969c3bdf4e9f2676bacd50f1e768fff842
6
+ metadata.gz: 66f9d13f1526f42dd7d68e5e195e9bd304f152ba3447cdc723ed0f417dd299d848bc6867fcc5b03ef1d0848c541c545571e727fe65ec29782ab6944ec7f8beb1
7
+ data.tar.gz: 8b5e6b841e08a31f2cfbb76b40377b0dd2eaf63b021c458dfe6908ca04a077be6b61fd4a5e27a04e01d5b34fc62ff9a3fa9df1ecff3d207c2b8315a381f956e4
@@ -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,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
@@ -1,7 +1,7 @@
1
1
  module Teuton
2
- VERSION = "3.0.1"
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
+ mainscriptfile = Project.value[:script_path]
46
+ require_relative mainscriptfile
45
47
  rescue StandardError => e
46
- warn Rainbow("[ERROR] require_dsl_and_script: <#{e}>").bright.red
47
- warn Rainbow("[ERROR] Reading file #{Project.value[:script_path]}").bright.red
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.1
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Vargas Ruiz