Top Level Namespace
Defined Under Namespace
Modules: ETL, HttpTools Classes: ActiveRecordResolver, FlatFileResolver, SQLResolver, Time
Instance Method Summary collapse
- #execute ⇒ Object
-
#usage ⇒ Object
Print a usage statement.
Instance Method Details
#execute ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/etl/commands/etl.rb', line 32 def execute opts = GetoptLong.new( [ '--version', '-v', GetoptLong::NO_ARGUMENT], [ '--help', '-h', GetoptLong::NO_ARGUMENT ], [ '--config', '-c', GetoptLong::REQUIRED_ARGUMENT ], [ '--limit', '-l', GetoptLong::REQUIRED_ARGUMENT ], [ '--offset', '-o', GetoptLong::REQUIRED_ARGUMENT], [ '--newlog', '-n', GetoptLong::NO_ARGUMENT ], [ '--skip-bulk-import', '-s', GetoptLong::NO_ARGUMENT ], [ '--read-locally', GetoptLong::NO_ARGUMENT], [ '--rails-root', GetoptLong::REQUIRED_ARGUMENT] ) = {} opts.each do |opt, arg| case opt when '--version' puts "ActiveWarehouse ETL version #{ETL::VERSION::STRING}" return when '--help' usage return when '--config' [:config] = arg when '--limit' [:limit] = arg.to_i when '--offset' [:offset] = arg.to_i when '--newlog' [:newlog] = true when '--skip-bulk-import' puts "skip bulk import enabled" [:skip_bulk_import] = true when '--read-locally' puts "read locally enabled" [:read_locally] = true when '--rails-root' [:rails_root] = arg puts "rails root set to #{[:rails_root]}" end end if ARGV.length < 1 usage else puts "Starting ETL process" ETL::Engine.init() ARGV.each do |f| ETL::Engine.realtime_activity = true ETL::Engine.process(f) end puts "ETL process complete\n\n" end end |
#usage ⇒ Object
Print a usage statement
28 29 30 |
# File 'lib/etl/commands/etl.rb', line 28 def usage #:nodoc: puts "Usage: etl file [file file ...]" # TODO: add the command line options end |