Class: Twittbot::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/twittbot/cli.rb

Instance Method Summary collapse

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

#authObject



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, options
  generator.create
end

#list_templatesObject



45
46
47
48
49
# File 'lib/twittbot/cli.rb', line 45

def list_templates
  require 'twittbot/template_lister'
  lister = Twittbot::TemplateLister.new options
  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, options
  generator.create
end

#startObject



24
25
26
27
28
# File 'lib/twittbot/cli.rb', line 24

def start
  require 'twittbot/bot'
  bot = Twittbot::Bot.new(options)
  bot.start
end