teuton-get 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fbdff5b1a781df1aeb1ddb23fc43b504787f0a43a255d44e72fcea0789e92f99
4
- data.tar.gz: f557290df95c13818dcfce2d79756cead6c757ed320261a046a7cff0c5a8b955
3
+ metadata.gz: b783cab2c10f1a23f61fe5b8e53e108dcce79fb8b97a0ab1a717b4244a0f193c
4
+ data.tar.gz: 576048fe21ce48012784d2ff48ba21198f94d63cff33f55d8091a5dc137947e4
5
5
  SHA512:
6
- metadata.gz: 3745b13fb5ae095f5c1b87c39ac9471795ee39dff9f844a96012ce4ac613971237f122504828f6cfd21189394545acd22fa452187b28daf72f2a70abc116cd16
7
- data.tar.gz: 17448758d158b88b1370b45dffe0bc7310c2e5c3efd8ecff7a90b35b4358a729c1857e289dca68758be2d47c6a27e4fa6f948dc99e7597005dd06aca763682f7
6
+ metadata.gz: 93a9660d795aabc86399f2a7393175b07359ff22294d9c66487367478dd234fbf93f764a5c9310c89fb2de176876a9a7860acb74081e5a9cc1e7919d4eea4493
7
+ data.tar.gz: 4bc2009d8d715113336b0970beef9d4e92b949c48689358d328238dcc851aa88747d6ee6d4efe86c54ed2a1beeb212f0d51c94670ba9604f28fef4084dc5eae1
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 search FILTER`. then, search tests. Example: `teutonget search linux`, will show a list with "linux" related tests.
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
- ## Example
22
+ ## Examples
22
23
 
23
- * Search test and show details:
24
+ **Example 1: search and download**
24
25
 
25
- ![](docs/images/teutonget-info.png)
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
- ![](docs/images/teutonget-download.png)
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
+ ![](docs/images/teutonget-search-debian.png)
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
@@ -6,56 +6,59 @@ require_relative "version"
6
6
  require_relative "../teuton-get"
7
7
 
8
8
  class CLI < Thor
9
- map ["h", "-h", "--help"] => "help"
9
+ map ["-help", "--help"] => "help"
10
10
 
11
- map ["v", "-v", "--version"] => "version"
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
- Create info data for Teuton test.
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 ["i", "-i", "--info"] => "info"
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
- Create index from SOURCE directory.
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 ["i", "-i", "--init"] => "init"
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
- Search Teuton test with FILTER.
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 main@system/opensuse"
88
+ Download Teuton test. Example: "teutonget download teuton.en:systems.1/02-opensuse-conf"
85
89
  LONGDESC
86
90
  def download(testname)
87
- TeutonGet.download(testname)
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
- @dev.writeln "==> Downloading '#{path}' from repo '#{reponame}'...", color: :light_yellow
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
- @dev.writeln "==> File: #{filename} ", color: :white
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
@@ -33,7 +33,7 @@ class Searcher
33
33
 
34
34
  def show_result
35
35
  @results.each do |i|
36
- @dev.write "(x#{i[:score]}) ", color: :white
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
@@ -1,6 +1,6 @@
1
1
  module Version
2
2
  NAME = "teuton-get"
3
3
  EXECUTABLE = "teutonget"
4
- VERSION = "0.2.2"
4
+ VERSION = "0.2.3"
5
5
  HOMEPAGE = "https://github.com/teuton-software/#{NAME}"
6
6
  end
data/lib/teuton-get.rb CHANGED
@@ -17,7 +17,7 @@ module TeutonGet
17
17
  end
18
18
 
19
19
  # Download remote teuton test
20
- def self.download(test_id)
20
+ def self.download(test_id, options)
21
21
  Downloader.new.run(test_id)
22
22
  end
23
23
 
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.2
4
+ version: 0.2.3
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-15 00:00:00.000000000 Z
11
+ date: 2022-11-22 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.1
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.1
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.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.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,7 +152,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
138
152
  requirements:
139
153
  - - ">="
140
154
  - !ruby/object:Gem::Version
141
- version: 2.5.0
155
+ version: 2.5.9
142
156
  required_rubygems_version: !ruby/object:Gem::Requirement
143
157
  requirements:
144
158
  - - ">="