Class: Datahen::CLI::ScraperTask

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details



5
6
7
# File 'lib/datahen/cli/scraper_task.rb', line 5

def self.banner(command, namespace = nil, subcommand = false)
  "#{basename} #{@package_name} #{command.usage}"
end

Instance Method Details

#list(scraper_name) ⇒ Object



19
20
21
22
23
24
25
26
27
# File 'lib/datahen/cli/scraper_task.rb', line 19

def list(scraper_name)
  if options[:job]
    client = Client::JobTask.new(options)
    puts "#{client.all(options[:job])}"
  else
    client = Client::ScraperTask.new(options)
    puts "#{client.all(scraper_name)}"
  end
end

#show(scraper_name, task_id) ⇒ Object



35
36
37
38
39
40
41
42
43
# File 'lib/datahen/cli/scraper_task.rb', line 35

def show(scraper_name, task_id)
  if options[:job]
    client = Client::JobTask.new(options)
    puts "#{client.find(options[:job], task_id)}"
  else
    client = Client::ScraperTask.new(options)
    puts "#{client.find(scraper_name, task_id)}"
  end
end