Skip to content

Commit

Permalink
Wrap around to the first colour when all the colours are used
Browse files Browse the repository at this point in the history
  • Loading branch information
craigw authored and ddollar committed Jan 16, 2012
1 parent c1f279a commit 7132cac
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/foreman/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ def process_by_reader(reader)
def next_color
@current_color ||= -1
@current_color += 1
@current_color >= COLORS.length ? "" : COLORS[@current_color]
@current_color = 0 if COLORS.length < @current_color
COLORS[@current_color]
end

module Env
Expand Down

0 comments on commit 7132cac

Please sign in to comment.