Sha256: 8156f89594a2b861941be604088dc58338b3de23c0aadbe8f414ad3587fb12d0

Contents?: true

Size: 820 Bytes

Versions: 4

Compression:

Stored size: 820 Bytes

Contents

require 'thor'

require_relative 'merger'
require_relative 'utils'
require_relative 'base'

module Kishu
  class Log < Thor

  include Kishu::Base
  include Kishu::Merger
  include Kishu::Utils


   desc "create logs", "create logs"
   method_option :logs_bucket,   :default => ENV['S3_RESOLUTION_LOGS_BUCKET']
   method_option :output_bucket, :default => ENV['S3_MERGED_LOGS_BUCKET']
   method_option :month_year,    :type => :string, :default => "201804"

   def create
      return "Logs don't exist" unless File.directory?(options[:month_year])
      return "Pipeline has events" unless Pipeline.new.is_empty?
      @log_date = get_date options[:month_year]
      @folder   = options[:month_year]  
      puts @log_date
      uncompress_files
      # add_bookends
      merge_files
      sort_files
   end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
kishu-1.0.1 lib/kishu/log.rb
kishu-1.0.0 lib/kishu/log.rb
kishu-0.0.1 lib/kishu/log.rb
kishu-0.0.0 lib/kishu/log.rb