Module: Mundane::FileWorker

Included in:
FilesToZips, Prompter, ZipsToFiles
Defined in:
lib/mundane/file_worker.rb

Instance Method Summary collapse

Instance Method Details

#count_targeted_filesObject



17
18
19
# File 'lib/mundane/file_worker.rb', line 17

def count_targeted_files
  get_files_in_current_folder.count
end

#get_files_in_current_folderObject



8
9
10
11
12
13
14
15
# File 'lib/mundane/file_worker.rb', line 8

def get_files_in_current_folder
  files = []
  Dir.foreach(".") do |f|
    next if File.directory?(f) # or f == __FILE__       # skip directory names and the script we're running...
    files << f
  end
  return files
end

#make_output_directoryObject



4
5
6
# File 'lib/mundane/file_worker.rb', line 4

def make_output_directory
  Dir.mkdir("out") unless Dir.exists?("out")
end