Method: Cnvrg::Dataset#list_all_files

Defined in:
lib/cnvrg/dataset.rb

#list_all_files(with_ignore = false) ⇒ Object



624
625
626
627
628
629
630
631
632
# File 'lib/cnvrg/dataset.rb', line 624

def list_all_files(with_ignore = false)
  list = Dir.glob("#{self.local_path}/**/*", File::FNM_DOTMATCH).reject {|x| (x =~ /\/\.{1,2}$/) or (x =~ /^#{self.local_path}\/\.cnvrg\/*/) or (x =~ /^#{self.local_path}\/\.cnvrgignore.conflict*/) and not (x =~ /^#{self.local_path}\/\.cnvrgignore/)}

  #we want that big files will
  list = list.sort_by {|fn| File.size(fn)}
  return list if with_ignore
  list_ignore = self.get_ignore_list.map {|ignore_file| "#{self.local_path}/#{ignore_file}"}
  (list - list_ignore)
end