Class: Rake::Application Private

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

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Extension to Rake to provide rename task.

Instance Method Summary collapse

Instance Method Details

#rename_task(task, oldname, newname) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

A Rake task to rename another Rake task.



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/multi_ar/rake/ext.rb', line 10

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