Sha256: ad3044c755045c2bfd645115a0a2f7b9006e26b2ae5b4ae434bf70e5d9331cd7

Contents?: true

Size: 961 Bytes

Versions: 3

Compression:

Stored size: 961 Bytes

Contents

# frozen_string_literal: true

require 'eac_ruby_base0/core_ext'
require 'ehbrs_ruby_utils/music/sort/files/scanner'

module Ehbrs
  module Tools
    class Runner
      class Music
        class Sort
          DEFAULT_PATH = '.'

          runner_with :help, :subcommands do
            desc 'Ordena arquivos/diretórios prefixando-os.'
            arg_opt '-C', '--path', 'Path to the directory.', default: DEFAULT_PATH
            subcommands
          end
          for_context :path, :scanner, :config_file

          # @return [Pathname]
          delegate :config_file, to: :scanner

          # @return [Pathname]
          def path
            parsed.path.to_pathname
          end

          private

          # @return [EhbrsRubyUtils::Music::Sort::Files::Scanner]
          def scanner_uncached
            ::EhbrsRubyUtils::Music::Sort::Files::Scanner.new(path)
          end

          require_sub __FILE__
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ehbrs-tools-0.43.1 lib/ehbrs/tools/runner/music/sort.rb
ehbrs-tools-0.43.0 lib/ehbrs/tools/runner/music/sort.rb
ehbrs-tools-0.42.0 lib/ehbrs/tools/runner/music/sort.rb