Module: Rake::Tasks::DSL Private

Defined in:
lib/multi_ar/rake/tasks.rb

Overview

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

DSL wrapper partly copied from Rake::DSL.

Class Method Summary collapse

Class Method Details

.desc(description) ⇒ 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.

Defines a Rake task’s description (see Rake’s desc() in dsl_definition.rb)



43
44
45
# File 'lib/multi_ar/rake/tasks.rb', line 43

def self.desc(description)
  ::Rake.application.last_description = description
end

.namespace(name = nil, &block) ⇒ 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.

Defines a Rake namespace (see Rake’s namespace() in dsl_definition.rb)



33
34
35
36
37
38
39
40
# File 'lib/multi_ar/rake/tasks.rb', line 33

def self.namespace(name=nil, &block)
  name = name.to_s if name.kind_of?(Symbol)
  name = name.to_str if name.respond_to?(:to_str)
  unless name.kind_of?(String) || name.nil?
    raise ArgumentError, "Expected a String or Symbol for a namespace name"
  end
  ::Rake.application.in_namespace(name, &block)
end

.task(*args, &block) ⇒ 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.

Defines a Rake task (see Rake’s task() in dsl_definition.rb)



48
49
50
# File 'lib/multi_ar/rake/tasks.rb', line 48

def self.task(*args, &block)
  ::Rake::Task.define_task(*args, &block)
end