From f9e56b6d4308da2b298b6b616313ecc553a5b6dc Mon Sep 17 00:00:00 2001 From: "R. Tyler Croy" Date: Sun, 8 Jul 2012 21:33:13 -0700 Subject: Properly handle both Arrays and Strings passed as balancer member options The template cannot rely on deprecated functionality of the String class (`#each` which disappears in 1.9) Fixes #9 --- templates/haproxy_balancermember.erb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'templates') diff --git a/templates/haproxy_balancermember.erb b/templates/haproxy_balancermember.erb index b739e11..f85137d 100644 --- a/templates/haproxy_balancermember.erb +++ b/templates/haproxy_balancermember.erb @@ -1 +1,4 @@ - server <%= server_name %> <%= balancer_ip %>:<%= balancer_port %> <% balancermember_options.each do |item| %> <%= item %> <% end %> + server <%= server_name %> <%= balancer_ip %>:<%= balancer_port %> <% + items = balancermember_options + items = [items] unless balancermember_options.instance_of? Array + items.each do |item| %> <%= item %><% end %> -- cgit v1.2.3