class Flock::Sandbox::Runner

Attributes

config_path[RW]
definition[RW]
target[RW]

Public Class Methods

new(args) click to toggle source
# File lib/flock/sandbox.rb, line 17
def initialize(args)
  self.config_path, self.target = args
end

Public Instance Methods

define(&blk) click to toggle source
# File lib/flock/sandbox.rb, line 33
def define(&blk)
  self.definition = Definition.new
  context = Context.new(self, definition)
  context.instance_exec(definition, &blk)
end
run() click to toggle source
# File lib/flock/sandbox.rb, line 21
def run
  instance_eval(File.open(config_path).read, config_path)
  case target
  when "docker"
    Docker.new(definition).run
  when "vagrant"
    Vagrant.new(definition).run
  when "docker-stop"
    DockerStop.new(definition).run
  end
end