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.



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

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

Instance Attribute Details

#errObject

Returns the value of attribute err.



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

def err
  @err
end

#outObject

Returns the value of attribute out.



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

def out
  @out
end

#strict_importsObject

Returns the value of attribute strict_imports.



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

def strict_imports
  @strict_imports
end

Instance Method Details

#generateObject



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

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

#planObject



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

def plan
  syncer.plan
end

#updateObject



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

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