Class: Avm::EacWebappBase0::Instances::Runners::Data::Load

Inherits:
Object
  • Object
show all
Defined in:
lib/avm/eac_webapp_base0/instances/runners/data/load.rb

Instance Method Summary collapse

Instance Method Details

#dump_instance_methodObject



46
47
48
# File 'lib/avm/eac_webapp_base0/instances/runners/data/load.rb', line 46

def dump_instance_method
  :dump_database
end

#dump_path_uncachedObject



28
29
30
31
32
33
# File 'lib/avm/eac_webapp_base0/instances/runners/data/load.rb', line 28

def dump_path_uncached
  return parsed.dump_path.to_s if parsed.dump_path.present?
  return source_instance_dump_path if parsed.source_instance.present?

  raise "Dump path unknown (Options: #{parsed})"
end

#load_dumpObject



41
42
43
44
# File 'lib/avm/eac_webapp_base0/instances/runners/data/load.rb', line 41

def load_dump
  info "Loading dump \"#{dump_path}\"..."
  package_load.run
end

#runObject



20
21
22
23
24
25
26
# File 'lib/avm/eac_webapp_base0/instances/runners/data/load.rb', line 20

def run
  return fatal_error("Dump \"#{dump_path}\" does not exist") unless
  ::File.exist?(dump_path)

  load_dump
  success("Dump loaded from \"#{dump_path}\"")
end

#source_instance_dump_pathObject



35
36
37
38
39
# File 'lib/avm/eac_webapp_base0/instances/runners/data/load.rb', line 35

def source_instance_dump_path
  runner_context.call(:instance).class.by_id(parsed.source_instance).run_subcommand(
    ::Avm::EacWebappBase0::Instances::Runners::Data::Dump, []
  )
end