class Monolith::BaseLocation

Public Class Methods

new(cookbook, dep, destination) click to toggle source
# File lib/monolith/locations/base.rb, line 3
def initialize(cookbook, dep, destination)
  @dep = dep
  @location = dep.location unless dep.nil?
  @cookbook = cookbook
  @destination = destination
end

Public Instance Methods

clean() click to toggle source

Remove a previously installed cookbook. If a cookbook was never installed in the first place (either because install wasn’t run, or because of the location type), then this should do nothing.

# File lib/monolith/locations/base.rb, line 27
def clean
  if File.exist?(@destination)
    Monolith.formatter.clean(@cookbook, @destination)
    FileUtils.rm_rf(@destination)
    true
  else
    rel_dest = Monolith.formatter.rel_dir(@destination)
    Monolith.formatter.skip(@cookbook, "#{rel_dest} doesn't exist")
    nil
  end
end
install() click to toggle source

Install the cookbook in the development environment. If possible, the installed cookbook should look exactly as it would when used for development (e.g. a git checkout with all git metadata, no compiled artefacts).

# File lib/monolith/locations/base.rb, line 14
def install
  nil
end
update() click to toggle source

Update the cookbook in the development environment to the latest version. E.g. if git is used, run git pull.

# File lib/monolith/locations/base.rb, line 20
def update
  nil
end