Skip to content

Instantly share code, notes, and snippets.

@clifferson
Created August 16, 2012 11:26
Show Gist options
  • Save clifferson/3369464 to your computer and use it in GitHub Desktop.
Save clifferson/3369464 to your computer and use it in GitHub Desktop.
Put a comma after each line except the last when generating a template in chef
rack_map = {
<% counter = @options.size %>
<% @options.each do |key, value| %>
<% counter -= 1 %>
'<%= key %>' => '<%= value %>'<%= ',' unless counter == 0 %>
<% end %>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment