summaryrefslogtreecommitdiffstats
path: root/lib/puppet/interface/documentation.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/interface/documentation.rb')
-rw-r--r--lib/puppet/interface/documentation.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/puppet/interface/documentation.rb b/lib/puppet/interface/documentation.rb
index 91db0e074..48e9a8b1a 100644
--- a/lib/puppet/interface/documentation.rb
+++ b/lib/puppet/interface/documentation.rb
@@ -6,7 +6,10 @@ class Puppet::Interface
# We need to identify an indent: the minimum number of whitespace
# characters at the start of any line in the text.
- indent = text.each_line.map {|x| x.index(/[^\s]/) }.compact.min
+ #
+ # Using split rather than each_line is because the later only takes a
+ # block on Ruby 1.8.5 / Centos, and we support that. --daniel 2011-05-03
+ indent = text.split(/\n/).map {|x| x.index(/[^\s]/) }.compact.min
if indent > 0 then
text.gsub!(/^[ \t\f]{0,#{indent}}/, '')