How do i get the input content that follows the rake command
all. How do开发者_JS百科 i get the content that follows the rake command ,
for example, when i type this command in terminal # rake make_file myfile
so that it will creates a file named myfile.txt, how do i write this rake task ?
Thanks in advance.
rake task_name some_param
will actually try to fire two rake tasks: task_name
and some_param
unless the parameters are in the format of param=value
, in which case the parameter is populated in the ENV
constant.
So, rake task_name myfile=/some/file
can be read from ENV["myfile"]
.
精彩评论