0

Here is an example Rakefile

namespace :install do
   task :baz do
       ...
   end

   task :quux do
       ...
   end
end

task :foo => ['bar:baz','bar:quux'] do
    ...
end

Is it possible to write something like task :foo => ['bar' => ['baz', 'quux']] do

deiga
  • 1,587
  • 1
  • 13
  • 32

2 Answers2

2

This can't be done. I've just dug around in the source and if you must: checkout resolve_args_with_dependencies. In there you need to do horrible things to make this work. I wouldn't recommend it.

harm
  • 10,045
  • 10
  • 36
  • 41
1

You're one superhack monkeypatch away from making this happen, but I wouldn't advise it. This will create a non-standard dependency. If you can get a pull request approved, then hey, by all means.

Why don't you just make shorter aliases if you're fretting about things like this?

tadman
  • 208,517
  • 23
  • 234
  • 262
  • Well I don't really fret about the length, just the DRYness of my code :) – deiga Feb 27 '13 at 20:24
  • Since you're dealing with Ruby here, you could make a method that converts from your format into something that Rake can use. Example: `task :foo => x(:bar => %w[ baz quxx])` where `x(h)` would do the magic. Sometimes too much reductionism impairs understanding, though. – tadman Feb 27 '13 at 20:27