Class: Terraspace::Dependency::Resolver

Inherits:
Object
  • Object
show all
Includes:
Compiler::DirsConcern
Defined in:
lib/terraspace/dependency/resolver.rb

Instance Method Summary collapse

Methods included from Compiler::DirsConcern

#cache_dirs, #dirs, #extract_stack_name, #local_paths, #mod_names, #select_stack?, #stack_names, #with_each_mod

Constructor Details

#initialize(options = {}) ⇒ Resolver

Returns a new instance of Resolver.



5
6
7
# File 'lib/terraspace/dependency/resolver.rb', line 5

def initialize(options={})
  @options = options
end

Instance Method Details

#resolveObject



9
10
11
12
13
14
15
16
17
18
# File 'lib/terraspace/dependency/resolver.rb', line 9

def resolve
  with_each_mod("stacks") do |mod|
    mod.resolved = false
    Terraspace::Compiler::Perform.new(mod).compile_tfvars(write: false)
  end

  dependencies = Terraspace::Dependency::Registry.data # populated dependencies resolved
  @graph = Terraspace::Dependency::Graph.new(stack_names, dependencies, @options)
  @graph.build # Returns batches to run
end