Skip to content

Commit 45e5d75

Browse files
committed
Simplify module template logic
1 parent 9e7f6c0 commit 45e5d75

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

templates/module.erb

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,23 @@ gid = <%= @gid %>
1111
incoming chmod = <%= @incoming_chmod %>
1212
outgoing chmod = <%= @outgoing_chmod %>
1313
max connections = <%= @max_connections %>
14-
<% if Integer(@max_connections) > 0 %>lock file = <%= @lock_file %><% end %>
15-
<% if @comment != :undef %>comment = <%= @comment %><% end %>
16-
<% if @secrets_file != :undef %>secrets file = <%= @secrets_file %><% end %>
17-
<% if @auth_users != :undef %>auth users = <%= @auth_users.to_a.join(', ')%><% end %>
18-
<% if @hosts_allow != :undef %>hosts allow = <%= @hosts_allow.to_a.join(' ')%><% end %>
19-
<% if @hosts_deny != :undef %>hosts deny = <%= @hosts_deny.to_a.join(' ')%><% end %>
14+
<% if Integer(@max_connections) > 0 -%>
15+
lock file = <%= @lock_file %>
16+
<% end -%>
17+
<% if @comment -%>
18+
comment = <%= @comment %>
19+
<% end -%>
20+
<% if @secrets_file -%>
21+
secrets file = <%= @secrets_file %>
22+
<% end -%>
23+
<% if @auth_users -%>
24+
auth users = <%= @auth_users.to_a.join(', ')%>
25+
<% end %>
26+
<% if @hosts_allow -%>
27+
hosts allow = <%= @hosts_allow.to_a.join(' ')%>
28+
<% end -%>
29+
<% if @hosts_deny -%>
30+
hosts deny = <%= @hosts_deny.to_a.join(' ')%>
31+
<% end -%>
2032

2133

0 commit comments

Comments
 (0)