class TodosExport::StdOut

Attributes

main[RW]

Public Class Methods

new(main) click to toggle source
# File lib/todos_export/std_out.rb, line 5
def initialize(main)
  @main = main
end

Public Instance Methods

output() click to toggle source
# File lib/todos_export/std_out.rb, line 13
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
process_exportables() click to toggle source
# File lib/todos_export/std_out.rb, line 48
def process_exportables
  say("\n")
  say(self.output)
end
run() click to toggle source
# File lib/todos_export/std_out.rb, line 9
def run
  process_exportables
end