Sha256: db91338d40853b4add3d684d98c094a5754445a56670212d6232107c39509f4b
Contents?: true
Size: 1.34 KB
Versions: 40
Compression:
Stored size: 1.34 KB
Contents
module Eco::API::UseCases::GraphQL::Samples::Location::Service module TreeDiff module Convertible module Inputable class << self def included(base) super(base) base.send :include, Eco::Data::Files end end include Eco::API::UseCases::GraphQL::Helpers::Base::CaseEnv IN_FILENAME = /requested_tree\.csv/.freeze IN_FOLDER = 'sftp'.freeze private def input_encoding options.dig(:input, :file, :encoding) || 'utf-8' end def input_file @input_file ||= (options.dig(:input, :file, :name) || newest_file).tap do |file| if file log(:info) { "Using input file '#{file}'" } else log(:warn) { "Could not find any input file" } exit(1) end end end def newest_file @newest_file ||= csv_files.last end #@note via Eco::Data::Files def csv_files self.class.csv_files(input_folder, regexp: input_file_pattern) end def input_file_pattern self.class::IN_FILENAME end def input_folder "#{config.active_enviro}/#{self.class::IN_FOLDER}" end end end end end
Version data entries
40 entries across 40 versions & 1 rubygems