Class: TodosExport::StdOut
- Inherits:
-
Object
- Object
- TodosExport::StdOut
- Defined in:
- lib/todos_export/std_out.rb
Instance Attribute Summary collapse
-
#main ⇒ Object
Returns the value of attribute main.
Instance Method Summary collapse
-
#initialize(main) ⇒ StdOut
constructor
A new instance of StdOut.
- #output ⇒ Object
- #process_exportables ⇒ Object
- #run ⇒ Object
Constructor Details
#initialize(main) ⇒ StdOut
Returns a new instance of StdOut.
5 6 7 |
# File 'lib/todos_export/std_out.rb', line 5 def initialize(main) @main = main end |
Instance Attribute Details
#main ⇒ Object
Returns the value of attribute main.
3 4 5 |
# File 'lib/todos_export/std_out.rb', line 3 def main @main end |
Instance Method Details
#output ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# 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 ⇒ Object
48 49 50 51 |
# File 'lib/todos_export/std_out.rb', line 48 def process_exportables say("\n") say(self.output) end |
#run ⇒ Object
9 10 11 |
# File 'lib/todos_export/std_out.rb', line 9 def run process_exportables end |