Method: Condition::Reader::ConvertSheet#convert_dir

Defined in:
lib/condition/reader/convert_sheet.rb

#convert_dir(path, with_dir_name: true, file_name: nil) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
# File 'lib/condition/reader/convert_sheet.rb', line 29

def convert_dir(path, with_dir_name: true, file_name: nil)
  basename = File.basename(path)
  Dir::entries(path).each do |f|
    next if "." == f || ".." == f || /^\.~lock\.[^.]+\.ods.$/ =~ f
    if !file_name.nil?
      next if f != file_name
    end
    prefix = with_dir_name ? basename : nil
    convert_file("#{path}/#{f}", prefix: prefix)
  end
end