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.



3
4
5
# File 'lib/gitenv/renderer.rb', line 3

def initialize(options = {})
  @options = options
end

Instance Method Details

#render(action) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/gitenv/renderer.rb', line 7

def render(action)
  status = action.status
  color = status.color
  error = ("\n   #{Paint[status.message, color]}" unless status.ok?)

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