Module: Mundane::FileWorker
- Included in:
- FilesToZips, Prompter, ZipsToFiles
- Defined in:
- lib/mundane/file_worker.rb
Instance Method Summary collapse
- #count_targeted_files ⇒ Object
- #get_files_in_current_folder ⇒ Object
- #make_output_directory ⇒ Object
Instance Method Details
#count_targeted_files ⇒ Object
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_folder ⇒ Object
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_directory ⇒ Object
4 5 6 |
# File 'lib/mundane/file_worker.rb', line 4 def make_output_directory Dir.mkdir("out") unless Dir.exists?("out") end |