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.



48
49
50
51
52
# File 'lib/kennel.rb', line 48

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

Instance Attribute Details

#errObject

Returns the value of attribute err.



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

def err
  @err
end

#outObject

Returns the value of attribute out.



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

def out
  @out
end

#strict_importsObject

Returns the value of attribute strict_imports.



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

def strict_imports
  @strict_imports
end

Instance Method Details

#generateObject



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

def generate
  out = generated
  store out if ENV["STORE"] != "false" # quicker when debugging
  out
end

#planObject



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

def plan
  syncer.plan
end

#updateObject



66
67
68
69
70
71
72
73
# File 'lib/kennel.rb', line 66

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