teuton-get 0.2.2 → 0.2.4
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 +54 -5
- data/docs/repo.md +4 -0
- data/lib/teuton-get/cli.rb +28 -23
- data/lib/teuton-get/downloader.rb +6 -2
- data/lib/teuton-get/searcher.rb +1 -1
- data/lib/teuton-get/version.rb +1 -1
- data/lib/teuton-get.rb +1 -1
- metadata +22 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e4eb8c07592d9ac7fab0d078f36beb00fc99f1af956e36afc252ac4123196b8
|
4
|
+
data.tar.gz: 3fe1c50fe7661a1d19ba55c9bc0042192ff71312efa2941e09fe6cbe35ba8457
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f725fb58bd581c3e1a2bc5831eeeba8210926e878eed080a64a7a6953283b5a853d041e2af233b9622ed2b9f22365f007a3312458f11a127d05e0fe19b8c3226
|
7
|
+
data.tar.gz: 468cf2cbe58365390aa6510d62fb214ab93e649f43356e61ad25a1b5ef56313a11f88b058a6ad5f74f268e837441dde3f49758b7b88e09c8e0562f994c58922f
|
data/README.md
CHANGED
@@ -15,19 +15,68 @@
|
|
15
15
|
# Use
|
16
16
|
|
17
17
|
1. `teutonget init`, at first, create config file.
|
18
|
-
1. `teutonget
|
18
|
+
1. `teutonget refresh`, to refresh repo catalog.
|
19
|
+
1. `teutonget search FILTER`. then, search tests.
|
19
20
|
1. `teutonget download REPONAME:TESTPATH`, download test files.
|
20
21
|
|
21
|
-
##
|
22
|
+
## Examples
|
22
23
|
|
23
|
-
|
24
|
+
**Example 1: search and download**
|
24
25
|
|
25
|
-
|
26
|
+
* Create config files:
|
27
|
+
|
28
|
+
```
|
29
|
+
> teutonget init
|
30
|
+
|
31
|
+
==> Creating configuration files
|
32
|
+
✔ Create dir : /home/quigon/.config/teuton
|
33
|
+
✔ Create file : /home/quigon/.config/teuton/repos.ini
|
34
|
+
```
|
35
|
+
|
36
|
+
* Refresh repo catalog:
|
37
|
+
|
38
|
+
```
|
39
|
+
> teutonget refresh
|
40
|
+
|
41
|
+
==> Refreshing active repos
|
42
|
+
✔ Repo teuton.en (10 tests)
|
43
|
+
✔ Repo teuton.es (4 tests)
|
44
|
+
```
|
45
|
+
|
46
|
+
* Search test:
|
47
|
+
|
48
|
+
```
|
49
|
+
> teutonget search usermin
|
50
|
+
(x3) teuton.es:sistemas.3/scripting/usermin
|
51
|
+
```
|
52
|
+
|
53
|
+
* Show details:
|
54
|
+
|
55
|
+
```
|
56
|
+
> teutonget info teuton.es:sistemas.3/scripting/usermin
|
57
|
+
|
58
|
+
name : usermin
|
59
|
+
author : fvarrui, dvarrui
|
60
|
+
date : 2022-11-05
|
61
|
+
desc : Usermin. Script para la gestión de usuarios
|
62
|
+
tags : script, usuario, crear, consultar, listar, eliminar
|
63
|
+
files : INSTALL.md, README.md, bin/docker.run, bin/up_environ.sh, config.yaml, lib/docker/consultar.rb, lib/docker/eliminar.rb, lib/docker/help.rb, lib/docker/listar.rb, lib/docker/nuevo.rb, lib/vm/consultar.rb, lib/vm/eliminar.rb, lib/vm/help.rb, lib/vm/listar.rb, lib/vm/nuevo.rb, start.rb, tt-info.yaml, vagrant/install-software.sh, vagrant/profesor.rb, vm.rb, vm.yaml
|
64
|
+
```
|
26
65
|
|
27
66
|
* Download test:
|
28
67
|
|
29
|
-
|
68
|
+
```
|
69
|
+
> teutonget download teuton.es:sistemas.3/scripting/usermin
|
70
|
+
|
71
|
+
==> Progress [█████████████████████] 100%
|
72
|
+
==> Download OK
|
73
|
+
```
|
74
|
+
|
75
|
+
**Example 2: Locate TEST ID**
|
76
|
+
|
77
|
+
Teuton test ID (TESTID) is `REPONAME:TESTPATH`.
|
30
78
|
|
79
|
+

|
31
80
|
|
32
81
|
# Contact
|
33
82
|
|
data/docs/repo.md
CHANGED
@@ -65,6 +65,7 @@ Example:
|
|
65
65
|
|
66
66
|
```
|
67
67
|
[REPONAME]
|
68
|
+
type = teutontest
|
68
69
|
description = WRITE REPO DESCRIPTION
|
69
70
|
URL = https://write.here/your/repo/url
|
70
71
|
enable = true
|
@@ -72,6 +73,8 @@ enable = true
|
|
72
73
|
|
73
74
|
* Run `teutonget repos` to check configuration.
|
74
75
|
|
76
|
+
> Every repo is showed with different color automatically.
|
77
|
+
|
75
78
|
## 4. Configure local repository
|
76
79
|
|
77
80
|
The usual thing will be to have remote repositories from where to download the tests. This process requires a network connection between our local machine and the remote repository.
|
@@ -85,6 +88,7 @@ Example:
|
|
85
88
|
|
86
89
|
```
|
87
90
|
[LOCALREPONAME]
|
91
|
+
type = teutontest
|
88
92
|
description = WRITE LOCAL REPO DESCRIPTION
|
89
93
|
URL = /path/to/your/local/repo/folder
|
90
94
|
enable=true
|
data/lib/teuton-get/cli.rb
CHANGED
@@ -6,56 +6,59 @@ require_relative "version"
|
|
6
6
|
require_relative "../teuton-get"
|
7
7
|
|
8
8
|
class CLI < Thor
|
9
|
-
map ["
|
9
|
+
map ["-help", "--help"] => "help"
|
10
10
|
|
11
|
-
map ["
|
11
|
+
map ["-version", "--version"] => "version"
|
12
12
|
desc "version", "Show the program version"
|
13
13
|
|
14
14
|
def version
|
15
15
|
puts "#{Version::EXECUTABLE} (version #{Version::VERSION})"
|
16
16
|
end
|
17
17
|
|
18
|
-
map ["ci", "-ci", "--create-info"] => "create_info"
|
18
|
+
map ["ci", "-ci", "--create-info", "create-info"] => "create_info"
|
19
19
|
desc "create-info [DIRPATH]", "Create info data for Teuton test"
|
20
20
|
long_desc <<-LONGDESC
|
21
|
-
|
21
|
+
Create info data for Teuton test. Example: "teutonget create-info systems.1/02-opensuse-conf"
|
22
22
|
LONGDESC
|
23
|
+
|
23
24
|
def create_info(testpath)
|
24
25
|
TeutonGet.create_info(testpath)
|
25
26
|
end
|
26
27
|
|
27
|
-
map ["
|
28
|
-
desc "info TESTID", "Show info data for Teuton test"
|
29
|
-
long_desc <<-LONGDESC
|
30
|
-
Show info data for Teuton test.
|
31
|
-
LONGDESC
|
32
|
-
def info(test_id)
|
33
|
-
TeutonGet.show_info(test_id)
|
34
|
-
end
|
35
|
-
|
36
|
-
map ["cr", "-cr", "--create-repo"] => "create_repo"
|
28
|
+
map ["cr", "-cr", "--create-repo", "create-repo"] => "create_repo"
|
37
29
|
desc "create-repo", "Create repo into current directory"
|
38
30
|
long_desc <<-LONGDESC
|
39
|
-
|
31
|
+
Create index from SOURCE directory. Example: "teutonget create-repo"
|
40
32
|
LONGDESC
|
41
33
|
def create_repo
|
42
34
|
TeutonGet.create_repo(".")
|
43
35
|
end
|
44
36
|
|
45
|
-
map ["
|
37
|
+
map ["--init"] => "init"
|
46
38
|
desc "init", "Create ini config file"
|
47
39
|
long_desc <<-LONGDESC
|
48
|
-
Create ini config file
|
40
|
+
Create ini config file. Example: "teutonget init"
|
49
41
|
LONGDESC
|
50
42
|
def init
|
51
43
|
TeutonGet.init
|
52
44
|
end
|
53
45
|
|
46
|
+
map ["i", "-i", "--info"] => "info"
|
47
|
+
desc "info TESTID", "Show info data for Teuton test"
|
48
|
+
long_desc <<-LONGDESC
|
49
|
+
Show info data for Teuton test. Example: "teutonget info teuton.en:systems.1/02-opensuse-conf"
|
50
|
+
LONGDESC
|
51
|
+
|
52
|
+
def info(test_id)
|
53
|
+
TeutonGet.show_info(test_id)
|
54
|
+
end
|
55
|
+
|
54
56
|
map ["--repos"] => "repos"
|
55
57
|
desc "repos", "Show repo list"
|
56
58
|
long_desc <<-LONGDESC
|
57
|
-
Show repo list.
|
59
|
+
Show repo list. Example: "teutonget repos"
|
58
60
|
LONGDESC
|
61
|
+
|
59
62
|
def repos
|
60
63
|
TeutonGet.show_repo_list
|
61
64
|
end
|
@@ -63,7 +66,7 @@ class CLI < Thor
|
|
63
66
|
map ["r", "-r", "--refresh"] => "refresh"
|
64
67
|
desc "refresh", "Synchronize list of available tests."
|
65
68
|
long_desc <<-LONGDESC
|
66
|
-
Synchronize list of tests available.
|
69
|
+
Synchronize list of tests available. Example: "teutonget refresh"
|
67
70
|
LONGDESC
|
68
71
|
def refresh
|
69
72
|
TeutonGet.refresh
|
@@ -72,18 +75,20 @@ class CLI < Thor
|
|
72
75
|
map ["s", "-s", "--search"] => "search"
|
73
76
|
desc "search [REPONAME:]FILTER", "Search Teuton test with FILTER"
|
74
77
|
long_desc <<-LONGDESC
|
75
|
-
|
78
|
+
Search Teuton test using FILTER. Example: "teutonget search opensuse"
|
76
79
|
LONGDESC
|
77
80
|
def search(filter)
|
78
81
|
TeutonGet.search(filter)
|
79
82
|
end
|
80
83
|
|
81
|
-
map ["d", "-d", "--download"] => "download"
|
84
|
+
map ["d", "-d", "--download", "clone", "--clone"] => "download"
|
85
|
+
# option :dirname # FIXME
|
82
86
|
desc "download TESTID", "Download Teuton test"
|
83
87
|
long_desc <<-LONGDESC
|
84
|
-
Download Teuton test. Example: "teutonget
|
88
|
+
Download Teuton test. Example: "teutonget download teuton.en:systems.1/02-opensuse-conf"
|
85
89
|
LONGDESC
|
86
90
|
def download(testname)
|
87
|
-
|
91
|
+
puts options unless options.empty?
|
92
|
+
TeutonGet.download(testname, options)
|
88
93
|
end
|
89
94
|
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require "fileutils"
|
2
|
+
require "tty-progressbar"
|
2
3
|
require_relative "writer/file_writer"
|
3
4
|
require_relative "writer/terminal_writer"
|
4
5
|
require_relative "reader/inifile_reader"
|
@@ -56,16 +57,19 @@ class Downloader
|
|
56
57
|
end
|
57
58
|
|
58
59
|
def download(reponame, url, path, files)
|
59
|
-
|
60
|
+
bar = TTY::ProgressBar.new("==> Progress [:bar] :percent", total: files.size, bar_format: :block)
|
61
|
+
|
60
62
|
localpath = path.tr("/", "_")
|
61
63
|
FileUtils.mkdir(localpath) unless File.exist? localpath
|
62
64
|
files.each do |filename|
|
63
|
-
|
65
|
+
bar.advance
|
66
|
+
|
64
67
|
uri = "#{url}/#{path}/#{filename}"
|
65
68
|
out = FileWriter.new
|
66
69
|
out.open(File.join(localpath, filename))
|
67
70
|
out.write(URLReader.new(uri).read)
|
68
71
|
out.close
|
69
72
|
end
|
73
|
+
@dev.writeln "==> Download OK", color: :white
|
70
74
|
end
|
71
75
|
end
|
data/lib/teuton-get/searcher.rb
CHANGED
@@ -33,7 +33,7 @@ class Searcher
|
|
33
33
|
|
34
34
|
def show_result
|
35
35
|
@results.each do |i|
|
36
|
-
@dev.write "(x
|
36
|
+
@dev.write ("(x%02d) " % i[:score]), color: :white
|
37
37
|
reponame = TeutonGet::Format.colorize(i[:reponame], i[:repoindex])
|
38
38
|
@dev.writeln "#{reponame}#{Application::SEPARATOR}#{i[:testname]}"
|
39
39
|
end
|
data/lib/teuton-get/version.rb
CHANGED
data/lib/teuton-get.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: teuton-get
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
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: 2022-11-
|
11
|
+
date: 2022-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: inifile
|
@@ -30,14 +30,28 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.8
|
33
|
+
version: '0.8'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.8
|
40
|
+
version: '0.8'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: tty-progressbar
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.18'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.18'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: tty-prompt
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,14 +86,14 @@ dependencies:
|
|
72
86
|
requirements:
|
73
87
|
- - "~>"
|
74
88
|
- !ruby/object:Gem::Version
|
75
|
-
version: '1.
|
89
|
+
version: '1.2'
|
76
90
|
type: :runtime
|
77
91
|
prerelease: false
|
78
92
|
version_requirements: !ruby/object:Gem::Requirement
|
79
93
|
requirements:
|
80
94
|
- - "~>"
|
81
95
|
- !ruby/object:Gem::Version
|
82
|
-
version: '1.
|
96
|
+
version: '1.2'
|
83
97
|
description: " Find and download Teuton Test.\n"
|
84
98
|
email: teuton.software@protonmail.com
|
85
99
|
executables:
|
@@ -138,14 +152,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
138
152
|
requirements:
|
139
153
|
- - ">="
|
140
154
|
- !ruby/object:Gem::Version
|
141
|
-
version:
|
155
|
+
version: 3.0.4
|
142
156
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
143
157
|
requirements:
|
144
158
|
- - ">="
|
145
159
|
- !ruby/object:Gem::Version
|
146
160
|
version: '0'
|
147
161
|
requirements: []
|
148
|
-
rubygems_version: 3.
|
162
|
+
rubygems_version: 3.2.33
|
149
163
|
signing_key:
|
150
164
|
specification_version: 4
|
151
165
|
summary: TeutonGet (Teuton Software)
|