teuton 0.0.1 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +46 -0
- data/docs/logo.png +0 -0
- data/lib/teuton/command/download.rb +8 -2
- data/lib/teuton/report/close.rb +7 -0
- data/lib/teuton/report/formatter/yaml_formatter.rb +8 -1
- data/lib/teuton/report/report.rb +27 -10
- data/lib/teuton/report/show.rb +2 -0
- metadata +19 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b8888bb5a43b357d2968cdcf354d1bad4851649f282a4ef1d24f7ad26ba04243
|
4
|
+
data.tar.gz: 2c476f06e9b429c19c4fc87c0fd783b30fd4931bf2887fcf7fe834c86463e028
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0ca5960c2334209ae1bf9058cb017554664b58b1d7b7854b647efb9bf240e09098d4a939f0325b3056910029251412b76aea57a06d72db20a3e1febe091266f
|
7
|
+
data.tar.gz: e6a0f6a97d6a77a4c7e7ad9286de04de2145c15d40be0b781f9d7f98db5d28cdc662ff570cb7e4573c264f03cac6bd56946935d32852eafbee9bb9647b343ac3
|
data/README.md
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
|
2
|
+
# TEUTON Software
|
3
|
+
|
4
|
+
_Create Unit Test for your machines.
|
5
|
+
Test your infraestructure as code._
|
6
|
+
|
7
|
+
![logo](./docs/logo.png)
|
8
|
+
|
9
|
+
Intrastructure test, useful for:
|
10
|
+
* Sysadmin teachers to evaluate students remote machines.
|
11
|
+
* Sysadmin apprentices to evaluate their learning process as a game.
|
12
|
+
* Professional sysadmin to monitor remote machines.
|
13
|
+
|
14
|
+
Allow us:
|
15
|
+
* Write test units for real or virtual machines using simple DSL.
|
16
|
+
* Check compliance with requirements on remote machines.
|
17
|
+
|
18
|
+
# Documentation
|
19
|
+
|
20
|
+
Read [Teuton Wiki](https://github.com/teuton-software/teuton/wiki) documentation.
|
21
|
+
|
22
|
+
* [Installation](https://github.com/teuton-software/teuton/wiki/Installation)
|
23
|
+
* [Modes](https://github.com/teuton-software/teuton/wiki/Modes-of-use)
|
24
|
+
* [Installation scripts](https://github.com/teuton-software/teuton/wiki/Installation-using-scripts)
|
25
|
+
* [Vagrant](https://github.com/teuton-software/teuton/wiki/Installation-using-Vagrant)
|
26
|
+
* [Manual](https://github.com/teuton-software/teuton/wiki/Manual-installation)
|
27
|
+
* [Learning](https://github.com/teuton-software/teuton/wiki/Learning)
|
28
|
+
* [Quick demo](https://github.com/teuton-software/teuton/wiki/Quick-demo)
|
29
|
+
* [Example 01 - Target](https://github.com/teuton-software/teuton/wiki/Example-01---Target)
|
30
|
+
* [Example 02 - Configfile](https://github.com/teuton-software/teuton/wiki/Example-02---Config-file)
|
31
|
+
* [Example 03 - Remote hosts](https://github.com/teuton-software/teuton/wiki/Example-03---Remote-hosts)
|
32
|
+
* [Example 04 - Use](https://github.com/teuton-software/teuton/wiki/Example-04---Use)
|
33
|
+
* [Commands](https://github.com/teuton-software/teuton/wiki/Commands)
|
34
|
+
* [DSL keywords](https://github.com/teuton-software/teuton/wiki/DSL-keywords)
|
35
|
+
|
36
|
+
# Features
|
37
|
+
|
38
|
+
* [Free Software License](LICENSE).
|
39
|
+
* Multiplatform [installation](https://github.com/teuton-software/teuton/wiki/Installation).
|
40
|
+
* Use SSH or Telnet protocol to connect to remote machines.
|
41
|
+
* Developed using the ruby language.
|
42
|
+
|
43
|
+
# Contact
|
44
|
+
|
45
|
+
* **Email**: `teuton.software@protonmail.com`
|
46
|
+
* **Twitter**: `@SoftwareTeuton`
|
data/docs/logo.png
ADDED
Binary file
|
@@ -20,7 +20,13 @@ class Teuton < Thor
|
|
20
20
|
def download
|
21
21
|
repo = 'teuton-challenges'
|
22
22
|
puts "[INFO] Downloading <#{repo}> repo..."
|
23
|
-
system("git clone https://github.com/teuton-software/#{repo}.git")
|
24
|
-
|
23
|
+
ok = system("git clone https://github.com/teuton-software/#{repo}.git")
|
24
|
+
if ok
|
25
|
+
puts "[INFO] Your files are into <#{Rainbow(repo).bright}> directory..."
|
26
|
+
else
|
27
|
+
puts Rainbow('[ERROR] Ensure: ').red
|
28
|
+
puts Rainbow(' 1. Git is installed.').red
|
29
|
+
puts Rainbow(' 2. Your Internet connection is working.').red
|
30
|
+
end
|
25
31
|
end
|
26
32
|
end
|
data/lib/teuton/report/close.rb
CHANGED
@@ -3,13 +3,20 @@
|
|
3
3
|
require 'yaml'
|
4
4
|
require_relative 'array_formatter'
|
5
5
|
|
6
|
-
|
6
|
+
##
|
7
|
+
# YAMLFormatter class receive a [Report] and generates YAML output.
|
7
8
|
class YAMLFormatter < ArrayFormatter
|
9
|
+
##
|
10
|
+
# Class constructor
|
11
|
+
# @param report [Report] Parent object that contains data to be exported.
|
8
12
|
def initialize(report)
|
9
13
|
super(report)
|
10
14
|
@data = {}
|
11
15
|
end
|
12
16
|
|
17
|
+
##
|
18
|
+
# Process data from parent object and export it into YAML format.
|
19
|
+
# @return [nil]
|
13
20
|
def process
|
14
21
|
build_data
|
15
22
|
w @data.to_yaml # Write data into ouput file
|
data/lib/teuton/report/report.rb
CHANGED
@@ -5,19 +5,30 @@ require_relative 'formatter/formatter_factory'
|
|
5
5
|
require_relative 'show'
|
6
6
|
require_relative 'close'
|
7
7
|
|
8
|
-
|
9
|
-
This class maintain the results of every case, in a structured way.
|
10
|
-
* report/show.rb
|
11
|
-
* report/close.rb
|
12
|
-
=end
|
13
|
-
|
8
|
+
##
|
9
|
+
# This class maintain the results of every case, in a structured way.
|
10
|
+
# * report/show.rb
|
11
|
+
# * report/close.rb
|
14
12
|
class Report
|
13
|
+
# @!attribute id
|
14
|
+
# @return [Integer] It is the [Case] number. Zero indicates Resume Report.
|
15
15
|
attr_accessor :id, :filename, :output_dir
|
16
|
-
|
17
|
-
|
16
|
+
# @!attribute head
|
17
|
+
# @return [Hash] Report head information.
|
18
|
+
attr_accessor :head
|
19
|
+
# @!attribute lines
|
20
|
+
# @return [Array] Report body information.
|
21
|
+
attr_accessor :lines
|
22
|
+
# @!attribute tail
|
23
|
+
# @return [Hash] Report tail information.
|
24
|
+
attr_accessor :tail
|
25
|
+
# @!attribute format
|
26
|
+
# @return [Symbol] Indicate export format.
|
18
27
|
attr_reader :format
|
19
|
-
|
20
|
-
|
28
|
+
attr_reader :history
|
29
|
+
##
|
30
|
+
# Class constructor
|
31
|
+
def initialize(id = 0)
|
21
32
|
@id = id
|
22
33
|
number = '0' + @id.to_s
|
23
34
|
number = @id.to_s if @id > 9
|
@@ -32,6 +43,9 @@ class Report
|
|
32
43
|
@history = ''
|
33
44
|
end
|
34
45
|
|
46
|
+
##
|
47
|
+
# Export [Case] data to specified format.
|
48
|
+
# @param format [Symbol] Select export format. Default value is :txt.
|
35
49
|
def export(format = :txt)
|
36
50
|
@format = format
|
37
51
|
filepath = File.join(@output_dir, @filename + '.' \
|
@@ -41,6 +55,9 @@ class Report
|
|
41
55
|
formatter.process
|
42
56
|
end
|
43
57
|
|
58
|
+
##
|
59
|
+
# Export resumed data from all Cases, to specified format.
|
60
|
+
# @param format [Symbol] Select export format. Default value is :txt.
|
44
61
|
def export_resume(format = :txt)
|
45
62
|
@format = "resume_#{format.to_s}".to_sym
|
46
63
|
filepath = File.join(@output_dir, @filename + '.' \
|
data/lib/teuton/report/show.rb
CHANGED
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:
|
4
|
+
version: 2.1.0
|
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: 2019-11-
|
11
|
+
date: 2019-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0.
|
61
|
+
version: '0.1'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '0.
|
68
|
+
version: '0.1'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rainbow
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -94,20 +94,6 @@ dependencies:
|
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0.20'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: timeout
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - "~>"
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '0.0'
|
104
|
-
type: :runtime
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - "~>"
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '0.0'
|
111
97
|
- !ruby/object:Gem::Dependency
|
112
98
|
name: terminal-table
|
113
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -150,15 +136,27 @@ dependencies:
|
|
150
136
|
- - "~>"
|
151
137
|
- !ruby/object:Gem::Version
|
152
138
|
version: '0.74'
|
153
|
-
description:
|
154
|
-
|
139
|
+
description: |2
|
140
|
+
Intrastructure Test Software.
|
141
|
+
|
142
|
+
Some dependencies require compilation.
|
143
|
+
Ensure these packages are installed into your local hosts:
|
144
|
+
[ALL] ruby, make, gcc
|
145
|
+
[Debian] ssh, ruby-dev
|
146
|
+
[OpenSUSE] openssh, ruby-devel
|
147
|
+
|
148
|
+
Read Teuton documentation: https://github.com/teuton-software/teuton/wiki/
|
155
149
|
email: teuton.software@protonmail.com
|
156
150
|
executables:
|
157
151
|
- teuton
|
158
152
|
extensions: []
|
159
|
-
extra_rdoc_files:
|
153
|
+
extra_rdoc_files:
|
154
|
+
- README.md
|
155
|
+
- docs/logo.png
|
160
156
|
files:
|
157
|
+
- README.md
|
161
158
|
- bin/teuton
|
159
|
+
- docs/logo.png
|
162
160
|
- lib/teuton.rb
|
163
161
|
- lib/teuton/application.rb
|
164
162
|
- lib/teuton/case_manager/case/builtin/main.rb
|