Class: Datahen::CLI::Finisher

Inherits:
Thor
  • Object
show all
Defined in:
lib/datahen/cli/finisher.rb

Instance Method Summary collapse

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 options[:job]
    job_id = options[:job]
  else
    job = Client::ScraperJob.new(options).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 options[:job]
    job_id = options[:job]
  else
    job = Client::ScraperJob.new(options).find(scraper_name)
    job_id = job['id']
  end

  puts Datahen::Scraper::Finisher.exec_finisher(finisher_file, job_id, false)
end