Class: Avrolution::Rake::BaseTask

Inherits:
Rake::TaskLib
  • Object
show all
Defined in:
lib/avrolution/rake/base_task.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name: nil, dependencies: []) {|_self| ... } ⇒ BaseTask

Returns a new instance of BaseTask.

Yields:

  • (_self)

Yield Parameters:



13
14
15
16
17
18
19
# File 'lib/avrolution/rake/base_task.rb', line 13

def initialize(name: nil, dependencies: [])
  @name = name
  @task_namespace = :avro
  @dependencies = dependencies

  yield self if block_given?
end

Instance Attribute Details

#dependenciesObject

Returns the value of attribute dependencies.



7
8
9
# File 'lib/avrolution/rake/base_task.rb', line 7

def dependencies
  @dependencies
end

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/avrolution/rake/base_task.rb', line 7

def name
  @name
end

#task_descObject

Returns the value of attribute task_desc.



7
8
9
# File 'lib/avrolution/rake/base_task.rb', line 7

def task_desc
  @task_desc
end

#task_namespaceObject

Returns the value of attribute task_namespace.



7
8
9
# File 'lib/avrolution/rake/base_task.rb', line 7

def task_namespace
  @task_namespace
end

Class Method Details

.define(**options, &block) ⇒ Object



9
10
11
# File 'lib/avrolution/rake/base_task.rb', line 9

def self.define(**options, &block)
  new(**options, &block).define
end

Instance Method Details

#defineObject



21
22
23
24
25
26
27
28
# File 'lib/avrolution/rake/base_task.rb', line 21

def define
  namespace task_namespace do
    desc task_desc
    task(name.to_sym => dependencies) do
      perform
    end
  end
end