lib/eco/data/files/directory.rb in eco-helpers-2.0.51 vs lib/eco/data/files/directory.rb in eco-helpers-2.0.52
- old
+ new
@@ -51,10 +51,10 @@
File.expand_path(@dir_path)
end
def dir_files(file: nil, pattern: dir_pattern)
find = !!file ? file_pattern(file) : file_pattern(pattern)
- Dir.glob(find)
+ Dir.glob(find).sort
end
def newest_file(files_list = nil, file: nil)
files_list = files_list || dir_files(file: file)
return nil unless files_list && files_list.is_a?(Array) && (files_list.length > 0) # files available?