Class: DevTrainingBot::Cli
- Inherits:
-
Thor
- Object
- Thor
- DevTrainingBot::Cli
- Defined in:
- lib/dev_training_bot/cli.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.exit_on_failure? ⇒ Boolean
6 7 8 |
# File 'lib/dev_training_bot/cli.rb', line 6 def self.exit_on_failure? true end |
Instance Method Details
#list ⇒ Object
48 49 50 51 52 53 54 |
# File 'lib/dev_training_bot/cli.rb', line 48 def list topics_table = topic_service.topics.map do |topic| ['', set_color(topic., :blue), topic.title] end print_table topics_table end |
#open ⇒ Object
18 19 20 |
# File 'lib/dev_training_bot/cli.rb', line 18 def open Launchy.open GoogleDriveService::DOC_URL end |
#publish ⇒ Object
40 41 42 43 44 45 |
# File 'lib/dev_training_bot/cli.rb', line 40 def publish topics = topic_service.to_poll(exclude: [:exclude]) slack_service.create_poll(topics) slack_service.link_doc say 'Successfully published the poll!', :green end |
#save(file) ⇒ Object
28 29 30 31 32 |
# File 'lib/dev_training_bot/cli.rb', line 28 def save(file) mime = GoogleDriveService.mime([:format]) drive_service.export_file(ENV['FILE_ID'], mime, download_dest: file) say 'Successfully saved the document!', :green end |
#version ⇒ Object
13 14 15 |
# File 'lib/dev_training_bot/cli.rb', line 13 def version say "v#{VERSION}" end |