Class: EtlRubyWrapper::ETL

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

Instance Method Summary collapse

Instance Method Details

#binary_pathObject



3
4
5
6
7
# File 'lib/etl_ruby_wrapper.rb', line 3

def binary_path
  path = File.expand_path("../bin/etl_binary/etl_ruby_wrapper", __dir__)
  puts "Computed binary path: #{path}"
  path
end

#run_etl(csv_path = "path/to/data.csv", db_conn_str = "your_database_connection_string") ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/etl_ruby_wrapper.rb', line 9

def run_etl(csv_path = "path/to/data.csv", db_conn_str = "your_database_connection_string")
  cmd = "#{binary_path} -csv=#{csv_path} -db='#{db_conn_str}'"
  success = system(cmd)

  unless success
    raise "ETL binary not found or failed to execute"
  end
end