Sha256: c0993fd84e1e000c1965255584521c3222f30ffad20199a38310ae87927a48cc
Contents?: true
Size: 822 Bytes
Versions: 26
Compression:
Stored size: 822 Bytes
Contents
desc "show a todolist from all the TODO tags in the source" task :todo do Dir.glob('{lib,spec}/**/*.rb') do |file| lastline = todo = comment = long_comment = false File.readlines(file).each_with_index do |line, lineno| lineno += 1 comment = line =~ /^\s*?#.*?$/ long_comment = line =~ /^=begin/ long_comment = line =~ /^=end/ todo = true if line =~ /TODO|FIXME|THINK/ and (long_comment or comment) todo = false if line.gsub('#', '').strip.empty? todo = false unless comment or long_comment if todo unless lastline and lastline + 1 == lineno puts puts "vim #{file} +#{lineno}" end l = line.strip.gsub(/^#\s*/, '') print ' ' unless l =~ /^-/ puts l lastline = lineno end end end end
Version data entries
26 entries across 26 versions & 7 rubygems