Skip to content

Commit

Permalink
Merge pull request #123 from jhoblitt/sort_vhost_cfg_append
Browse files Browse the repository at this point in the history
sort $vhost_cfg_append hash in vhost_footer.erb template
  • Loading branch information
James Fryman committed Sep 3, 2013
2 parents 7cef792 + df42434 commit 43d2e86
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion templates/vhost/vhost_footer.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<% if @include_files %><% @include_files.each do |file| -%>
include <%= file %>;
<% end -%><% end -%>
<% if @vhost_cfg_append -%><% vhost_cfg_append.each do |key,value| -%>
<%# make sure that allow comes before deny by forcing the allow key (if it -%>
<%# exists) to be first in the output order. The hash keys also need to be -%>
<%# sorted so that the ordering is stable. -%>
<% if @vhost_cfg_append -%><% vhost_cfg_append.sort_by{ |k, v| k.to_s == 'allow' ? '' : k.to_s }.each do |key,value| -%>
<%= key %> <%= value %>;
<% end -%>
<% end -%>
Expand Down

0 comments on commit 43d2e86

Please sign in to comment.