]> git.madduck.net Git - puppet/sudo.git/blob - templates/rule_line.erb

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

initial checkin
[puppet/sudo.git] / templates / rule_line.erb
1 <%- if @newline_before %>
2 <% end -%>
3 <%- if @_comment -%>
4 <%= @_comment.gsub(/(.{1,78})( +|$\n?)|(.{1,78})/, "# \\1\\3\n") -%>
5 <%- end -%>
6 <%-
7   def rl(list)
8     if list.is_a?(Array)
9       return list.join(",")
10     else
11       return list
12     end
13   end
14   def render_cmnd_list(list)
15     if list.is_a?(Array)
16       return "\\\n  " + list.join(",\\\n  ")
17     else
18       return list
19     end
20   end
21 -%>
22 <%= "#{rl(@who)} #{rl(@where)} = (#{rl(@as_whom)}:#{rl(@as_group)})" %> <%= render_cmnd_list(@what) %>