Top Level Namespace

Defined Under Namespace

Modules: Bones, Kernel Classes: Object

Instance Method Summary collapse

Instance Method Details

#alias_task(fq_name) ⇒ Object



19
20
21
# File 'lib/bones/rake_override_task.rb', line 19

def alias_task( fq_name )
  Rake.application.alias_task(fq_name)
end

#override_task(*args, &block) ⇒ Object



23
24
25
26
27
28
# File 'lib/bones/rake_override_task.rb', line 23

def override_task( *args, &block )
  name = Rake.application.resolve_args(args.dup).first
  fq_name = Rake.application.instance_variable_get(:@scope).dup.push(name).join(':')
  alias_task(fq_name)
  Rake::Task.define_task(*args, &block)
end

#remove_task(*args) ⇒ Object Also known as: remove_tasks



30
31
32
# File 'lib/bones/rake_override_task.rb', line 30

def remove_task( *args )
  args.flatten.each { |fq_name| Rake.application.remove_task(fq_name) }
end