teuton 2.3.11 → 2.4.1
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/README.md +45 -13
- data/docs/CHANGELOG.md +0 -13
- data/docs/changelog/todo.md +26 -0
- data/docs/changelog/v2.4.md +6 -2
- data/docs/dsl/execution/export.md +11 -16
- data/docs/dsl/execution/show.md +22 -7
- data/docs/ideas/{ideas.md → todo.md} +8 -16
- data/docs/install/README.md +26 -42
- data/docs/install/s-node.md +35 -0
- data/docs/install/t-node.md +76 -0
- data/docs/learn/01-target.md +34 -66
- data/docs/learn/02-config.md +35 -56
- data/docs/learn/03-remote_hosts.md +20 -1
- data/docs/learn/04-new_test.md +4 -4
- data/docs/learn/05-use.md +3 -4
- data/docs/learn/06-debug.md +6 -9
- data/docs/learn/07-log.md +14 -14
- data/docs/learn/08-readme.md +4 -4
- data/docs/learn/09-preserve.md +1 -1
- data/docs/learn/13-include.md +13 -6
- data/docs/learn/14-alias.md +14 -8
- data/docs/learn/17-hide-feedback.md +52 -0
- data/docs/learn/README.md +8 -15
- data/lib/teuton/case_manager/case/case.rb +2 -5
- data/lib/teuton/case_manager/case/dsl/expect.rb +2 -4
- data/lib/teuton/case_manager/case/dsl/log.rb +1 -2
- data/lib/teuton/case_manager/case/dsl/send.rb +4 -2
- data/lib/teuton/case_manager/case/play.rb +1 -2
- data/lib/teuton/case_manager/case/runner.rb +6 -7
- data/lib/teuton/case_manager/case_manager.rb +18 -12
- data/lib/teuton/case_manager/check_cases.rb +5 -7
- data/lib/teuton/case_manager/dsl.rb +1 -1
- data/lib/teuton/case_manager/export_manager.rb +13 -15
- data/lib/teuton/case_manager/hall_of_fame.rb +20 -16
- data/lib/teuton/case_manager/main.rb +1 -2
- data/lib/teuton/case_manager/report.rb +3 -3
- data/lib/teuton/report/formatter/base_formatter.rb +8 -7
- data/lib/teuton/report/formatter/{array_formatter.rb → default/array.rb} +44 -9
- data/lib/teuton/report/formatter/default/colored_text.rb +7 -0
- data/lib/teuton/report/formatter/default/html.rb +24 -0
- data/lib/teuton/report/formatter/default/json.rb +15 -0
- data/lib/teuton/report/formatter/{txt_formatter.rb → default/txt.rb} +4 -3
- data/lib/teuton/report/formatter/{xml_formatter.rb → default/xml.rb} +10 -4
- data/lib/teuton/report/formatter/default/yaml.rb +15 -0
- data/lib/teuton/report/formatter/formatter.rb +55 -0
- data/lib/teuton/report/formatter/moodle_csv_formatter.rb +4 -10
- data/lib/teuton/report/formatter/{resume_array_formatter.rb → resume/array.rb} +4 -7
- data/lib/teuton/report/formatter/resume/colored_text.rb +7 -0
- data/lib/teuton/report/formatter/{resume_html_formatter.rb → resume/html.rb} +7 -9
- data/lib/teuton/report/formatter/{resume_json_formatter.rb → resume/json.rb} +4 -4
- data/lib/teuton/report/formatter/{resume_txt_formatter.rb → resume/txt.rb} +4 -6
- data/lib/teuton/report/formatter/{resume_yaml_formatter.rb → resume/yaml.rb} +4 -3
- data/lib/teuton/report/report.rb +60 -43
- data/lib/teuton/report/show.rb +38 -24
- data/lib/teuton/version.rb +1 -1
- data/lib/teuton.rb +2 -1
- metadata +38 -35
- data/docs/install/scripts.md +0 -96
- data/lib/teuton/case_manager/show.rb +0 -24
- data/lib/teuton/report/close.rb +0 -38
- data/lib/teuton/report/formatter/csv_formatter.rb +0 -25
- data/lib/teuton/report/formatter/formatter_factory.rb +0 -79
- data/lib/teuton/report/formatter/html_formatter.rb +0 -57
- data/lib/teuton/report/formatter/json_formatter.rb +0 -12
- data/lib/teuton/report/formatter/list_formatter.rb +0 -65
- data/lib/teuton/report/formatter/resume_list_formatter.rb +0 -62
- data/lib/teuton/report/formatter/yaml_formatter.rb +0 -15
@@ -1,24 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative "../application"
|
4
|
-
|
5
|
-
# CaseManager show method
|
6
|
-
class CaseManager
|
7
|
-
##
|
8
|
-
# Show cases and resume report data on screep
|
9
|
-
# @param mode (Symbol) Values => :resume, :cases or :all
|
10
|
-
def show(mode = :resume)
|
11
|
-
return if Application.instance.quiet?
|
12
|
-
|
13
|
-
# Show resume report data on screen
|
14
|
-
@report.show if %i[resume all].include? mode
|
15
|
-
|
16
|
-
# Show cases report data on screen
|
17
|
-
return if mode == :resume
|
18
|
-
|
19
|
-
@cases.each do |c|
|
20
|
-
puts "=" * 40
|
21
|
-
c.show
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
data/lib/teuton/report/close.rb
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
class Report
|
2
|
-
##
|
3
|
-
# Calculate final values:
|
4
|
-
# * grade
|
5
|
-
# * max_weight
|
6
|
-
# * good_weight,d
|
7
|
-
# * fail_weight
|
8
|
-
# * fail_counter
|
9
|
-
def close
|
10
|
-
app = Application.instance
|
11
|
-
max = 0.0
|
12
|
-
good = 0.0
|
13
|
-
fail = 0.0
|
14
|
-
fail_counter = 0
|
15
|
-
@lines.each do |i|
|
16
|
-
next unless i.instance_of? Hash
|
17
|
-
|
18
|
-
max += i[:weight] if i[:weight].positive?
|
19
|
-
if i[:check]
|
20
|
-
good += i[:weight]
|
21
|
-
@history += app.letter[:good]
|
22
|
-
else
|
23
|
-
fail += i[:weight]
|
24
|
-
fail_counter += 1
|
25
|
-
@history += app.letter[:bad]
|
26
|
-
end
|
27
|
-
end
|
28
|
-
@tail[:max_weight] = max
|
29
|
-
@tail[:good_weight] = good
|
30
|
-
@tail[:fail_weight] = fail
|
31
|
-
@tail[:fail_counter] = fail_counter
|
32
|
-
|
33
|
-
i = good.to_f / max
|
34
|
-
i = 0 if i.nan?
|
35
|
-
@tail[:grade] = (100.0 * i).round
|
36
|
-
@tail[:grade] = 0 if @tail[:unique_fault].positive?
|
37
|
-
end
|
38
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
require_relative "base_formatter"
|
2
|
-
|
3
|
-
class CSVFormatter < BaseFormatter
|
4
|
-
def process
|
5
|
-
d = ";"
|
6
|
-
@head.each { |key, value| w "HEAD#{d}#{key}#{d}#{value}\n" }
|
7
|
-
@datagroups.each { |item| process_datagroup(item,d) }
|
8
|
-
@tail.each { |key, value| w "TAIL#{d}#{key}#{d}#{value}\n" }
|
9
|
-
deinit
|
10
|
-
end
|
11
|
-
|
12
|
-
def process_datagroup(group, delimiter = ";")
|
13
|
-
d = delimiter
|
14
|
-
a = "DATAGROUP#{group.order}#{d}"
|
15
|
-
group.head.each { |key, value| w "#{a}HEAD#{d}#{key}#{d}#{value}\n" }
|
16
|
-
group.lines.each do |i|
|
17
|
-
if i.instance_of? Hash
|
18
|
-
w "#{a}LINES#{d}ACTION#{d}#{i[:id]}#{d}#{i[:weight]}#{d}#{i[:description]}\n"
|
19
|
-
else
|
20
|
-
w "#{a}LINES#{d}LOG#{d}#{i}\n"
|
21
|
-
end
|
22
|
-
end
|
23
|
-
group.tail.each { |key, value| w "#{a}TAIL#{d}#{key}#{d}#{value}\n" }
|
24
|
-
end
|
25
|
-
end
|
@@ -1,79 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "rainbow"
|
4
|
-
require_relative "json_formatter"
|
5
|
-
require_relative "html_formatter"
|
6
|
-
require_relative "list_formatter"
|
7
|
-
require_relative "txt_formatter"
|
8
|
-
require_relative "yaml_formatter"
|
9
|
-
require_relative "resume_json_formatter"
|
10
|
-
require_relative "resume_html_formatter"
|
11
|
-
require_relative "resume_list_formatter"
|
12
|
-
require_relative "resume_yaml_formatter"
|
13
|
-
require_relative "resume_txt_formatter"
|
14
|
-
require_relative "moodle_csv_formatter"
|
15
|
-
require_relative "csv_formatter"
|
16
|
-
require_relative "xml_formatter"
|
17
|
-
|
18
|
-
# FormaterFactory module
|
19
|
-
module FormatterFactory
|
20
|
-
def self.get(report, format, filename)
|
21
|
-
case format
|
22
|
-
when :colored_text
|
23
|
-
f = TXTFormatter.new(report, true)
|
24
|
-
when :csv
|
25
|
-
f = CSVFormatter.new(report)
|
26
|
-
when :html
|
27
|
-
f = HTMLFormatter.new(report)
|
28
|
-
when :json
|
29
|
-
f = JSONFormatter.new(report)
|
30
|
-
when :list
|
31
|
-
f = ListFormatter.new(report)
|
32
|
-
when :txt
|
33
|
-
f = TXTFormatter.new(report, false)
|
34
|
-
when :xml
|
35
|
-
f = XMLFormatter.new(report)
|
36
|
-
when :yaml
|
37
|
-
f = YAMLFormatter.new(report)
|
38
|
-
when :moodle_csv
|
39
|
-
f = MoodleCSVFormatter.new(report)
|
40
|
-
when :resume_txt
|
41
|
-
f = ResumeTXTFormatter.new(report, false)
|
42
|
-
when :resume_colored_text
|
43
|
-
f = ResumeTXTFormatter.new(report, true)
|
44
|
-
when :resume_json
|
45
|
-
f = ResumeJSONFormatter.new(report)
|
46
|
-
when :resume_html
|
47
|
-
f = ResumeHTMLFormatter.new(report)
|
48
|
-
when :resume_list
|
49
|
-
f = ResumeListFormatter.new(report)
|
50
|
-
when :resume_yaml
|
51
|
-
f = ResumeYAMLFormatter.new(report)
|
52
|
-
else
|
53
|
-
raise "[ERROR] FormaterFactory #{format} unkown!"
|
54
|
-
end
|
55
|
-
f.init(filename)
|
56
|
-
f
|
57
|
-
end
|
58
|
-
|
59
|
-
def self.ext(format)
|
60
|
-
data = {
|
61
|
-
cvs: "csv",
|
62
|
-
colored_text: "txt",
|
63
|
-
json: "json",
|
64
|
-
list: "txt",
|
65
|
-
txt: "txt",
|
66
|
-
yaml: "yaml",
|
67
|
-
resume_colored_text: "txt",
|
68
|
-
resume_csv: "csv",
|
69
|
-
resume_json: "json",
|
70
|
-
resume_html: "html",
|
71
|
-
resume_list: "txt",
|
72
|
-
resume_txt: "txt",
|
73
|
-
resume_yaml: "yaml"
|
74
|
-
}
|
75
|
-
return format.to_s if data[format].nil?
|
76
|
-
|
77
|
-
data[format]
|
78
|
-
end
|
79
|
-
end
|
@@ -1,57 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "erb"
|
4
|
-
require_relative "yaml_formatter"
|
5
|
-
require_relative "../../application"
|
6
|
-
|
7
|
-
class HTMLFormatter < YAMLFormatter
|
8
|
-
def initialize(report)
|
9
|
-
super(report)
|
10
|
-
@data = {}
|
11
|
-
filepath = File.join(File.dirname(__FILE__), '..', '..', 'files', 'template', 'case.html')
|
12
|
-
@template = File.read(filepath)
|
13
|
-
end
|
14
|
-
|
15
|
-
def process
|
16
|
-
build_data
|
17
|
-
build_page
|
18
|
-
deinit
|
19
|
-
end
|
20
|
-
|
21
|
-
def build_page
|
22
|
-
# config = @data[:config]
|
23
|
-
# results = @data[:results]
|
24
|
-
# logs = @data[:logs]
|
25
|
-
# groups = @data[:groups]
|
26
|
-
# hall_of_fame = @data[:hall_of_fame]
|
27
|
-
# version = Application::VERSION
|
28
|
-
render = ERB.new(@template)
|
29
|
-
w render.result(binding)
|
30
|
-
end
|
31
|
-
|
32
|
-
private
|
33
|
-
|
34
|
-
def config
|
35
|
-
@data[:config]
|
36
|
-
end
|
37
|
-
|
38
|
-
def results
|
39
|
-
@data[:results]
|
40
|
-
end
|
41
|
-
|
42
|
-
def logs
|
43
|
-
@data[:logs]
|
44
|
-
end
|
45
|
-
|
46
|
-
def groups
|
47
|
-
@data[:groups]
|
48
|
-
end
|
49
|
-
|
50
|
-
def hall_of_fame
|
51
|
-
@data[:hall_of_fame]
|
52
|
-
end
|
53
|
-
|
54
|
-
def version
|
55
|
-
Application::VERSION
|
56
|
-
end
|
57
|
-
end
|
@@ -1,65 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative "array_formatter"
|
4
|
-
|
5
|
-
class ListFormatter < ArrayFormatter
|
6
|
-
def process
|
7
|
-
build_data
|
8
|
-
process_config
|
9
|
-
process_logs
|
10
|
-
process_groups
|
11
|
-
process_results
|
12
|
-
process_hof
|
13
|
-
deinit
|
14
|
-
end
|
15
|
-
|
16
|
-
private
|
17
|
-
|
18
|
-
def process_config
|
19
|
-
w "CONFIGURATION\n"
|
20
|
-
@data[:config].sort.each { |key, value| w " * #{key} : #{value}\n" }
|
21
|
-
w "\n\n"
|
22
|
-
end
|
23
|
-
|
24
|
-
def process_logs
|
25
|
-
return if @data[:logs].size == 0
|
26
|
-
|
27
|
-
w "\nLOGS\n"
|
28
|
-
@data[:logs].each { |line| w " * #{line}\n" }
|
29
|
-
end
|
30
|
-
|
31
|
-
def process_groups
|
32
|
-
return if @data[:groups].size == 0
|
33
|
-
|
34
|
-
w "\nGROUPS\n"
|
35
|
-
@data[:groups].each { |g| process_group g }
|
36
|
-
end
|
37
|
-
|
38
|
-
def process_results
|
39
|
-
w "\nRESULTS\n"
|
40
|
-
@data[:results].each do |key, value|
|
41
|
-
w " * #{key} : #{value}\n"
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
def process_hof
|
46
|
-
return if @data[:hall_of_fame].size < 3
|
47
|
-
|
48
|
-
w "\nHALL OF FAME\n"
|
49
|
-
@data[:hall_of_fame].each do |line|
|
50
|
-
w " #{line[0]} #{line[1]}\n"
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
private
|
55
|
-
|
56
|
-
def process_group(group)
|
57
|
-
tab = " "
|
58
|
-
w "- #{group[:title]}\n"
|
59
|
-
group[:targets].each do |i|
|
60
|
-
w "#{tab * 2}#{format("%02d", i[:target_id].to_i)}"
|
61
|
-
w " (#{i[:score]}/#{i[:weight]}) "
|
62
|
-
w "#{i[:description]}\n"
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
@@ -1,62 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative "resume_array_formatter"
|
4
|
-
|
5
|
-
# ResumeListFormatter class
|
6
|
-
class ResumeListFormatter < ResumeArrayFormatter
|
7
|
-
def initialize(report)
|
8
|
-
super(report)
|
9
|
-
@data = {}
|
10
|
-
end
|
11
|
-
|
12
|
-
def process
|
13
|
-
build_data
|
14
|
-
process_config
|
15
|
-
process_cases
|
16
|
-
process_conn_errors
|
17
|
-
process_results
|
18
|
-
process_hof
|
19
|
-
deinit
|
20
|
-
end
|
21
|
-
|
22
|
-
private
|
23
|
-
|
24
|
-
def process_config
|
25
|
-
w "CONFIGURATION\n"
|
26
|
-
@data[:config].each do |key, value|
|
27
|
-
w " * #{key}: #{trim(value)}\n"
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
def process_cases
|
32
|
-
w "CASES\n"
|
33
|
-
@data[:cases].each do |line|
|
34
|
-
w " [#{line[:id]}] #{line[:members]} :#{format("%3d", line[:grade])}\n"
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
def process_conn_errors
|
39
|
-
w "CONN ERRORS\n"
|
40
|
-
@data[:cases].each do |line|
|
41
|
-
line[:conn_status].each_pair do |h, e|
|
42
|
-
w " * #{line[:id]} #{line[:members]} #{h} #{e}\n"
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
def process_results
|
48
|
-
w "\nRESULTS\n"
|
49
|
-
@data[:results].each do |key, value|
|
50
|
-
w " * #{key}: #{value}\n"
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
def process_hof
|
55
|
-
return if @data[:hall_of_fame].size < 3
|
56
|
-
|
57
|
-
w "\nHALL OF FAME\n"
|
58
|
-
@data[:hall_of_fame].each do |line|
|
59
|
-
w " #{line[0]} : #{line[1]}\n"
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "yaml"
|
4
|
-
require_relative "array_formatter"
|
5
|
-
|
6
|
-
class YAMLFormatter < ArrayFormatter
|
7
|
-
##
|
8
|
-
# Process data from parent object and export it into YAML format.
|
9
|
-
# @return [nil]
|
10
|
-
def process
|
11
|
-
build_data
|
12
|
-
w @data.to_yaml # Write data into ouput file
|
13
|
-
deinit
|
14
|
-
end
|
15
|
-
end
|