Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allows tasks access to extra (unnamed) task arguments #70

Closed
wants to merge 1 commit into from

Conversation

btaitelb
Copy link

Pros:

  • This lets rake tasks use varargs-style parameters.
  • This is useful for passing in lists, as well as handling string params containing commas.

Possible Issues:

  • If a task is currently iterating through the args, and the task is called with additional arguments,
    then this could break an existing task. Calling the rake task with unnamed arguments was previously
    incorrect usage, however.
  • If someone names their params like arg_001 then unnamed params will overwrite the value.
    Naming args like that, however, is pretty bad practice.

Pros:
 - This lets rake tasks use varargs-style parameters.
 - This is useful for passing in lists, as well as handling string params containing commas.

Possible Issues:
 - If a task is currently iterating through the args, and the task is called with additional arguments,
   then this could break an existing task. Calling the rake task with unnamed arguments was previously
   incorrect usage, however.
 - If someone names their params like _arg_001_ then unnamed params will overwrite the value.
   Naming args like that, however, is pretty bad practice.
@mdesantis
Copy link

Does anyone have informations about this? It's very ugly rake cannot take commas in the arguments

@jimweirich
Copy link
Owner

The idea of var args to tasks is intriguing, but not with that ugly argument naming scheme. I would suggest enhancing TaskArguments with a 'values' method and use that to access a list of values (named or otherwise). Maybe some way of indicating that variable args are acceptable to the task.

@jimweirich
Copy link
Owner

There is a similar pull request open with an improved implementation (#150). I'm closing this request in favor of #150.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants