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 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 will do the right
thing, but the range() function provided with stdlib does some type
conversion (detects if it's a number, and changes the type to integer)
which converts "01" to 1 breaking this possibility. 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?
So, I tried to change that myself, but no matter what I do to the
range.rb file, the changes are not picked up by the node. Do I have to
do something to force a reload of the file? This runs in the server, right?
What I did then was to create a range_custom() which is a copy of the
former, but without the type conversion. I tried that and it works like
a charm.
Thanks!
Pablo
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 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 will do the right thing, but the range() function provided with stdlib does some type conversion (detects if it's a number, and changes the type to integer) which converts "01" to 1 breaking this possibility.
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?
So, I tried to change that myself, but no matter what I do to the range.rb file, the changes are not picked up by the node. Do I have to do something to force a reload of the file? This runs in the server, right?
What I did then was to create a range_custom() which is a copy of the former, but without the type conversion. I tried that and it works like a charm.
Thanks!
Pablo
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To post to this group, send email to puppet...@googlegroups.com.
To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
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 Redmine server for bug tracking --> http://projects.puppetlabs.com/projects/modules/issues Please feel free to file any module tickets here!
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 will do the right thing, but the range() function provided with stdlib does some type conversion (detects if it's a number, and changes the type to integer) which converts "01" to 1 breaking this possibility.
Hey Pablo,
Just a question - do you have a NEED for it to be [01...99] with the leading zero? If I understand correctly, the end result is the same, as the range function will cast 01 to 1 and not BREAK because you pass it 01 - correct? Maybe I'm missing why you would need to use 01 explicitly?
No problem. We've turned off Github Issues because we use our central Redmine server for bug tracking --> http://projects.puppetlabs.com/projects/modules/issues Please feel free to file any module tickets here!
So, I tried to change that myself, but no matter what I do to the range.rb file, the changes are not picked up by the node. Do I have to do something to force a reload of the file? This runs in the server, right?
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To post to this group, send email to puppet...@googlegroups.com.
To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
=> ["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 function is just an interface to the "range" capability of Ruby, right? I think it should allow the programmer to choose the type he wants.
Do you know if, after editing a .rb file, I have to force some kind of reload to pick up the changes?
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 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 will do the right thing, but the range() function provided with stdlib does some type conversion (detects if it's a number, and changes the type to integer) which converts "01" to 1 breaking this possibility. 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?
This is exactly what I was looking for, which indeed is much nicer than
doing prefix(range(blabla)).
In any case, I still don't see the reason for the artificial type change
inside that function, but anyway...
BR/Pablo