Class: Faith::Output
- Inherits:
-
Object
- Object
- Faith::Output
- Defined in:
- lib/faith/output.rb
Instance Method Summary collapse
- #dedent ⇒ Object
- #dependencies(task) ⇒ Object
- #indent ⇒ Object
- #indented(x) ⇒ Object
-
#initialize ⇒ Output
constructor
A new instance of Output.
- #mixin(mixin) ⇒ Object
- #mixin_action(action) ⇒ Object
- #run(task) ⇒ Object
- #sequence(task) ⇒ Object
Constructor Details
#initialize ⇒ Output
Returns a new instance of Output.
5 6 7 |
# File 'lib/faith/output.rb', line 5 def initialize @indent_level = 0 end |
Instance Method Details
#dedent ⇒ Object
10 |
# File 'lib/faith/output.rb', line 10 def dedent; @indent_level -= 1; end |
#dependencies(task) ⇒ Object
20 21 22 |
# File 'lib/faith/output.rb', line 20 def dependencies(task) puts indented("#{Rainbow("Dependencies of #{task.full_name} -").purple.bold}") end |
#indent ⇒ Object
9 |
# File 'lib/faith/output.rb', line 9 def indent; @indent_level += 1; end |
#indented(x) ⇒ Object
12 13 14 |
# File 'lib/faith/output.rb', line 12 def indented(x) "#{' ' * @indent_level}#{x}" end |
#mixin(mixin) ⇒ Object
24 25 26 |
# File 'lib/faith/output.rb', line 24 def mixin(mixin) puts indented("#{Rainbow("Mixin #{mixin.full_name} -").blue.bold}") end |
#mixin_action(action) ⇒ Object
32 33 34 |
# File 'lib/faith/output.rb', line 32 def mixin_action(action) puts indented("#{Rainbow(action).dark.bold}") end |
#run(task) ⇒ Object
16 17 18 |
# File 'lib/faith/output.rb', line 16 def run(task) puts indented(Rainbow(task.full_name).bold) end |
#sequence(task) ⇒ Object
28 29 30 |
# File 'lib/faith/output.rb', line 28 def sequence(task) puts indented("#{Rainbow("Sequence #{task.full_name} -").blue.bold}") end |