diff options
author | José Valim <jose.valim@gmail.com> | 2010-01-18 23:32:01 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-01-19 01:36:06 +0100 |
commit | e1029be1ebe0e44cdad75dc9b1bdfd3957c245bc (patch) | |
tree | a3d7c4e9750618bcdbe616986ba402736306074b /railties/lib/rails | |
parent | e6a68a5cc3b47865abbba59bf693215c50136002 (diff) | |
download | rails-e1029be1ebe0e44cdad75dc9b1bdfd3957c245bc.tar.gz rails-e1029be1ebe0e44cdad75dc9b1bdfd3957c245bc.tar.bz2 rails-e1029be1ebe0e44cdad75dc9b1bdfd3957c245bc.zip |
Since Rails will require Ruby >= 1.8.7, we can rely on instance_exec.
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/vendor/thor-0.12.3/lib/thor/group.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/railties/lib/rails/vendor/thor-0.12.3/lib/thor/group.rb b/railties/lib/rails/vendor/thor-0.12.3/lib/thor/group.rb index a585b37b73..eda3b52c4f 100644 --- a/railties/lib/rails/vendor/thor-0.12.3/lib/thor/group.rb +++ b/railties/lib/rails/vendor/thor-0.12.3/lib/thor/group.rb @@ -252,10 +252,13 @@ class Thor::Group shell.padding += 1 result = if block_given? - if block.arity == 2 - block.call(self, klass) - else + case block.arity + when 3 block.call(self, klass, task) + when 2 + block.call(self, klass) + when 1 + instance_exec(klass, &block) end else invoke klass, task, *args |