Sha256: 9c5300c388614ac16437268f4a9026d7233635a845251f5a9788e7bf1fed8c2e
Contents?: true
Size: 754 Bytes
Versions: 17
Compression:
Stored size: 754 Bytes
Contents
class ListTask def initialize(format_string = "%s") @format_string = format_string end def run(files) all_files = files[:all] mofified_files = files[:filtered] return { :state => :success, :title => 'List', :first => mofified_files.length == 1 ? mofified_files[0] : '%s files.' % mofified_files.length, :detail => get_detail(mofified_files) } end def get_detail(paths) detail = "" limit = [paths.length - 1, 14].min (0..limit).each do |i| path = paths[i] detail += (@format_string % path) detail += "\n" end if limit < paths.length - 1 detail += " - Plus #{(paths.length - 1) - limit} more files." end return detail end end
Version data entries
17 entries across 17 versions & 2 rubygems