Class: Rake::Task

Inherits:
Object
  • Object
show all
Defined in:
lib/rake/rename.rb

Overview

add new rename method to Rake::Task class to rename a task

Instance Method Summary collapse

Instance Method Details

#rename(new_name) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/rake/rename.rb', line 22

def rename(new_name)
 if !new_name.nil?
     old_name = @name

     if old_name == new_name
     return
     end

     @name = new_name.to_s
     application.rename_task(self, old_name, new_name)
 end
end