Class: BookmeterExporter::CLI
- Inherits:
-
Thor
- Object
- Thor
- BookmeterExporter::CLI
- Defined in:
- lib/bookmeter_exporter/cli.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.exit_on_failure? ⇒ Boolean
11 12 13 |
# File 'lib/bookmeter_exporter/cli.rb', line 11 def exit_on_failure? true end |
Instance Method Details
#export(email) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/bookmeter_exporter/cli.rb', line 18 def export(email) password = ask("Password for #{email}:", echo: false) puts "" crawler = BookmeterExporter::Crawler.new(email, password) books = crawler.crawl destination = [:destination] || "./books.csv" IO.write(destination, books.to_csv) puts "Books are successfully exported as '#{destination}'." end |
#version ⇒ Object
31 32 33 |
# File 'lib/bookmeter_exporter/cli.rb', line 31 def version puts VERSION end |