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

rake tasks should take arguments #33

Open
atz opened this issue Oct 21, 2014 · 4 comments
Open

rake tasks should take arguments #33

atz opened this issue Oct 21, 2014 · 4 comments

Comments

@atz
Copy link
Contributor

atz commented Oct 21, 2014

Several of the rake tasks should take arguments, and certainly the underlying jettywrapper.rb methods should. For rake, at least:

rake jetty:download
rake jetty:clean
rake jetty:unzip

jettywrapper.rb's download() method already takes a url argument, but rake doesn't expose it.

In general, you should be able to target a jetty version directly from the command line, without setting global ZIP_URL or previous magic call to jettywrapper.instance.url= or passing arguments to stop(). Side note: I don't get the convenience of "configure via stop() call".

@awead
Copy link
Contributor

awead commented Oct 21, 2014

Are you suggesting something like:

$ rake jetty:download JETTY_URL=http://blah/master.zip

@atz
Copy link
Contributor Author

atz commented Oct 21, 2014

Partially. See https://github.com/jimweirich/rake/blob/master/doc/rakefile.rdoc#task-arguments-and-the-environment

This would also be sufficient:

rake jetty:download[http://blah/master.zip]

@atz
Copy link
Contributor Author

atz commented Oct 21, 2014

The difference is that rake knows that the task takes an argument, it shows up in rake -T, etc. And the user doesn't have to know all the various internal variable names that they don't actually care about. Also, if your rake task is prerequisite to other tasks, those tasks don't have to bounce off a GLOBAL variable or coordinate args outside the API.

@awead
Copy link
Contributor

awead commented Oct 21, 2014

@atz so long as the argument isn't required, it's fine with me.

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

No branches or pull requests

2 participants