Re: [Puppet Users] stdlib/range issue

2012-04-02 Thread Pablo Fernandez
I think you are wrong, check the source code: # Check whether we have integer value if so then make it so ... if start.match(/^\d+$/) start = start.to_i stop = stop.to_i else start = start.to_s stop = stop.to_s end Besides, the change made by

Re: [Puppet Users] stdlib/range issue

2012-04-01 Thread Krzysztof Wilczynski
Hi, [...] I changed how the range works (also making it resists Ruby's string permutation bomb). Ideas implemented so far: https://gist.github.com/2277148 https://gist.github.com/2277144 https://gist.github.com/2270106 Also, the "a..b" and "a...b" notation should also be supported. I will pu

Re: [Puppet Users] stdlib/range issue

2012-03-30 Thread Jeff McCune
On Thu, Mar 29, 2012 at 11:50 PM, Pablo Fernandez wrote: > Hi, > > It looks like range("host01", "host99") works fine, returning [ "host01", >> "host02", ..., "host98", "host99" ] >> >> Is this what you're looking for, or is it an issue only if the leading >> portion of the string is zero padded?

Re: [Puppet Users] stdlib/range issue

2012-03-29 Thread Pablo Fernandez
Hi, It looks like range("host01", "host99") works fine, returning [ "host01", "host02", ..., "host98", "host99" ] Is this what you're looking for, or is it an issue only if the leading portion of the string is zero padded? This is exactly what I was looking for, which indeed is much nicer th

Re: [Puppet Users] stdlib/range issue

2012-03-29 Thread Jeff McCune
On Thu, Mar 29, 2012 at 8:48 AM, Pablo Fernandez wrote: > Dear stdlib'ers... > > I have just discovered the wonders of the parser functions, and got > impressed with the tens of functions that come with stdlib. First things > first... good work!!! Thanks!! > > And now the issue. It seems like the

Re: [Puppet Users] stdlib/range issue

2012-03-29 Thread Krzysztof Wilczynski
Hi, irb(main):008:0> ("08".."12").to_a > => ["08", "09", "10", "11", "12"] > > irb(main):010:0> (8..12).to_a > => [8, 9, 10, 11, 12] > > But then, the range() function in stdlib, makes a type conversion, that > breaks this possibility. I don't understand why do you do that > conversion... the f

Re: [Puppet Users] stdlib/range issue

2012-03-29 Thread Ashley Penney
I needed this just yesterday, actually, for NFS mounts. $PO_0_9 = prefix(range("0","9"),'/PO_0') $PO_10_31 = prefix(range("10","31"),'/PO_') $PO_32_76 = prefix(range("32","76"),'/PO_') nfs::po_mounts_50{ $PO_0_9: options => 'soft,bg,tcp', } nfs::po_mounts_50{ $PO_10_31: optio

Re: [Puppet Users] stdlib/range issue

2012-03-29 Thread Pablo Fernandez
Gotcha, thanks! On 03/29/2012 06:23 PM, Jeff McCune wrote: On Thu, Mar 29, 2012 at 8:57 AM, Gary Larizza > wrote: I tried to submit a bug report, but I just can list the open ones, can't make one myself. Is this intentional? How do I properly

Re: [Puppet Users] stdlib/range issue

2012-03-29 Thread Pablo Fernandez
Hi, And now the issue. It seems like the writer of the range() function did not think about ranges with more than one digit that need leading zeros in the first items, like "01..99", when you usually want to have 01, 02, and so on. Ruby allows you to do ("01".."99") and that

Re: [Puppet Users] stdlib/range issue

2012-03-29 Thread Jeff McCune
On Thu, Mar 29, 2012 at 8:57 AM, Gary Larizza wrote: > > I tried to submit a bug report, but I just can list the open ones, can't >> make one myself. Is this intentional? How do I properly address this >> request? >> > > No problem. We've turned off Github Issues because we use our central > Red

Re: [Puppet Users] stdlib/range issue

2012-03-29 Thread Gary Larizza
On Thu, Mar 29, 2012 at 8:48 AM, Pablo Fernandez wrote: > Dear stdlib'ers... > > I have just discovered the wonders of the parser functions, and got > impressed with the tens of functions that come with stdlib. First things > first... good work!!! Thanks!! > > And now the issue. It seems like the

[Puppet Users] stdlib/range issue

2012-03-29 Thread Pablo Fernandez
Dear stdlib'ers... I have just discovered the wonders of the parser functions, and got impressed with the tens of functions that come with stdlib. First things first... good work!!! Thanks!! And now the issue. It seems like the writer of the range() function did not think about ranges with m