jimweirich/rake — pull request #216 by avdi (2013-08-02 15:36:16+00:00)
Title: Enable rules to accept Method object as prerequisites.

I have this rule:

```ruby
rule /^#{highlights_dir}\/[[:xdigit:]]+\.html$/ =>
[->(highlight_file){listing_for_highlight_file(highlight_file)}] do |t|
dir = t.name.pathmap("%d")
mkdir_p dir unless File.exist?(dir)
sh *%W[pygmentize -o #{t.name} #{t.source}]
end
```

I would like to shorten it to this rule by using a `Method` object:

```ruby
rule /^#{highlights_dir}\/[[:xdigit:]]+\.html$/ => [method(:listing_for_highlight_file)] do |t|
dir = t.name.pathmap("%d")
mkdir_p dir unless File.exist?(dir)
sh *%W[pygmentize -o #{t.name} #{t.source}]
end
```
But this is not currently possible because rules expect executable prerequisites to be `Proc` instances.