Class: Gitenv::Renderer

Inherits:
Object
  • Object
show all
Defined in:
lib/gitenv/renderer.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Renderer

Returns a new instance of Renderer.



6
7
8
# File 'lib/gitenv/renderer.rb', line 6

def initialize options = {}
  @options = options
end

Instance Method Details

#render(action) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/gitenv/renderer.rb', line 10

def render action

  status = action.status
  color = status.color
  error = if !status.ok?
    "\n   #{Paint[status.message, color]}"
  end

  " #{Paint[status.marker, color]} #{action}#{error}"
end