Sha256: ea05ed02b08f64fd623c0a09a50e6f7e74e96c553c8a6da13b4d07673e87bbbc
Contents?: true
Size: 943 Bytes
Versions: 6
Compression:
Stored size: 943 Bytes
Contents
# frozen_string_literal: true require_relative '../services/configuration_loader_service' module Dsu module Support module EntryGroupFileable module_function def entry_group_file_exists? File.exist?(entry_group_file_path) end def entry_group_path_exists? Dir.exist?(entries_folder) end def entry_group_file_path File.join(entries_folder, entries_file_name) end def entries_folder @entries_folder ||= configuration[:entries_folder] end def entries_file_name @entries_file_name ||= time.strftime(configuration[:entries_file_name]) end def create_entry_group_path_if! FileUtils.mkdir_p(entries_folder) unless entry_group_path_exists? end private def configuration @configuration ||= options[:configuration] || Services::ConfigurationLoaderService.new.call end end end end
Version data entries
6 entries across 6 versions & 1 rubygems