Sha256: f5e60fbde5b1acb15ba2122c0cb007a51ef49ce64792bd96a852277c08769678

Contents?: true

Size: 1.05 KB

Versions: 1

Compression:

Stored size: 1.05 KB

Contents

# frozen_string_literal: true

require 'thor'
require 'evideo/version'
require 'evideo/hrvideo'
require 'evideo/hrvprocessa'

module Evideo
  class Error < StandardError; end
  ID = `whoami`.chomp
  # CLI para analisar/processar videos
  class CLI < Thor
    class_option :d, banner: 'DIR', type: :array,
                     default: ["/home/#{ID}/lust", "/media/#{ID}/hrv2"],
                     desc: 'Onde procurar videos'
    class_option :i, banner: 'IN', default: 'ftv',
                     desc: 'Pasta origem'
    desc 'conv', 'converte videos'
    option :o, banner: 'OUT', default: 'out',
               desc: 'Pasta destino'
    # Processa videos
    def conv
      dar = options[:d]
      Dir.glob("#{dar.first}/#{options[:i]}/*.???").sort.each do |f|
        HRVideo.new(f).processa(dar, dar.first, options[:o])
      end
    end

    desc 'test', 'testa videos'
    # Analisa videos
    def test
      Dir.glob("#{options[:d].first}/#{options[:i]}/*.???").sort.each do |f|
        p HRVideo.new(f).testa
      end
    end
    default_task :conv
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
evideo-0.1.3 lib/evideo.rb