Class: Kennel::Engine

Inherits:
Object
  • Object
show all
Defined in:
lib/kennel.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize ⇒ Engine

Returns a new instance of Engine.



61
62
63
# File 'lib/kennel.rb', line 61

def initialize
  @strict_imports = true
end

Instance Attribute Details

#strict_imports ⇒ Object

TODO: rename to :enforce_expected_ids_exist



59
60
61
# File 'lib/kennel.rb', line 59

def strict_imports
  @strict_imports
end

Instance Method Details

#generate ⇒ Object



70
71
72
73
74
75
76
# File 'lib/kennel.rb', line 70

def generate
  parts = generated
  if ENV["STORE"] != "false" # quicker when debugging
    PartsSerializer.new(filter: filter).write(parts)
  end
  parts
end

#plan ⇒ Object



78
79
80
81
# File 'lib/kennel.rb', line 78

def plan
  syncer.print_plan
  syncer.plan
end

#preload ⇒ Object

start generation and download in parallel to make planning faster



66
67
68
# File 'lib/kennel.rb', line 66

def preload
  Utils.parallel([:generated, :definitions]) { |m| send m, plain: true }
end

#update ⇒ Object



83
84
85
86
# File 'lib/kennel.rb', line 83

def update
  syncer.print_plan
  syncer.update if syncer.confirm
end