Class: DbDumper::RemoteMachine

Inherits:
Object
  • Object
show all
Defined in:
lib/db_dumper/remote_machine.rb,
lib/db_dumper/remote_machine/ssh_agent.rb

Defined Under Namespace

Classes: SshAgent

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config, dest, dumped_tables, copy_commands) ⇒ RemoteMachine

Returns a new instance of RemoteMachine.



7
8
9
10
11
12
# File 'lib/db_dumper/remote_machine.rb', line 7

def initialize(config, dest, dumped_tables, copy_commands)
  @config = config
  @dest = dest
  @dumped_tables = dumped_tables
  @copy_commands = copy_commands
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



5
6
7
# File 'lib/db_dumper/remote_machine.rb', line 5

def config
  @config
end

#copy_commandsObject (readonly)

Returns the value of attribute copy_commands.



5
6
7
# File 'lib/db_dumper/remote_machine.rb', line 5

def copy_commands
  @copy_commands
end

#destObject (readonly)

Returns the value of attribute dest.



5
6
7
# File 'lib/db_dumper/remote_machine.rb', line 5

def dest
  @dest
end

#dumped_tablesObject (readonly)

Returns the value of attribute dumped_tables.



5
6
7
# File 'lib/db_dumper/remote_machine.rb', line 5

def dumped_tables
  @dumped_tables
end

Instance Method Details

#dumpObject



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/db_dumper/remote_machine.rb', line 14

def dump
  with_ssh do |ssh|
    dump_schema(ssh)
    dump_data(ssh)

    download_schema(ssh)
    download_data(ssh)

    clean(ssh)
  end
end