Sha256: 794b68947534725b955d6aa6ae31d0a3d5f133df7ac4f95e8b8e990e9c63fa6a

Contents?: true

Size: 940 Bytes

Versions: 3

Compression:

Stored size: 940 Bytes

Contents

# frozen_string_literal: true

require 'ehbrs_ruby_utils/music/ous/album'
require 'ehbrs_ruby_utils/spreader_t1'
require 'ehbrs/tools/runner/fs/selected'

module Ehbrs
  module Tools
    class Runner
      class Music
        class Spread
          runner_with :help do
            bool_opt '-i', '--ids', 'Escreve IDs em STDOUT no lugar de labels em STDERR.'
            pos_arg :albums, repeat: true
          end

          def run
            spreader.result.each do |album|
              if parsed.ids?
                out("#{album.id}\n")
              else
                puts album.to_label
              end
            end
          end

          def spreader_uncached
            ::EhbrsRubyUtils::SpreaderT1.new(albums)
          end

          def albums
            parsed.albums.map do |path|
              ::EhbrsRubyUtils::Music::Ous::Album.new(path)
            end
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ehbrs-tools-0.31.1 lib/ehbrs/tools/runner/music/spread.rb
ehbrs-tools-0.31.0 lib/ehbrs/tools/runner/music/spread.rb
ehbrs-tools-0.30.0 lib/ehbrs/tools/runner/music/spread.rb