module TodosExport class StdOut attr_accessor :main def initialize(main) @main = main end def run process_exportables end def output out = '' todos = self.main.exportable_todos if todos.size > 0 out = "Todos\n=====" todos.each do |ex| out += "\n- #{ex[:content]}" out += "\n <%= color(\"#{ex[:original_file]}:#{ex[:line]}\", :green) %>" end end fixmes = self.main.exportable_fixmes if fixmes.size > 0 out += "\n\nFixmes\n======" fixmes.each do |ex| out += "\n- #{ex[:content]}" out += "\n <%= color(\"#{ex[:original_file]}:#{ex[:line]}\", :green) %>" end end bugs = self.main.exportable_bugs if bugs.size > 0 out += "\n\nBugs\n====" bugs.each do |ex| out += "\n- #{ex[:content]}" out += "\n <%= color(\"#{ex[:original_file]}:#{ex[:line]}\", :green) %>" end end return out end def process_exportables say("\n") say(self.output) end end end