Class: Datahen::CLI::ScraperJob
- Inherits:
-
Thor
- Object
- Thor
- Datahen::CLI::ScraperJob
- Defined in:
- lib/datahen/cli/scraper_job.rb
Class Method Summary collapse
Instance Method Summary collapse
- #cancel(scraper_name) ⇒ Object
- #delete(scraper_name) ⇒ Object
- #list(scraper_name) ⇒ Object
- #pause(scraper_name) ⇒ Object
- #profile(scraper_name) ⇒ Object
- #resume(scraper_name) ⇒ Object
- #show(scraper_name) ⇒ Object
- #sync_schema(scraper_name) ⇒ Object
- #update(scraper_name) ⇒ Object
Class Method Details
.banner(command, namespace = nil, subcommand = false) ⇒ Object
5 6 7 |
# File 'lib/datahen/cli/scraper_job.rb', line 5 def self.(command, namespace = nil, subcommand = false) "#{basename} #{@package_name} #{command.usage}" end |
Instance Method Details
#cancel(scraper_name) ⇒ Object
41 42 43 44 45 46 47 48 49 |
# File 'lib/datahen/cli/scraper_job.rb', line 41 def cancel(scraper_name) if [:job] client = Client::Job.new() puts "#{client.cancel([:job])}" else client = Client::ScraperJob.new() puts "#{client.cancel(scraper_name)}" end end |
#delete(scraper_name) ⇒ Object
56 57 58 59 60 61 62 63 64 |
# File 'lib/datahen/cli/scraper_job.rb', line 56 def delete(scraper_name) if [:job] client = Client::Job.new() puts "#{client.delete([:job])}" else client = Client::ScraperJob.new() puts "#{client.delete(scraper_name)}" end end |
#list(scraper_name) ⇒ Object
30 31 32 33 |
# File 'lib/datahen/cli/scraper_job.rb', line 30 def list(scraper_name) client = Client::ScraperJob.new() puts "#{client.all(scraper_name)}" end |
#pause(scraper_name) ⇒ Object
87 88 89 90 91 92 93 94 95 |
# File 'lib/datahen/cli/scraper_job.rb', line 87 def pause(scraper_name) if [:job] client = Client::Job.new() puts "#{client.pause([:job], )}" else client = Client::ScraperJob.new() puts "#{client.pause(scraper_name, )}" end end |
#profile(scraper_name) ⇒ Object
131 132 133 134 135 136 137 138 139 |
# File 'lib/datahen/cli/scraper_job.rb', line 131 def profile(scraper_name) if [:job] client = Client::Job.new() puts "#{client.profile([:job])}" else client = Client::ScraperJob.new() puts "#{client.profile(scraper_name)}" end end |
#resume(scraper_name) ⇒ Object
71 72 73 74 75 76 77 78 79 |
# File 'lib/datahen/cli/scraper_job.rb', line 71 def resume(scraper_name) if [:job] client = Client::Job.new() puts "#{client.resume([:job])}" else client = Client::ScraperJob.new() puts "#{client.resume(scraper_name)}" end end |
#show(scraper_name) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/datahen/cli/scraper_job.rb', line 12 def show(scraper_name) if [:job] client = Client::Job.new() puts "#{client.find([:job], )}" else client = Client::ScraperJob.new() puts "#{client.find(scraper_name, )}" end end |
#sync_schema(scraper_name) ⇒ Object
146 147 148 149 150 151 152 153 154 |
# File 'lib/datahen/cli/scraper_job.rb', line 146 def sync_schema(scraper_name) if [:job] client = Client::Job.new() puts "#{client.sync_schema([:job])}" else client = Client::ScraperJob.new() puts "#{client.sync_schema(scraper_name)}" end end |