Class: Datahen::CLI::ScraperExporter

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details



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

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

Instance Method Details

#list(scraper_name) ⇒ Object



33
34
35
36
# File 'lib/datahen/cli/scraper_exporter.rb', line 33

def list(scraper_name)
  client = Client::ScraperExporter.new(options)
  puts "#{client.all(scraper_name)}"
end

#show(scraper_name, exporter_name) ⇒ Object



10
11
12
13
# File 'lib/datahen/cli/scraper_exporter.rb', line 10

def show(scraper_name, exporter_name)
  client = Client::ScraperExporter.new(options)
  puts "#{client.find(scraper_name, exporter_name)}"
end

#start(scraper_name, exporter_name) ⇒ Object



17
18
19
20
21
22
23
24
25
# File 'lib/datahen/cli/scraper_exporter.rb', line 17

def start(scraper_name, exporter_name)
  if options[:job]
    client = Client::JobExport.new(options)
    puts "#{client.create(options[:job], exporter_name)}"
  else
    client = Client::ScraperExport.new(options)
    puts "#{client.create(scraper_name, exporter_name)}"
  end
end