diff options
author | Daniel Pittman <daniel@puppetlabs.com> | 2011-05-03 15:51:30 -0700 |
---|---|---|
committer | Daniel Pittman <daniel@puppetlabs.com> | 2011-05-03 15:51:30 -0700 |
commit | b3dd34b4d59329746042b23c1736ed432351a123 (patch) | |
tree | 2d7e8eb8457920a845ee7a37a6ea4bb5a04b9a2a /lib/puppet/interface/documentation.rb | |
parent | fded269b8b2487184f7cfc409c3e82daa59f595a (diff) | |
parent | 8f81f56e8315a62e6c8ff8943c64df7594855359 (diff) | |
download | puppet-b3dd34b4d59329746042b23c1736ed432351a123.tar.gz puppet-b3dd34b4d59329746042b23c1736ed432351a123.tar.xz puppet-b3dd34b4d59329746042b23c1736ed432351a123.zip |
Merge branch 'bug/2.7.x/7326-faces-broken-on-ruby-1.8.5' into 2.7.x
Diffstat (limited to 'lib/puppet/interface/documentation.rb')
-rw-r--r-- | lib/puppet/interface/documentation.rb | 5 |
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}}/, '') |