summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel DeLeo <dan@opscode.com>2011-04-06 14:51:44 -0700
committerDaniel DeLeo <dan@opscode.com>2011-04-06 14:51:44 -0700
commit769414b50c6d4bdb05ac48121cf20aca976fd3b8 (patch)
treeb194a84ddfce5eab220ae05d9c8777befb5290af
parent073f729991aac0aaa35ea641ee9bf6f723b3e5a5 (diff)
downloadchef-769414b50c6d4bdb05ac48121cf20aca976fd3b8.tar.gz
tweak the text formatter to fix hashes in arrays
-rw-r--r--chef/lib/chef/knife/core/text_formatter.rb2
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)