miga-base 1.2.5.3 → 1.2.6.0

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: c0eca4dbad780bdf6cc4a739ee17fd38d23e2cca6502f8dc8d656755e4d40431
4
- data.tar.gz: 18a6f228cb63c068483e82c9b857cd11ba3cffe7bf6168e8ba12c88541e6aa74
3
+ metadata.gz: a68d83e5dac07c94aa2bafe0eda06ba074d5b87f9d7bf97e521a5be3e59aa296
4
+ data.tar.gz: d9309d82f51e9bfce7cc18c8b32de6ab1491cf1fc3fd9b5af660298490bac2b8
5
5
  SHA512:
6
- metadata.gz: a5955cd677402862aeb06b96246091fe511092cede22fe32027e235713683c4adfcaa2935e0b9221e856346e5c4dd241fffa42ab7b5c89d4c14facd3b49ca71d
7
- data.tar.gz: 7116fb4803c97b790fea7b62199f24e24d120cc7c19358134e0065d18ca03943fdccb486c63cd96fbe64fe95d880f1639834b4b4e29c3900fdb575988deb0c27
6
+ metadata.gz: 9a88c56adfc6fe0b32a708605aca18f798fdfe94a2d4ae62b5dda27b1bd85f8b7d2be4a6fb589c8cd8c56de6c3bdef3b271a2c61112092e01c01058aa7b68f7b
7
+ data.tar.gz: d71d65c936ee269d4f7f582f39e680452bf818d4fac827178ccb97ca0b468f5fa0a381148d40b5f92c25b1e57b9a93220e95a510309134b07fe484801cd75210
@@ -12,6 +12,7 @@ class MiGA::Cli::Action::GetDb < MiGA::Cli::Action
12
12
  local: File.expand_path('.miga_db', ENV['MIGA_HOME']),
13
13
  host: MiGA::MiGA.known_hosts(:miga_db),
14
14
  pb: true,
15
+ reuse_archive: false,
15
16
  overwrite: true
16
17
  }
17
18
  cli.parse do |opt|
@@ -39,6 +40,10 @@ class MiGA::Cli::Action::GetDb < MiGA::Cli::Action
39
40
  '--list-versions',
40
41
  'List available versions of the database and exit'
41
42
  ) { |v| cli[:list_versions] = v }
43
+ opt.on(
44
+ '--reuse-archive',
45
+ 'Reuse a previously downloaded archive if available'
46
+ ) { |v| cli[:reuse_archive] = v }
42
47
  opt.on(
43
48
  '--no-overwrite',
44
49
  'Exit without downloading if the target database already exists'
@@ -67,7 +72,7 @@ class MiGA::Cli::Action::GetDb < MiGA::Cli::Action
67
72
  check_target and return
68
73
 
69
74
  # Download and expand
70
- file = download_file(@ftp, ver[:path])
75
+ file = download_file(@ftp, ver[:path], cli[:reuse_archive])
71
76
  check_digest(ver, file)
72
77
  unarchive(file)
73
78
  register_database(manif, db, ver)
@@ -89,13 +94,17 @@ class MiGA::Cli::Action::GetDb < MiGA::Cli::Action
89
94
  MiGA::MiGA.remote_connection(cli[:host])
90
95
  end
91
96
 
92
- def download_file(ftp, path)
97
+ def download_file(ftp, path, reuse = false)
93
98
  cli.say "Downloading '#{path}'"
94
99
  file = File.expand_path(path, cli[:local])
95
- MiGA::MiGA.download_file_ftp(ftp, path, file) do |n, size|
96
- cli.advance("#{path}:", n, size) if cli[:pb]
100
+ if reuse && File.exist?(file)
101
+ cli.say "Reusing #{file}"
102
+ else
103
+ MiGA::MiGA.download_file_ftp(ftp, path, file) do |n, size|
104
+ cli.advance("#{path}:", n, size) if cli[:pb]
105
+ end
106
+ cli.print "\n" if cli[:pb]
97
107
  end
98
- cli.print "\n" if cli[:pb]
99
108
  file
100
109
  end
101
110
 
data/lib/miga/version.rb CHANGED
@@ -12,7 +12,7 @@ module MiGA
12
12
  # - String indicating release status:
13
13
  # - rc* release candidate, not released as gem
14
14
  # - [0-9]+ stable release, released as gem
15
- VERSION = [1.2, 5, 3].freeze
15
+ VERSION = [1.2, 6, 0].freeze
16
16
 
17
17
  ##
18
18
  # Nickname for the current major.minor version.
@@ -20,7 +20,7 @@ module MiGA
20
20
 
21
21
  ##
22
22
  # Date of the current gem relese.
23
- VERSION_DATE = Date.new(2022, 5, 19)
23
+ VERSION_DATE = Date.new(2022, 5, 23)
24
24
 
25
25
  ##
26
26
  # References of MiGA
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: miga-base
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.5.3
4
+ version: 1.2.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luis M. Rodriguez-R
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-19 00:00:00.000000000 Z
11
+ date: 2022-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: daemons