Sha256: ca3eeb231f40c7ee1e605611cc7e0070986d6acd2919b1dadeeda5786ffe590d

Contents?: true

Size: 1.08 KB

Versions: 1

Compression:

Stored size: 1.08 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, options[:o], dar.first)
      end
    end

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
evideo-0.1.4 lib/evideo.rb