7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/packit/control.rb', line 7
def render(config)
template = <<-eos
Package: <%= name %>
Architecture: <%= arch || 'all' %>
Maintainer: <%= author %>
Depends: <%= (depends && depends.is_a?(Array) && !depends.empty?) || 'debconf' %>
<%- if conflicts && conflicts.is_a?(Array) && !conflicts.empty? -%>
Conflicts: <%= conflicts.join(', ') %>
<%- end -%>
<%- if section -%>
Section: <%= section %>
<%- end -%>
Priority: <%= priority || 'optional' %>
Version: <%= version %>
Description: <%= description || "Awesome package" %>
eos
renderer = ERB.new(template, nil, '-')
renderer.result(config.get_binding)
end
|