[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, experimental, updated. debian/2.6.8-1-844-g7ec39d5

Daniel Pittman daniel at puppetlabs.com
Tue May 10 08:19:22 UTC 2011


The following commit has been merged in the experimental branch:
commit 8f81f56e8315a62e6c8ff8943c64df7594855359
Author: Daniel Pittman <daniel at puppetlabs.com>
Date:   Tue May 3 15:51:02 2011 -0700

    (#7326) Fix faces on Ruby 1.8.5
    
    Turns out that String#each_line on Ruby 1.8.5 only takes a block, and will not
    return an enumerable.  Rewrite to use split(/\n/) which has the same effect
    but works on all our platforms.

diff --git a/lib/puppet/interface/documentation.rb b/lib/puppet/interface/documentation.rb
index 91db0e0..48e9a8b 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}}/, '')

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list