<% if @_directories and ! @_directories.empty? -%>
<%- Array(@_directories).each do |directory| -%>
<%- if directory['path'] and directory['path'] != ''-%>
<Directory <%= directory['path'] %>>
<%- if directory['options'] -%>
Options <%= Array(directory['options']).join(' ') %>
<%- end -%>
<%- if directory['allow_override'] -%>
AllowOverride <%= Array(directory['allow_override']).join(' ') %>
<%- else -%>
AllowOverride None
<%- end -%>
<%- if directory['order'] and directory['order'] != '' -%>
Order <%= Array(directory['order']).join(',') %>
<%- else -%>
Order allow,deny
<%- end -%>
<%- if directory['deny'] and directory['deny'] != '' -%>
Deny <%= directory['deny'] %>
<%- end -%>
<%- if directory['allow'] and directory['allow'] != '' -%>
Allow <%= directory['allow'] %>
<%- else -%>
Allow from all
<%- end -%>
<%- if directory['addhandlers'] and ! directory['addhandlers'].empty? -%>
<%- Array(directory['addhandlers']).each do |addhandler| -%>
AddHandler <%= addhandler['handler'] %> <%= Array(addhandler['extensions']).join(' ') %>
<%- end -%>
<%- end -%>
<%- if directory['passenger_enabled'] and directory['passenger_enabled'] != '' -%>
PassengerEnabled <%= directory['passenger_enabled'] %>
<%- end -%>
</Directory>
<%- end -%>
<%- end -%>
<% end -%>