Sha256: f9eba9aafe4248a193734ccf67eb9e97f7e934d3eae40e948c43bea681ad2677

Contents?: true

Size: 627 Bytes

Versions: 1

Compression:

Stored size: 627 Bytes

Contents

# add rename_task method to Rake::Application
# it has an internal hash with name -> Rake::Task mapping
module Rake
class Application
 def rename_task(task, oldname, newname)
     if @tasks.nil?
     @tasks = {}
     end

     @tasks[newname.to_s] = task

     if @tasks.has_key? oldname
     @tasks.delete oldname
     end
 end
end
end

# add new rename method to Rake::Task class
# to rename a task
class Rake::Task
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
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
puremvc-as3-2.0.4 lib/rake/rename.rb