Class: Twittbot::CLI
- Inherits:
-
Thor
- Object
- Thor
- Twittbot::CLI
- Defined in:
- lib/twittbot/cli.rb
Instance Method Summary collapse
- #add_admin(user_name) ⇒ Object
- #auth ⇒ Object
- #cron(task_name) ⇒ Object
- #del_admin(user_name) ⇒ Object
- #generate(template_name) ⇒ Object
- #list_templates ⇒ Object
- #new(app_name) ⇒ Object
- #start ⇒ Object
Instance Method Details
#add_admin(user_name) ⇒ Object
52 53 54 55 56 |
# File 'lib/twittbot/cli.rb', line 52 def add_admin(user_name) require 'twittbot/bot' bot = Twittbot::Bot.new bot.modify_admin(user_name, :add) end |
#auth ⇒ Object
16 17 18 19 20 |
# File 'lib/twittbot/cli.rb', line 16 def auth require 'twittbot/bot' bot = Twittbot::Bot.new bot.auth end |
#cron(task_name) ⇒ Object
31 32 33 34 35 |
# File 'lib/twittbot/cli.rb', line 31 def cron(task_name) require 'twittbot/bot' bot = Twittbot::Bot.new(save_config: false) bot.cron(task_name.downcase.to_sym) end |
#del_admin(user_name) ⇒ Object
59 60 61 62 63 |
# File 'lib/twittbot/cli.rb', line 59 def del_admin(user_name) require 'twittbot/bot' bot = Twittbot::Bot.new bot.modify_admin(user_name, :delete) end |
#generate(template_name) ⇒ Object
38 39 40 41 42 |
# File 'lib/twittbot/cli.rb', line 38 def generate(template_name) require 'twittbot/generators/templates/template_generator' generator = Twittbot::Generators::TemplateGenerator.new template_name, generator.create end |
#list_templates ⇒ Object
45 46 47 48 49 |
# File 'lib/twittbot/cli.rb', line 45 def list_templates require 'twittbot/template_lister' lister = Twittbot::TemplateLister.new lister.list end |
#new(app_name) ⇒ Object
9 10 11 12 13 |
# File 'lib/twittbot/cli.rb', line 9 def new(app_name) require 'twittbot/generators/twittbot/app/app_generator' generator = Twittbot::Generators::AppGenerator.new app_name, generator.create end |