miga-base 1.2.5.1 → 1.2.6.0
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/lib/miga/cli/action/add.rb +1 -3
- data/lib/miga/cli/action/get_db.rb +14 -5
- data/lib/miga/common.rb +1 -1
- data/lib/miga/version.rb +2 -2
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: a68d83e5dac07c94aa2bafe0eda06ba074d5b87f9d7bf97e521a5be3e59aa296
         | 
| 4 | 
            +
              data.tar.gz: d9309d82f51e9bfce7cc18c8b32de6ab1491cf1fc3fd9b5af660298490bac2b8
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 9a88c56adfc6fe0b32a708605aca18f798fdfe94a2d4ae62b5dda27b1bd85f8b7d2be4a6fb589c8cd8c56de6c3bdef3b271a2c61112092e01c01058aa7b68f7b
         | 
| 7 | 
            +
              data.tar.gz: d71d65c936ee269d4f7f582f39e680452bf818d4fac827178ccb97ca0b468f5fa0a381148d40b5f92c25b1e57b9a93220e95a510309134b07fe484801cd75210
         | 
    
        data/lib/miga/cli/action/add.rb
    CHANGED
    
    | @@ -121,19 +121,17 @@ class MiGA::Cli::Action::Add < MiGA::Cli::Action | |
| 121 121 | 
             
                  raise 'Some files are duplicated, files must be unique.' if
         | 
| 122 122 | 
             
                    files.size != files.uniq.size
         | 
| 123 123 |  | 
| 124 | 
            -
                  expected_files = 1
         | 
| 125 124 | 
             
                  if cli[:input_type].to_s =~ /_paired$/
         | 
| 126 125 | 
             
                    if files.size.odd?
         | 
| 127 126 | 
             
                      raise 'Odd number of files incompatible with input type.'
         | 
| 128 127 | 
             
                    end
         | 
| 129 128 |  | 
| 130 | 
            -
                    expected_files = 2
         | 
| 131 129 | 
             
                    files = Hash[*files].to_a
         | 
| 132 130 | 
             
                  else
         | 
| 133 131 | 
             
                    files = files.map { |i| [i] }
         | 
| 134 132 | 
             
                  end
         | 
| 135 133 |  | 
| 136 | 
            -
                  if files.size !=  | 
| 134 | 
            +
                  if files.size != 1 && !cli[:dataset].nil?
         | 
| 137 135 | 
             
                    raise 'The dataset name (-D) can only be specified with one input set.'
         | 
| 138 136 | 
             
                  end
         | 
| 139 137 | 
             
                end
         | 
| @@ -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 | 
            -
                 | 
| 96 | 
            -
                  cli. | 
| 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/common.rb
    CHANGED
    
    
    
        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,  | 
| 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,  | 
| 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. | 
| 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- | 
| 11 | 
            +
            date: 2022-05-23 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: daemons
         |