Sha256: 7871f5a6404b645a4e17941c8f87a2e6fe291aa75530c66eada83725648a6d7c

Contents?: true

Size: 1.1 KB

Versions: 1

Compression:

Stored size: 1.1 KB

Contents

# frozen_string_literal: true

require 'thor'
require 'abank/version'
require 'abank/bigquery'
require 'abank/folhacalculo'

module Abank
  ID = `whoami`.chomp

  class Error < StandardError; end

  # CLI para carregar folhas calculo comuns no bigquery
  class CLI < Thor
    class_option :d, banner: 'DIR',
                     default: "/home/#{ID}/Downloads",
                     desc: 'Onde procurar folhas calculo'
    class_option :x, banner: 'EXT',
                     default: '.xlsx',
                     desc: 'Extensao das folhas calculo'

    desc 'load', 'carrega dados xlsx no bigquery'
    # processa xlsx
    def load
      Dir.glob("#{options[:d]}/*#{options[:x]}").sort.each do |f|
        Bigquery.new(f).processa
      end
    end

    desc 'mostra', 'mostra dados do xlsx'
    # mostra xlsx
    def mostra
      Dir.glob("#{options[:d]}/*#{options[:x]}").sort.each do |f|
        Bigquery.new(f).show
      end
    end

    desc 'classifica', 'classifica arquivo no bigquery'
    # classifica bigquery
    def classifica
      Bigquery.new('').sql_update
    end

    default_task :mostra
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
abank-0.1.1 lib/abank.rb