Class: Ruby::Terraform::Tasks::BaseTask

Inherits:
Rake::TaskLib
  • Object
show all
Defined in:
lib/ruby/terraform/tasks/base_task.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(configuration_name, task_name = nil) {|_self| ... } ⇒ BaseTask

Returns a new instance of BaseTask.

Yields:

  • (_self)

Yield Parameters:



28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/ruby/terraform/tasks/base_task.rb', line 28

def initialize(configuration_name, task_name = nil)
  @configuration_name = configuration_name
  @task_name = task_name
  @deps = []

  if @task_name.is_a?(Hash)
    @deps = @task_name.values.first
    @task_name = @task_name.keys.first
  end

  yield self if block_given?
  define
end

Instance Attribute Details

#configuration_nameObject

name of configuration



8
9
10
# File 'lib/ruby/terraform/tasks/base_task.rb', line 8

def configuration_name
  @configuration_name
end

#depsObject

the task dependencies



26
27
28
# File 'lib/ruby/terraform/tasks/base_task.rb', line 26

def deps
  @deps
end

#descriptionObject

the description of the task



17
18
19
# File 'lib/ruby/terraform/tasks/base_task.rb', line 17

def description
  @description
end

#dirObject

the working dir of ‘terraform` command



14
15
16
# File 'lib/ruby/terraform/tasks/base_task.rb', line 14

def dir
  @dir
end

#show_commandObject

should the terraform command be shown on the console. Defaults to ‘false`.



20
21
22
# File 'lib/ruby/terraform/tasks/base_task.rb', line 20

def show_command
  @show_command
end

#show_outputObject

should the terraform output be shown on the console. Defaults to ‘false`.



23
24
25
# File 'lib/ruby/terraform/tasks/base_task.rb', line 23

def show_output
  @show_output
end

#task_nameObject

name of task



11
12
13
# File 'lib/ruby/terraform/tasks/base_task.rb', line 11

def task_name
  @task_name
end