Class: EtlRubyWrapper::ETL
- Inherits:
-
Object
- Object
- EtlRubyWrapper::ETL
- Defined in:
- lib/etl_ruby_wrapper.rb
Instance Method Summary collapse
- #binary_path ⇒ Object
- #run_etl(csv_path = "path/to/data.csv", db_conn_str = "your_database_connection_string") ⇒ Object
Instance Method Details
#binary_path ⇒ Object
3 4 5 6 7 |
# File 'lib/etl_ruby_wrapper.rb', line 3 def binary_path path = File.("../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 |