Skip to content

add a "step" argument to range()#56

Merged
adrienthebo merged 1 commit intopuppetlabs:masterfrom
hakamadare:v2.2.0_range_step
May 28, 2013
Merged

add a "step" argument to range()#56
adrienthebo merged 1 commit intopuppetlabs:masterfrom
hakamadare:v2.2.0_range_step

Conversation

@hakamadare
Copy link
Copy Markdown
Contributor

This patch adds an optional "step" argument to the stdlib range()
function. There is no change to the default behavior of the function;
however, passing a numeric "step" argument invokes the Ruby Range#step
method, e.g.

range("0", "9", "2")

returns

[0,2,4,6,8]

I've created ticket 13601
in Redmine to track this request.

-steve

This patch adds an optional "step" argument to the stdlib range()
function.  There is no change to the default behavior of the function;
however, passing a numeric "step" argument invokes the Ruby Range#step
method, e.g.

    range("0", "9", "2")

returns

    [0,2,4,6,8]
@kwilczynski
Copy link
Copy Markdown
Contributor

Hi,

+1

I've made some changes in the range function as per:

https://gist.github.com/2277148
https://gist.github.com/2277144
https://gist.github.com/2270106

I will add "step" to it as well :) Thanks for that!

KW

@hakamadare
Copy link
Copy Markdown
Contributor Author

ok, that looks AWESOME (especially the third gist)!

@kwilczynski
Copy link
Copy Markdown
Contributor

One think to mind -- this is not in the puppetlabs-stdlib yet :)

@puppetcla
Copy link
Copy Markdown

CLA Signed by hakamadare on 2012-01-17 21:00:00 -0800

@adrienthebo adrienthebo merged commit 4732676 into puppetlabs:master May 28, 2013
@adrienthebo
Copy link
Copy Markdown
Contributor

@hakamadare terribly sorry about the delay in getting this merged! We've been working through backlogged pull requests and getting everything merged in.

summary: merged into master in 928c131; this should be released in the next major or minor release of puppetlabs-stdlib. Thanks again for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants