Class: Datahen::CLI::Finisher
- Inherits:
-
Thor
- Object
- Thor
- Datahen::CLI::Finisher
- Defined in:
- lib/datahen/cli/finisher.rb
Instance Method Summary collapse
- #exec_parse(scraper_name, finisher_file) ⇒ Object
- #try_finisher(scraper_name, finisher_file) ⇒ Object
Instance Method Details
#exec_parse(scraper_name, finisher_file) ⇒ Object
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/datahen/cli/finisher.rb', line 27 def exec_parse(scraper_name, finisher_file) if [:job] job_id = [:job] else job = Client::ScraperJob.new().find(scraper_name) job_id = job['id'] end puts Datahen::Scraper::Finisher.exec_finisher(finisher_file, job_id, true) end |
#try_finisher(scraper_name, finisher_file) ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/datahen/cli/finisher.rb', line 10 def try_finisher(scraper_name, finisher_file) if [:job] job_id = [:job] else job = Client::ScraperJob.new().find(scraper_name) job_id = job['id'] end puts Datahen::Scraper::Finisher.exec_finisher(finisher_file, job_id, false) end |