Class: AnswersEngine::CLI::ScraperExport
- Inherits:
-
Thor
- Object
- Thor
- AnswersEngine::CLI::ScraperExport
- Defined in:
- lib/answersengine/cli/scraper_export.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.banner(command, namespace = nil, subcommand = false) ⇒ Object
5 6 7 |
# File 'lib/answersengine/cli/scraper_export.rb', line 5 def self.(command, namespace = nil, subcommand = false) "#{basename} #{@package_name} #{command.usage}" end |
Instance Method Details
#download(export_id) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/answersengine/cli/scraper_export.rb', line 34 def download(export_id) client = Client::ScraperExport.new() result = JSON.parse(client.download(export_id).to_s) if result['signed_url'] puts "Download url: \"#{result['signed_url']}\"" `open "#{result['signed_url']}"` else puts "Exported file does not exist" end end |
#list ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/answersengine/cli/scraper_export.rb', line 23 def list() if [:scraper_name] client = Client::ScraperExport.new() puts "#{client.all(options[:scraper_name])}" else client = Client::Export.new() puts "#{client.all}" end end |
#show(export_id) ⇒ Object
10 11 12 13 |
# File 'lib/answersengine/cli/scraper_export.rb', line 10 def show(export_id) client = Client::ScraperExport.new() puts "#{client.find(export_id)}" end |