class Landrush::DependentVMs

Public Class Methods

add(hostname) click to toggle source
# File lib/landrush/dependent_vms.rb, line 16
def self.add(hostname)
  FileUtils.touch(file_for(hostname))
end
clear!() click to toggle source
# File lib/landrush/dependent_vms.rb, line 28
def self.clear!
  dir.rmtree
end
dir() click to toggle source
# File lib/landrush/dependent_vms.rb, line 36
def self.dir
  Server.working_dir.join('dependent_vms').tap(&:mkpath)
end
each(&block) click to toggle source
# File lib/landrush/dependent_vms.rb, line 12
def self.each(&block)
  (dir.directory? ? dir.children : []).each(&block)
end
file_for(hostname) click to toggle source
# File lib/landrush/dependent_vms.rb, line 32
def self.file_for(hostname)
  dir.join(hostname)
end
list() click to toggle source
# File lib/landrush/dependent_vms.rb, line 24
def self.list
  map { |path| path.basename.to_s }
end
remove(hostname) click to toggle source
# File lib/landrush/dependent_vms.rb, line 20
def self.remove(hostname)
  file_for(hostname).tap { |f| f.delete if f.exist? }
end