def ensure_directory
      dir = File.dirname(full_filename)
      unless File.directory?(dir)
        FileUtils.mkdir_p(dir)
      end
    end
def ensure_directory
      dir = File.dirname(full_filename)
      unless File.directory?(dir)
        FileUtils.mkdir_p(dir)
      end
    end
Ensure the directory for the file exists