Class: Datahen::CLI::ScraperExporter
- Inherits:
-
Thor
- Object
- Thor
- Datahen::CLI::ScraperExporter
- Defined in:
- lib/datahen/cli/scraper_exporter.rb
Class Method Summary collapse
Instance Method Summary collapse
- #list(scraper_name) ⇒ Object
- #show(scraper_name, exporter_name) ⇒ Object
- #start(scraper_name, exporter_name) ⇒ Object
Class Method Details
.banner(command, namespace = nil, subcommand = false) ⇒ Object
5 6 7 |
# File 'lib/datahen/cli/scraper_exporter.rb', line 5 def self.(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() 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() 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 [:job] client = Client::JobExport.new() puts "#{client.create([:job], exporter_name)}" else client = Client::ScraperExport.new() puts "#{client.create(scraper_name, exporter_name)}" end end |