<% def columnize(arr, col_count) row_count = arr.size / col_count row_count += 1 if arr.size % col_count > 0 cols = arr.each_slice(row_count).to_a cols[0].zip(*cols[1..-1]).map(&:compact) end %>

rails_best_practices output

Please go to http://rails-bestpractices.com to see more useful Rails Best Practices.

<% if @errors.empty? %> No error found. Cool! <% else %> Found <%= @errors.size %> warnings. <% end %>

<% unless @errors.empty? %> <% columnize(@error_types, 3).each do |row| %> <% row.map { |error_type| error_type.split(':').last }.each do |error_type| %> <% end %> <% end %> <% end %>
 
<% if @hg %> <% elsif @git %> <% end %> <% @errors.each do |error| %> <% if @hg %> <% elsif @git %> <% end %> <% end %>
Filename Line Number Warning MessageHg Commit Hg UsernameGit Commit Git Username
<% if @github %> <%= error.short_filename %> <% elsif @textmate %> <%= error.short_filename %> <% elsif @sublime %> <%= error.short_filename %> <% elsif @mvim %> <%= error.short_filename %> <% else %> <%= error.short_filename %> <% end %> <%= error.line_number %> <%= error.message %> <%= error.hg_commit %> <%= error.hg_username %><%= error.git_commit %> <%= error.git_username %>