teuton 2.4.0 → 2.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +9 -6
  3. data/docs/changelog/todo.md +10 -1
  4. data/docs/changelog/v2.4.md +5 -1
  5. data/docs/commands/README.md +8 -17
  6. data/docs/commands/example_check.md +4 -4
  7. data/docs/commands/example_run.md +10 -32
  8. data/docs/dsl/README.md +27 -39
  9. data/docs/dsl/{definition/expect.md → expect.md} +2 -18
  10. data/docs/dsl/{execution/export.md → export.md} +4 -8
  11. data/docs/dsl/{setting/get.md → get.md} +4 -10
  12. data/docs/dsl/{definition/group.md → group.md} +2 -7
  13. data/docs/dsl/{execution/play.md → play.md} +1 -6
  14. data/docs/dsl/{definition/result.md → result.md} +1 -6
  15. data/docs/dsl/{definition/run_remote.md → run.md} +57 -23
  16. data/docs/dsl/{execution/send.md → send.md} +1 -8
  17. data/docs/dsl/{setting/set.md → set.md} +1 -7
  18. data/docs/dsl/{execution/show.md → show.md} +7 -16
  19. data/docs/dsl/target.md +33 -0
  20. data/docs/ideas/todo.md +35 -115
  21. data/docs/install/README.md +26 -42
  22. data/docs/install/s-node.md +35 -0
  23. data/docs/install/t-node.md +76 -0
  24. data/docs/learn/01-cmd_new.md +28 -0
  25. data/docs/learn/{01-target.md → 02-target.md} +21 -28
  26. data/docs/learn/03-remote_hosts.md +59 -87
  27. data/docs/learn/04-config.md +147 -0
  28. data/docs/learn/05-use.md +25 -45
  29. data/docs/learn/06-cmd_check.md +50 -0
  30. data/docs/learn/07-target_weight.md +44 -0
  31. data/docs/learn/08-unique_values.md +70 -0
  32. data/docs/learn/09-send.md +20 -0
  33. data/docs/learn/10-debug.md +45 -0
  34. data/docs/learn/11-export.md +35 -0
  35. data/docs/learn/{09-preserve.md → 12-preserve.md} +1 -1
  36. data/docs/learn/13-feedback.md +49 -0
  37. data/docs/learn/14-moodle_id.md +24 -0
  38. data/docs/learn/{08-readme.md → 15-readme.md} +5 -9
  39. data/docs/learn/{13-include.md → 16-include.md} +1 -3
  40. data/docs/learn/{14-alias.md → 17-alias.md} +0 -0
  41. data/docs/learn/{07-log.md → 18-log.md} +19 -23
  42. data/docs/learn/{12-get_vars.md → 19-read_vars.md} +3 -3
  43. data/docs/learn/20-macros.md +49 -0
  44. data/docs/learn/{16-exit_codes.md → 21-exit_codes.md} +0 -0
  45. data/docs/learn/{10-result.md → 22-result.md} +3 -3
  46. data/docs/learn/23-test-code.md +54 -0
  47. data/docs/learn/24-test-sql.md +69 -0
  48. data/docs/learn/README.md +31 -32
  49. data/lib/teuton/application.rb +2 -5
  50. data/lib/teuton/case_manager/case/case.rb +2 -1
  51. data/lib/teuton/case_manager/case/dsl/expect.rb +3 -1
  52. data/lib/teuton/case_manager/case/dsl/goto.rb +1 -1
  53. data/lib/teuton/case_manager/case/dsl/log.rb +5 -3
  54. data/lib/teuton/case_manager/case/dsl/send.rb +2 -2
  55. data/lib/teuton/case_manager/case/dsl/target.rb +1 -1
  56. data/lib/teuton/case_manager/case/result/ext_compare.rb +20 -21
  57. data/lib/teuton/case_manager/case/result/ext_filter.rb +15 -8
  58. data/lib/teuton/case_manager/case_manager.rb +10 -8
  59. data/lib/teuton/check/show.rb +1 -1
  60. data/lib/teuton/files/config.yaml +1 -2
  61. data/lib/teuton/files/start.rb +4 -4
  62. data/lib/teuton/readme/dsl.rb +9 -1
  63. data/lib/teuton/readme/readme.rb +8 -1
  64. data/lib/teuton/report/formatter/base_formatter.rb +2 -0
  65. data/lib/teuton/report/formatter/formatter.rb +1 -0
  66. data/lib/teuton/report/show.rb +8 -0
  67. data/lib/teuton/version.rb +1 -1
  68. data/lib/teuton.rb +2 -1
  69. metadata +72 -54
  70. data/docs/dsl/definition/run_local.md +0 -33
  71. data/docs/dsl/definition/target.md +0 -40
  72. data/docs/install/scripts.md +0 -96
  73. data/docs/learn/02-config.md +0 -121
  74. data/docs/learn/04-new_test.md +0 -87
  75. data/docs/learn/06-debug.md +0 -110
  76. data/docs/learn/11-moodle_id.md +0 -19
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b683fafbf0ece0ad550d4ace207434c8ef27b4b2f37396ff6845c68b37a90694
4
- data.tar.gz: 5dcb72959f019fdbb9c8a6afc4e87aa23fb8c7a4370e76516db3c0c82f4ce8e3
3
+ metadata.gz: 6bb235310c658ecda29f97a42e1997bd733cfea07a3a66f247bbfe12700e43d9
4
+ data.tar.gz: 52c90371c74d8de5f087d3ad5478e26cac633e9188351424f6a3b85d1b0d3664
5
5
  SHA512:
6
- metadata.gz: 38123e21191880cb1aef35a1a203c2c9af4125b2a7a0e04edb8bbae6d9ed723c1a0bb73a0783a0d951a833b29cf7ab924a42e44bf2a017bcabf38c44724e3ce4
7
- data.tar.gz: 51a27604a6efef11534f1afe56c995757b6cf167e14eaff34c3245561c5c1ca290491f1897bc231c05e7bd2774cd5186f775e394f563e29d640f04d44574b0dc
6
+ metadata.gz: 8ca3e5e24efd6d4891404b875d76abae86f6ab522205e8f16a0b20945aaf859434057fefcfce06100514987f5e876b09eada2999943cb99fc77f8c46783c8ff8
7
+ data.tar.gz: ab1398e8666934eda13ced4349354a840b4b5e97e7874bff4a704a713281cf7efe36ea8ee393bc2bebab2345488f454af97f676c28e8d792cab20416d32ce60e
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  [![Gem Version](https://badge.fury.io/rb/teuton.svg)](https://badge.fury.io/rb/teuton)
5
5
  ![GitHub](https://img.shields.io/github/license/dvarrui/teuton)
6
- ![Gem](https://img.shields.io/gem/dv/teuton/2.3.11)
6
+ ![Gem](https://img.shields.io/gem/dv/teuton/2.4.0)
7
7
 
8
8
  _Create Unit Test for your machines. Test your infraestructure as code._
9
9
 
@@ -22,7 +22,7 @@ Teuton allow us:
22
22
 
23
23
  Install Ruby and then:
24
24
 
25
- ```
25
+ ```console
26
26
  gem install teuton
27
27
  ```
28
28
 
@@ -32,7 +32,7 @@ gem install teuton
32
32
 
33
33
  Executing `teuton` command to run example test:
34
34
 
35
- ```
35
+ ```console
36
36
  ❯ teuton run examples/01-target
37
37
 
38
38
  CASE RESULTS
@@ -51,12 +51,13 @@ CASE RESULTS
51
51
 
52
52
  # Documentation
53
53
 
54
- * [Blogs and videos](docs/videos.md)
55
- * [Learning](docs/learn/README.md)
56
- * [Commands](docs/commands/README.md)
54
+ * [Learn](docs/learn/README.md)
57
55
  * [Language reference](docs/dsl/README.md)
56
+ * [Commands](docs/commands/README.md)
58
57
  * [Installation](docs/install/README.md)
59
58
 
59
+ > [Blogs and videos](docs/videos.md)
60
+
60
61
  # Contact
61
62
 
62
63
  * **Email**: `teuton.software@protonmail.com`
@@ -69,3 +70,5 @@ CASE RESULTS
69
70
  1. Commit your changes (`git commit -am 'Add some feature'`)
70
71
  1. Push to the branch (`git push origin my-new-feature`)
71
72
  1. Create new Pull Request.
73
+
74
+ You can also [create issues](https://github.com/teuton-software/teuton/issues) with your requests/incidences/suggestions.
@@ -2,12 +2,13 @@
2
2
  ## TO-DO
3
3
 
4
4
  New features:
5
+ - Parse new input format, and detect parse errors
5
6
  - Teuton readme --lang=es
6
7
  - Export files with other langs
7
8
 
8
9
  Revise:
9
10
  * verify get(:key) and get('key') works fine!
10
- * Formatter: xml,
11
+ * Formatter: xml,
11
12
 
12
13
  Revise documentation:
13
14
  * Doc learn 10,11, 12,13 y 14
@@ -16,3 +17,11 @@ Revise documentation:
16
17
  * 13 include
17
18
  * 14 macro
18
19
  * Doc tt_include
20
+
21
+ Internal changes:
22
+ * Application to Settings
23
+ * Laboratory to Checker
24
+ * Colorize to Rainbow
25
+ * Unify messages ERROR, INFO, WARN. etc
26
+ * Create SendManager as ExportManager?
27
+ * Add tt_label as alias of tt_members
@@ -1,4 +1,8 @@
1
1
 
2
+ ## [2.4.2]
3
+
4
+ - Fix bug with result.grep_v(Array)
5
+
2
6
  ## [2.4.0]
3
7
 
4
8
  New features:
@@ -6,7 +10,7 @@ New features:
6
10
  - Add new DSL keyword: expect_last, expect_fisrt
7
11
  - Remove os gem.
8
12
  - Change test output colors to green as use others test tools.
9
- - Change show DSL params. Accepts one param "level" that indicates verbosity output level on screen.
13
+ - Change show DSL params. Accepts one param "verbose: NUMBER" to adjust verbosity output level on screen.
10
14
 
11
15
  New doc and example:
12
16
  - 14-alias
@@ -11,8 +11,6 @@ Available command functions:
11
11
 
12
12
  # 1. Show help
13
13
 
14
- Usage:
15
-
16
14
  ```bash
17
15
  teuton
18
16
  ```
@@ -32,14 +30,13 @@ Commands:
32
30
  ```
33
31
 
34
32
  Alias:
33
+
35
34
  * `teuton h`
36
35
  * `teuton -h`
37
36
  * `teuton --help`
38
37
 
39
38
  # 2. Show version
40
39
 
41
- Usage:
42
-
43
40
  ```bash
44
41
  teuton version
45
42
  ```
@@ -52,23 +49,22 @@ teuton (version 2.2.0)
52
49
  ```
53
50
 
54
51
  Alias:
52
+
55
53
  * `teuton v`
56
54
  * `teuton -v`
57
55
  * `teuton --version`
58
56
 
59
57
  # 3. Create new test
60
58
 
61
- Usage:
59
+ Create teuton test skeleton.
62
60
 
63
61
  ```bash
64
62
  teuton new foo
65
63
  ```
66
64
 
67
- Description: Create teuton test skeleton.
68
-
69
65
  Example:
70
66
 
71
- ```bash
67
+ ```console
72
68
  > teuton new foo
73
69
 
74
70
  [INFO] Creating foo project skeleton
@@ -86,15 +82,14 @@ This command will create the next structure:
86
82
  | foo/config.yaml | YAML configuration file |
87
83
 
88
84
  Alias:
85
+
89
86
  * `teuton n foo`
90
87
  * `teuton -n foo`
91
88
  * `teuton --new foo`
92
89
 
93
90
  # 4. Check teuton test
94
91
 
95
- Usage:
96
-
97
- ```bash
92
+ ```console
98
93
  teuton check DIRPATH
99
94
  ```
100
95
 
@@ -110,14 +105,13 @@ Description: this command check teuton test and config files located into DIRPAT
110
105
  | teuton check path/to/file/foo.rb --cname=demo | Test content of foo.rb and demo.yaml files.|
111
106
 
112
107
  Alias:
108
+
113
109
  * `teuton c foo`
114
110
  * `teuton -c foo`
115
111
  * `teuton --check foo`
116
112
 
117
113
  # 5. Run teuton test
118
114
 
119
- Usage:
120
-
121
115
  ```bash
122
116
  teuton run DIRPATH
123
117
  ```
@@ -127,18 +121,15 @@ Description: this command run teuton test located into DIRPATH folder.
127
121
  [Example](example_run.md)
128
122
 
129
123
  Alias:
124
+
130
125
  * `teuton foo`
131
126
 
132
127
  # 6. Show README
133
128
 
134
- Usage:
135
-
136
129
  ```bash
137
130
  teuton readme DIRPATH
138
131
  ```
139
132
 
140
- Description:
141
-
142
133
  Read test and config files content, and display information about
143
134
  what kind of problem/exercise it is going to be evaluated. The students need this
144
135
  information to resolv the problem/exercise into their machines.
@@ -2,18 +2,18 @@
2
2
 
3
3
  # Check Teuton Test
4
4
 
5
- Objective: Revise Teuton test located into `example\learn-01-target`.
5
+ Objective: Revise Teuton test located into `example\01-target`.
6
6
 
7
7
  Usage:
8
8
 
9
9
  ```
10
- teuton check examples/learn-01-target
10
+ teuton check examples/01-target
11
11
  ```
12
12
 
13
13
  Example:
14
14
 
15
15
  ```bash
16
- > teuton check examples/learn-01-target
16
+ teuton check examples/01-target
17
17
 
18
18
  +----------------------------+
19
19
  | GROUP: Learn about targets |
@@ -39,7 +39,7 @@ Example:
39
39
  +----------------------+
40
40
  | Revising CONFIG file |
41
41
  +----------------------+
42
- [WARN] File /mnt/home/leap/proy/repos/teuton.d/teuton/examples/learn-01-target/config.yaml not found!
42
+ [WARN] File .../examples/01-target/config.yaml not found!
43
43
  [INFO] Recomended content:
44
44
  ---
45
45
  :global:
@@ -7,55 +7,33 @@
7
7
 
8
8
  # 1. Run test
9
9
 
10
- Description: Running Teuton test located into `example/learn-01-target` folder.
11
-
12
- Usage:
10
+ Running Teuton test located into `example/01-target` folder.
13
11
 
14
12
  ```bash
15
- teuton run example/learn-01-target
13
+ teuton run example/01-target
16
14
  ```
17
15
 
18
16
  Example:
19
17
 
20
18
  ```bash
21
- > teuton run examples/learn-01-target
22
-
23
- ==================================
24
- Executing [teuton] (version 2.1.9)
25
- [INFO] Running in parallel (2020-04-19 14:09:41 +0100)
26
- .
27
- [INFO] Duration = 0.004 (2020-04-19 14:09:41 +0100)
28
- ==================================
29
-
30
- INITIAL CONFIGURATIONS
31
- +---------------+-------------------------------------------+
32
- | tt_title | Executing [teuton] (version 2.1.9) |
33
- | tt_scriptname | examples/learn-01-target/start.rb |
34
- | tt_configfile | examples/learn-01-target/config.yaml |
35
- | tt_pwd | /mnt/home/leap/proy/repos/teuton.d/teuton |
36
- | tt_testname | learn-01-target |
37
- | tt_sequence | false |
38
- +---------------+-------------------------------------------+
19
+ ------------------------------------
20
+ Started at 2023-01-21 13:32:24 +0000
21
+ F
22
+ Finished in 0.004 seconds
23
+ ------------------------------------
39
24
 
40
25
  CASE RESULTS
41
26
  +------+-----------+-------+-------+
42
27
  | CASE | MEMBERS | GRADE | STATE |
43
- | 01 | anonymous | 100.0 | |
28
+ | 01 | anonymous | 0.0 | ? |
44
29
  +------+-----------+-------+-------+
45
-
46
- FINAL VALUES
47
- +-------------+---------------------------+
48
- | start_time | 2020-04-19 14:09:41 +0100 |
49
- | finish_time | 2020-04-19 14:09:41 +0100 |
50
- | duration | 0.004231917 |
51
- +-------------+---------------------------+
52
30
  ```
53
31
 
54
32
  # 2. Command options
55
33
 
56
- Usage: `teuton help run`
57
-
58
34
  ```
35
+ > teuton help run
36
+
59
37
  Usage:
60
38
  teuton [run] [OPTIONS] DIRECTORY
61
39
 
data/docs/dsl/README.md CHANGED
@@ -1,55 +1,43 @@
1
1
  [<< back](../../README.md)
2
2
 
3
- # Teuton language
3
+ # Language keywords
4
4
 
5
- To define and run our activity test we use the next DSL keywords:
6
- 1. [Definition instructions](#definition-instructions)
7
- 2. [Execution instructions](#execution-instructions)
8
- 3. [Setting instructions](#setting-instructions)
9
- 4. [Ruby language](#ruby-language)
5
+ To define our targets, and to run our tests, we use the next DSL keywords:
10
6
 
11
- ## Definition instructions
7
+ Types:
12
8
 
13
- These are the main DSL key words, usefull to define items to be evaluated.
9
+ * **Definition DSL**: keywords to define targets/items to be checked/evaluated.
10
+ * **Execution DSL**: keywords used to specify accions related with reports and showing information.
11
+ * **Settings DSL**: keyword to read and write config file.
14
12
 
15
- | DSL | Description |
16
- | :----------------------------- | :---------- |
17
- | [group](definition/group.md) | Define a group of items to check. |
18
- | [target](definition/target.md) | Define a target. This is the item to be checked. |
19
- | Remote [run](definition/run_remote.md)| Execute command into remote host. |
20
- | Local [run](definition/run_local.md) | Execute command into local host. |
21
- | [result](definition/result.md) | Contain the output of previous `run` order. |
22
- | [expect](definition/expect.md) | Check the obtained result with the expected value. |
13
+ ## Keyword table
23
14
 
24
- ## Execution instructions
15
+ | DSL | Type | Descripción |
16
+ | :------------------ | :--------: | :-------------------------------- |
17
+ | [expect](expect.md) | Definition | Check the obtained result with the expected value. |
18
+ | [export](export.md) | Execution | Make reports with the results of every evaluation. |
19
+ | [get](get.md) | Settings | Read param value from configuration file. |
20
+ | [group](group.md) | Definition | Define a group of items to check. |
21
+ | [play](play.md) | Execution | Run the challenge. |
22
+ | [result](result.md) | Definition | Contain the output of previous `run` order. |
23
+ | [run](run.md)| Definition | Execute command into remote host or localhost. |
24
+ | [target](target.md) | Definition | Define a target. This is the item to be checked. |
25
+ | [send](send.md) | Execution | Send copy of report file to remote host. |
26
+ | [set](set.md) | Settings | Set new param value for running configuration. |
27
+ | [show](show.md) | Execution | Show the results on screen. |
25
28
 
26
- DSL key word related with reports and information.
29
+ ### Programming language
27
30
 
28
- | DSL | Descripción |
29
- | :---------------------------- | :--------------------------------------- |
30
- | [play](execution/play.md) | Run the challenge. |
31
- | [show](execution/show.md) | Show the results on screen. |
32
- | [export](execution/export.md) | Make reports with the results of every evaluation. |
33
- | [send](execution/send.md) | Send copy of report file to remote host. |
31
+ It is possible to use Ruby language programming into Teuton tests. For example, in the definition of our test (iterators, arrays, etc.). Useful when we have repetitive lines, etc.
34
32
 
35
- ## Setting instructions
33
+ Example, how to create 4 target evaluation using a List/Array:
36
34
 
37
- | DSL | Descripción |
38
- | :-------------------- | :--------------------------------------------- |
39
- | [get](setting/get.md) | Read param value from configuration file. |
40
- | [set](setting/set.md) | Set new param value for running configuration. |
41
-
42
- ## Ruby language
43
-
44
- It is possible to use ruby language programming structures, in the definition of our test (iterators, arrays, etc.). Useful when we have repetitive lines, etc.
45
-
46
- Example, how to create 4 target evaluation using an Array:
47
35
  ```ruby
48
36
  users = ['Obiwan', 'Yoda', 'Maul', 'Vader']
49
37
 
50
- users.each do |user|
51
- target "Exist user #{user}"
52
- run "id #{user}", on: :host1
53
- expect_one user
38
+ for name in users do
39
+ target "Exist user #{name}"
40
+ run "id #{name}", on: :host1
41
+ expect_one name
54
42
  end
55
43
  ```
@@ -1,25 +1,9 @@
1
1
  [<< back](../README.md)
2
2
 
3
- 1. [Description](#description)
4
- 2. [Usage](#usage)
5
- 3. [Example](#example)
6
- 4. [Basic](#basic)
7
- 5. [Advanced](#advanced)
8
-
9
- ## Description
3
+ # expect
10
4
 
11
5
  Compare the obtained result with the expected one. This comparation process is registered into final report.
12
6
 
13
- ## Usage
14
-
15
- ```ruby
16
- target 'Exist user obiwan'
17
- run 'cat /etc/passwd'
18
- expect 'root'
19
- ```
20
-
21
- Use `expect` keyword to check output (from previous execution).
22
-
23
7
  ## Example
24
8
 
25
9
  Let's see some examples:
@@ -27,7 +11,7 @@ Let's see some examples:
27
11
  ```ruby
28
12
  target 'Exist user obiwan'
29
13
  run 'id obiwan'
30
- expect 'obiwan' # Expect previous command output contains obiwan text
14
+ expect 'obiwan' # Expect previous run command output contains obiwan text
31
15
  ```
32
16
 
33
17
  ## Basic
@@ -1,11 +1,6 @@
1
1
  [<< back](../../README.md)
2
2
 
3
- 1. [Description](#description)
4
- 2. [Example](#example)
5
- 3. [Options](#options)
6
- 4. [Usage](#usage)
7
-
8
- ## Description
3
+ # export
9
4
 
10
5
  Create reports and save then into `var/TEST-NAME` folder.
11
6
 
@@ -29,8 +24,9 @@ end
29
24
 
30
25
  ## Options
31
26
 
32
- 1. **format**: txt, html, yaml, json, colored_text (txt with colors).
33
- 2. **preserve**: true, false.
27
+ 1. **format**: txt (default), html, yaml, json, colored_text (txt with colors).
28
+ 2. **preserve**: false (default), true.
29
+ 3. **feedback**: true (default), false
34
30
 
35
31
  ## Usage
36
32
 
@@ -1,22 +1,16 @@
1
1
  [<< back](../README.md)
2
2
 
3
- 1. [Description](#description)
4
- 2. [Usage](#usage)
5
- 3. [Examples](#examples)
3
+ # get
6
4
 
7
- ## Description
8
-
9
- `get` read param value from configuration file.
10
-
11
- ## Usage
5
+ `get` reads param value from configuration file.
12
6
 
13
7
  ```ruby
14
8
  get(PARAM)
15
9
  ```
16
10
 
17
- ## Examples
11
+ ## Example
18
12
 
19
- **Reading example**: Suppose we have this `config.yaml` content:
13
+ **Reading Example**. Suppose we have this `config.yaml` content:
20
14
 
21
15
  ```yaml
22
16
  ---
@@ -1,13 +1,8 @@
1
1
  [<< back](../README.md)
2
2
 
3
- 1. [Description](#description)
4
- 2. [Usage](#usage)
3
+ # group
5
4
 
6
- ## Description
7
-
8
- Groups targets/goals.
9
-
10
- ## Usage
5
+ Groups targets.
11
6
 
12
7
  ```ruby
13
8
  group "Group name" do
@@ -1,14 +1,9 @@
1
1
  [<< back](../../README.md)
2
2
 
3
- 1. [Description](#description)
4
- 2. [Usage](#usage)
5
-
6
- ## Description
3
+ # play
7
4
 
8
5
  DSL keyword that starts the execution of all targets/goals (defined into groups). We put this instruction at the end of every script, so it begin running the tests over the machines.
9
6
 
10
- ## Usage
11
-
12
7
  ```ruby
13
8
  play do
14
9
  ...
@@ -1,11 +1,6 @@
1
1
  [<< back](../README.md)
2
2
 
3
- 1. [Description](#description)
4
- 2. [Example 1](#example-1)
5
- 3. [Example 2](#example-2)
6
- 4. [Functions](#functions)
7
-
8
- ## Description
3
+ # result
9
4
 
10
5
  **result** object saves the output from previous execution.
11
6
  It is usefull to build advanced `expect result...` sentences.
@@ -1,32 +1,78 @@
1
1
  [<< back](../README.md)
2
2
 
3
- 1. [Description](#description)
4
- 2. [Usage](#usage)
5
- 3. [Examples](#examples)
6
- 4. [Protocol](#protocol)
3
+ # Run
7
4
 
8
- ## Description
5
+ * [Local execution](#local-run)
6
+ * [Remote execution](#remote-run)
9
7
 
10
- Connect to remote host and executes command. The command output is saved into **result** object.
8
+ # Local run
9
+
10
+ Execute command on localhost and save output into result object.
11
+
12
+ ```ruby
13
+ run "id COMMAND"
14
+ ```
15
+
16
+ ## Alias
11
17
 
12
- ## Usage
18
+ In fact it's the same as doing next:
19
+
20
+ ```ruby
21
+ run "COMMAND", on: :localhost
22
+ ```
23
+
24
+ ```ruby
25
+ run "COMMAND", on: 127.0.0.1
26
+ ```
27
+
28
+ ```ruby
29
+ run "COMMAND", on: 'localhost'
30
+ ```
31
+
32
+ ## Example
33
+
34
+ ```ruby
35
+ run "id david"
36
+ ```
37
+
38
+ * This instruction execute "id david" command on local machine, and save results into **result** object.
39
+ * Local machine is where the `Teuton` program is running.
40
+
41
+ ---
42
+ # Remote run
43
+
44
+ Connect to remote host and executes command. The command output is saved into **result** object.
13
45
 
14
46
  ```ruby
15
47
  run "COMMAND", on: :hostID
16
- on :hostID, run: "COMMAND"
17
- goto :hostID, :exec => "COMMAND"
18
48
  ```
19
- > ADVISE: I know that programers dislike `goto` sentence, but this is diferent. Think of it as english speaker, not as developer.
20
49
 
21
50
  * This example connect to remote host identified by `hostID`. Then we execute the command into it and save the output commadn into result object.
22
51
  * Label `hostID` identifies specific machine. Host information (ip, username, password, protocol) cames from config file.
23
52
 
53
+ ## Alias
54
+
55
+ I know that programers dislike `goto` sentence, but this is diferent. Think of it as english speaker, not as developer.
56
+
57
+ ```ruby
58
+ on :hostID, run: "COMMAND"
59
+ ```
60
+
61
+ ```ruby
62
+ goto :hostID, :exec => "COMMAND"
63
+ ```
64
+
24
65
  ## Examples
25
66
 
26
67
  Execute `id obiwan` comand into remote host `:linux1`.
27
68
 
28
- ```Ruby
69
+ ```ruby
29
70
  run "id obiwan", on: :linux1
71
+ ```
72
+
73
+ ## Deprecated
74
+
75
+ ```ruby
30
76
  run "id obiwan", :on => :linux1
31
77
  on :linux1, run: "id obiwan"
32
78
  on :linux1, :run => "id obiwan"
@@ -34,18 +80,6 @@ goto :linux1, exec: "id obiwan"
34
80
  goto :linux1, :exec => "id obiwan"
35
81
  ```
36
82
 
37
- Execute `id yoda` command into `localhost`.
38
-
39
- ```Ruby
40
- run "id yoda"
41
- run "id yoda", on: :localhost
42
- run "id yoda", :on => :localhost
43
- on :localhost, run: "id yoda"
44
- on :localhost, :run => "id yoda"
45
- goto :localhost, :exec => "id yoda"
46
- goto :localhost, :execute => "id yoda"
47
- ```
48
-
49
83
  ## Protocol
50
84
 
51
85
  **SSH connection**
@@ -1,16 +1,9 @@
1
1
  [<< back](../../README.md)
2
2
 
3
- 1. [Description](#description)
4
- 2. [Usage](#usage)
5
- 3. [Parameters](#parameters)
6
- 4. [Send several reports](#send-several-reports)
7
-
8
- ## Description
3
+ # send
9
4
 
10
5
  `send` is used to copy Teuton reports into remote machines.
11
6
 
12
- ## Usage
13
-
14
7
  ```ruby
15
8
  start do
16
9
  export
@@ -1,15 +1,9 @@
1
1
  [<< back](../README.md)
2
2
 
3
- 1. [Description](#description)
4
- 2. [Usage](#usage)
5
- 3. [Example](#example)
6
-
7
- ## Description
3
+ # set
8
4
 
9
5
  `set` create new temporaly param value for running configuration.
10
6
 
11
- ## Usage
12
-
13
7
  ```ruby
14
8
  set(:param1, 'value')
15
9
  ```