Hi Supriya, If you want an array of items printed as a newline separated list of values, then you probably want to use the 'join' method ( http://www.ruby-doc.org/core-2.1.3/Array.html#method-i-join) to join the array on newlines instead of split.
This question looks like it's asking for general code help, rather than asking specific questions about developing on Facter, Puppet, Hiera, or another one of our open source projects. Please note that puppet-dev is *not* an appropriate place to ask general coding questions. You'll have better luck trying the Ruby users forum ( https://www.ruby-forum.com/forum/ruby), puppet-users mailing list ( https://groups.google.com/forum/#!forum/puppet-users) or the #puppet IRC channel. If you need more in depth help there are projects like Hack Hands ( https://hackhands.com/) that can provide close mentoring. If you need specialized help for Puppet then a Professional Services engagement ( http://puppetlabs.com/services/professional-services) might be your best bet. On Fri, Oct 10, 2014 at 10:41 AM, Supriya Uppalapati < supriya.uppalap...@gmail.com> wrote: > Hi, > > when i am trying to do puppet custom facts to split [1,2,3,4,5] to > 1 > 2 > 3 > 4 > 5 > > *It is throwing me error:* > *Error: Could not retrieve local facts: undefined method `split' for [1, > 2, 3, 4, 5]:Array* > > > *Here is my facts* > > > > > > *require 'facter'ary = [1,2,3,4,5]ary.map { |i| "'" + i.to_s + > "'"}.join(",")#str = ""ary.each do |i|#id,val = row[i] val = ary.split > ","Facter.add("base") do setcode do iendendendAnyone, please help me* > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Developers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to puppet-dev+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/puppet-dev/910ad676-77c4-43d1-8a95-42e398ab249d%40googlegroups.com > <https://groups.google.com/d/msgid/puppet-dev/910ad676-77c4-43d1-8a95-42e398ab249d%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Adrien Thebo | Puppet Labs -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/CALVJ9SKbt9GVs3GY%3DXachP_scc7yQHvvF5DFcuZWBEPr-%2BZEAQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.