bootstrap_script()
click to toggle source
def bootstrap_script
cache_setting(:bootstrap, nil)
end
bootstrap_script=(bootstrap)
click to toggle source
def bootstrap_script=bootstrap
set_cache_setting(:bootstrap, bootstrap)
end
build(options = {})
click to toggle source
def build(options = {})
super(Config.ensure(options).import({ :save => false }))
end
build_time()
click to toggle source
def build_time
cache_setting(:build, nil)
end
build_time=(time)
click to toggle source
def build_time=time
set_cache_setting(:build, time)
end
create(options = {})
click to toggle source
def create(options = {})
super do |op, config|
if op == :config
config.import(exec_options(:create))
config[:provision_enabled] = false
end
end
end
create_image(options = {})
click to toggle source
def create_image(options = {})
super do |op, config|
if op == :config
config.import(exec_options(:image))
end
end
end
destroy(options = {})
click to toggle source
def destroy(options = {})
super do |op, config|
if op == :config
config.import(exec_options(:destroy))
end
end
end
download(remote_path, local_path, options = {})
click to toggle source
def download(remote_path, local_path, options = {})
super do |op, config|
if op == :config
config.import(exec_options(:download))
end
end
end
exec(options = {})
click to toggle source
def exec(options = {})
super do |op, config|
if op == :config
config.import(exec_options(:exec))
end
end
end
exec_options(name, options = {})
click to toggle source
def exec_options(name, options = {})
extended_config(name, options).export
end
filter_output(type, data)
click to toggle source
def filter_output(type, data)
if type == :error
if data.include?('stdin: is not a tty') || data.include?('unable to re-open stdin')
data = ''
end
end
data
end
image_id(image)
click to toggle source
def image_id(image)
image.id
end
image_search_text(image)
click to toggle source
def image_search_text(image)
image.to_s
end
init_shares()
click to toggle source
def init_shares
shares.each do |name, info|
local_dir = info[:local]
network.ignore(local_dir)
end
end
machine_config() { |config| ... }
click to toggle source
def machine_config
super do |config|
config[:vm] = vm
config[:shares] = shares
yield(config) if block_given?
end
end
machine_type_id(machine_type)
click to toggle source
def machine_type_id(machine_type)
machine_type
end
normalize(reload) { || ... }
click to toggle source
def normalize(reload)
super
unless reload
machine_provider = :vagrant
machine_provider = yield if block_given?
myself.machine = create_machine(:machine, machine_provider, machine_config)
end
network.ignore([ '.vagrant', 'boxes' ])
init_shares
end
reload(options = {})
click to toggle source
def reload(options = {})
super do |op, config|
if op == :config
config.import(exec_options(:reload))
config[:provision_enabled] = false
end
end
end
render_image(image)
click to toggle source
def render_image(image)
''
end
render_machine_type(machine_type)
click to toggle source
def render_machine_type(machine_type)
machine_type.to_s
end
save(options = {})
click to toggle source
def save(options = {})
super do
id(true)
delete_setting(:machine_type)
end
end
shares()
click to toggle source
def shares
hash(myself[:shares])
end
shares=(shares)
click to toggle source
def shares=shares
myself[:shares] = shares
init_shares
end
ssh()
click to toggle source
def ssh
hash(myself[:ssh])
end
ssh=(ssh)
click to toggle source
def ssh=ssh
myself[:ssh] = ssh
end
start(options = {})
click to toggle source
def start(options = {})
super do |op, config|
if op == :config
config.import(exec_options(:start))
config[:provision_enabled] = false
end
end
end
state(reset = false)
click to toggle source
def state(reset = false)
machine.state
end
stop(options = {})
click to toggle source
def stop(options = {})
super do |op, config|
if op == :config
config.import(exec_options(:stop))
elsif op == :finalize
true
end
end
end
upload(local_path, remote_path, options = {})
click to toggle source
def upload(local_path, remote_path, options = {})
super do |op, config|
if op == :config
config.import(exec_options(:upload))
end
end
end
vm()
click to toggle source
def vm
hash(myself[:vm])
end
vm=(vm)
click to toggle source
def vm=vm
myself[:vm] = vm
end