Issue #2990 has been updated by Markus Roberts.

Status changed from Unreviewed to Needs more information

If you just want to combine various segments of an array into a string you can 
write:

     sprintf("%s",my_array)

If you want something that provides delimiters a'la ruby's join, it should be 
trivial to add, perhaps:

  module Puppet::Parser::Functions
    newfunction(:join, :type => :rvalue,
        :doc => "Join a list of strings with an optional delimiter."
      ) do |args|
        raise Puppet::ParseError, 'join() takes 1 or 2 arguments' unless 
1..2.include? args.length
        args.first.join args.last
    end
  end

What's the use case?
----------------------------------------
Feature #2990: There's a split(), but no combine()
http://projects.reductivelabs.com/issues/2990

Author: Tim Stoop
Status: Needs more information
Priority: Normal
Assigned to: 
Category: 
Target version: 
Affected version: 0.25.1
Keywords: 
Branch: 


The split function is nice, but it would be logical to me if there was also a 
combine() function, which did about the same, only the other way around. Is 
that very hard to add?


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://reductivelabs.com/redmine/my/account

--

You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.


Reply via email to