Class: Kennel::Engine

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeEngine

Returns a new instance of Engine.



52
53
54
55
56
# File 'lib/kennel.rb', line 52

def initialize
  @out = $stdout
  @err = $stderr
  @strict_imports = true
end

Instance Attribute Details

#errObject

Returns the value of attribute err.



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

def err
  @err
end

#outObject

Returns the value of attribute out.



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

def out
  @out
end

#strict_importsObject

Returns the value of attribute strict_imports.



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

def strict_imports
  @strict_imports
end

Instance Method Details

#generateObject



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

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

#planObject



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

def plan
  syncer.plan
end

#updateObject



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

def update
  the_plan = syncer.plan
  the_update = syncer.update if syncer.confirm
  UpdateResult.new(
    plan: the_plan,
    update: the_update
  )
end