Class: Faith::Output

Inherits:
Object
  • Object
show all
Defined in:
lib/faith/output.rb

Instance Method Summary collapse

Constructor Details

#initializeOutput

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

#dedentObject



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

#indentObject



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