Class: DB2Fog::BaseAdaptor

Inherits:
Object
  • Object
show all
Defined in:
lib/db2fog.rb

Direct Known Subclasses

MysqlAdaptor, PsqlAdaptor

Instance Method Summary collapse

Constructor Details

#initialize(credentials) ⇒ BaseAdaptor

Returns a new instance of BaseAdaptor.



91
92
93
# File 'lib/db2fog.rb', line 91

def initialize(credentials)
  @credentials = credentials
end

Instance Method Details

#dumpObject



100
101
102
103
104
# File 'lib/db2fog.rb', line 100

def dump
  dump_file = Tempfile.new("dump")
  run(dump_command(dump_file))
  dump_file.path
end

#run(command) ⇒ Object



95
96
97
98
# File 'lib/db2fog.rb', line 95

def run(command)
  result = system(command)
  raise("error, process exited with status #{$?.exitstatus}") unless result
end