require "thor" module Boty class CLI < Thor include Thor::Actions class_option :verbose, type: :boolean attr_reader :bot_name, :company, :api_key source_root File.expand_path("../../../template", __FILE__) desc "new [BOT_NAME]", "Creates a BOT_NAME dir with your new bot structure." def new(bot_name) @bot_name = bot_name acquire_bot_info bot_name directory "project", bot_name, verbose: verbose inside bot_name do run "chmod +x bot" end end private def verbose options[:verbose] end def acquire_bot_info(bot_name) @company = ask("What is your Slack company name?") || "acme" @api_key = ask("What is the #{@bot_name} api key?") || "omg-lol-bbq" end end end