Class: Monolith::DefaultLocation

Inherits:
BaseLocation show all
Defined in:
lib/monolith/locations/default.rb

Instance Method Summary collapse

Methods inherited from BaseLocation

#clean, #initialize

Constructor Details

This class inherits a constructor from Monolith::BaseLocation

Instance Method Details

#installObject



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/monolith/locations/default.rb', line 4

def install
  # For now we just copy any community cookbooks. It would be nice to be
  # able to grab them from the source URL, but that isn't readily
  # accessible, and then you have to guess how to check it out.
  if File.directory?(@destination)
    rel_dest = Monolith.formatter.rel_dir(@destination)
    Monolith.formatter.skip(@cookbook, "#{rel_dest} already exists")
  else
    Monolith.formatter.install(@cookbook, @destination)
    FileUtils.cp_r(@cookbook.path, @destination)
  end
  true
end

#updateObject



18
19
20
21
22
23
24
# File 'lib/monolith/locations/default.rb', line 18

def update
  # There isn't anything to do for updating a community cookbook except
  # blowing it away and recreating it. For the moment I'm opting not to do
  # that (it may be able ot be an option later)
  Monolith.formatter.skip(@cookbook, "Not updating community cookbook")
  nil
end