Class: Datahen::CLI::Seeder

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

Instance Method Summary collapse

Instance Method Details

#exec_parse(scraper_name, seeder_file) ⇒ Object



29
30
31
32
33
34
35
36
37
38
# File 'lib/datahen/cli/seeder.rb', line 29

def exec_parse(scraper_name, seeder_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::Seeder.exec_seeder(seeder_file, job_id, true, options[:"keep-outputs"])
end

#try_seed(scraper_name, seeder_file) ⇒ Object



11
12
13
14
15
16
17
18
19
20
# File 'lib/datahen/cli/seeder.rb', line 11

def try_seed(scraper_name, seeder_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::Seeder.exec_seeder(seeder_file, job_id, false, options[:"keep-outputs"])
end