Sha256: 800dad296d2beb68f713ba875bd58fe8d419ee8f420d2bd35d6196f52773d2ea

Contents?: true

Size: 961 Bytes

Versions: 10

Compression:

Stored size: 961 Bytes

Contents

# frozen_string_literal: true

require 'ehbrs_ruby_utils/music/ous/album'
require 'ehbrs_ruby_utils/circular_list_spreader'
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::CircularListSpreader.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

10 entries across 10 versions & 1 rubygems

Version Path
ehbrs-tools-0.39.1 lib/ehbrs/tools/runner/music/spread.rb
ehbrs-tools-0.39.0 lib/ehbrs/tools/runner/music/spread.rb
ehbrs-tools-0.38.0 lib/ehbrs/tools/runner/music/spread.rb
ehbrs-tools-0.37.0 lib/ehbrs/tools/runner/music/spread.rb
ehbrs-tools-0.36.0 lib/ehbrs/tools/runner/music/spread.rb
ehbrs-tools-0.35.1 lib/ehbrs/tools/runner/music/spread.rb
ehbrs-tools-0.35.0 lib/ehbrs/tools/runner/music/spread.rb
ehbrs-tools-0.34.0 lib/ehbrs/tools/runner/music/spread.rb
ehbrs-tools-0.33.0 lib/ehbrs/tools/runner/music/spread.rb
ehbrs-tools-0.32.0 lib/ehbrs/tools/runner/music/spread.rb