lib/k_builder/base_builder.rb
# Get target file
#
# If you provide a relative folder, then it will be relative to the :folder parameter
#
# If the :folder is not set, then it will be relative to the current folder
#
# @examples
#   target_file('abc.txt')
#   target_file('xyz/abc.txt')
#   target_file('xyz', 'abc.txt')
#
# If you provide an absolute folder, then it will ignore the :folder parameter
#
# @examples
#   target_file('/abc.txt')
#   target_file('/xyz/abc.txt')
#   target_file('/xyz', 'abc.txt')
Get target file
If you provide a relative folder, then it will be relative to the :folder parameter

If the :folder is not set, then it will be relative to the current folder
Get target file If you provide a relative folder then it will be relative to the : folder parameter If the : folder is not set then it will be relative to the current folder
def target_file(*file_parts, folder_key: current_folder_key, folder: nil, **)
      if folder
        log.error("Change folder: to folder_key: for #{folder} - #{file_parts}")
        return
      end
      return File.join(*file_parts) if Pathname.new(file_parts.first).absolute?
      File.join(target_folder(folder_key), *file_parts)
    end
def target_file ( * file_parts , folder_key : current_folder_key , folder : nil , ** ) if folder log . error ( "Change folder: to folder_key: for #{folder} - #{file_parts}" ) return end return File . join ( * file_parts ) if Pathname . new ( file_parts . first ) . absolute? File . join ( target_folder ( folder_key ) , * file_parts ) end
Get target file
If you provide a relative folder, then it will be relative to the :folder parameter
Get target file If you provide a relative folder then it will be relative to the : folder parameter
# TODO: Mismatch (sometimes called folder, sometimes called folder_key:) # Absolute path # Relative to :folder_key
file_parts
folder_key
current_folder_key
folder
examples
target_file('abc.txt') target_file('xyz/abc.txt') target_file('xyz', 'abc.txt') If you provide an absolute folder, then it will ignore the :folder parameter
target_file ( ' abc . txt ' ) target_file ( ' xyz / abc . txt ' ) target_file ( ' xyz ' ' abc . txt ' ) If you provide an absolute folder then it will ignore the : folder parameter
examples
None