diff options
author | Daniel DeLeo <dan@opscode.com> | 2011-04-06 14:51:44 -0700 |
---|---|---|
committer | Daniel DeLeo <dan@opscode.com> | 2011-04-06 14:51:44 -0700 |
commit | 769414b50c6d4bdb05ac48121cf20aca976fd3b8 (patch) | |
tree | b194a84ddfce5eab220ae05d9c8777befb5290af | |
parent | 073f729991aac0aaa35ea641ee9bf6f723b3e5a5 (diff) | |
download | chef-769414b50c6d4bdb05ac48121cf20aca976fd3b8.tar.gz |
tweak the text formatter to fix hashes in arrays
-rw-r--r-- | chef/lib/chef/knife/core/text_formatter.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/chef/lib/chef/knife/core/text_formatter.rb b/chef/lib/chef/knife/core/text_formatter.rb index 93d7ed7a1a..21142cec4e 100644 --- a/chef/lib/chef/knife/core/text_formatter.rb +++ b/chef/lib/chef/knife/core/text_formatter.rb @@ -72,7 +72,7 @@ class Chef # Ruby 1.8 Strings include enumberable, which is not what we want. So # we have this heuristic to detect hashes and arrays instead. def should_enumerate?(value) - ((value.respond_to?(:keys) && !value.empty? ) || ( value.kind_of?(Array) && value.size > 1 )) + ((value.respond_to?(:keys) && !value.empty? ) || ( value.kind_of?(Array) && (value.size > 1 || should_enumerate?(value.first) ))) end def indent_line(string, indent) |