Skip to content

Commit

Permalink
Replace webroot_paths.cycle for Ruby 1.8.7 compatibility
Browse files Browse the repository at this point in the history
Enumerable#cycle is only available in 1.9+, so change the zipping of
domains to webroot_paths with a simplified expansion of webroot_paths
to match the number of domains.

Fixes voxpupuliGH-28
  • Loading branch information
domcleal committed Jun 15, 2016
1 parent 264b20b commit 3b91947
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion manifests/certonly.pp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

$command_start = "${letsencrypt_command} --agree-tos certonly -a ${plugin} "
$command_domains = $plugin ? {
'webroot' => inline_template('<%= @domains.zip(@webroot_paths.cycle).map { |domain| "--webroot-path #{domain[1]} -d #{domain[0]}"}.join(" ") %>'),
'webroot' => inline_template('<%= @domains.zip(@webroot_paths * (@domains.size.to_f / @webroot_paths.size).ceil).map { |domain| "--webroot-path #{domain[1]} -d #{domain[0]}"}.join(" ") %>'),
default => inline_template('-d <%= @domains.join(" -d ")%>'),
}
$command_end = inline_template('<% if @additional_args %> <%= @additional_args.join(" ") %><%end%>')
Expand Down

0 comments on commit 3b91947

Please sign in to comment.