From 809b6fe5b105cefca34149af0a03d6445f5236fc Mon Sep 17 00:00:00 2001 From: Nick Lewis Date: Mon, 16 May 2011 17:17:33 -0700 Subject: (#7297) Fix Puppet::Resource#to_manifest in Ruby 1.9 This method was relying on the implicit join in Ruby 1.8's Array#to_s, eg. [1,2,3].to_s => "123". The behavior in Ruby 1.9 is more akin to Array#inspect, eg. [1,2,3].to_s => "[1, 2, 3]". Since the array we were building was lines to be printed, the latter behavior is incorrect. So we just join into a single string, which prints consistently in all versions of Ruby. Paired-With: Josh Cooper Original patch by Aria Stewart --- lib/puppet/resource.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/puppet/resource.rb b/lib/puppet/resource.rb index 214516908..59e387d00 100644 --- a/lib/puppet/resource.rb +++ b/lib/puppet/resource.rb @@ -269,7 +269,7 @@ class Puppet::Resource else " %-#{attr_max}s => %s,\n" % [ k, "\'#{v}\'" ] end - } + }.join "%s { '%s':\n%s}" % [self.type.to_s.downcase, self.title, attributes] end -- cgit