Method: Bdsync::Lfs#remote_dir_foreach

Defined in:
lib/bdsync/lfs.rb

#remote_dir_foreach(remote_path) ⇒ Object

yield object like this {

name:
attributes: {
    directory?:
    mtime:
}

}



22
23
24
25
26
27
28
29
30
31
# File 'lib/bdsync/lfs.rb', line 22

def remote_dir_foreach remote_path
    Dir.foreach(remote_path) { |filename|
        file_path = "#{remote_path}/#{filename}"

        yield OpenStruct.new name: filename, attributes: OpenStruct.new(
            directory?: File.directory?(file_path),
            mtime: File.mtime(file_path).to_i
        )
    }
end