Class: Cinch::BotTemplate::CLI::Base
- Inherits:
-
Object
- Object
- Cinch::BotTemplate::CLI::Base
- Defined in:
- lib/cinch/bot_template/main/cli.rb
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(shell:, options:) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(shell:, options:) ⇒ Base
Returns a new instance of Base.
11 12 13 14 15 16 |
# File 'lib/cinch/bot_template/main/cli.rb', line 11 def initialize(shell:, options:) @hl = HighLine.new($stdin, $stderr, 80) @opts = Hash.new { |hash, key| hash[key] = {} } @options = @shell = shell end |
Instance Method Details
#generate ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/cinch/bot_template/main/cli.rb', line 18 def generate init = Cinch::BotTemplate::Classes::Init.new( options: @options, shell: @shell, all: true ) init.generate directory = init.directory config = Cinch::BotTemplate::Classes::Config.new( options: @options, shell: @shell, all: true ) cfg_path = config.generate(directory) bot = Cinch::BotTemplate::Classes::Bot.new( options: @options, shell: @shell, all: true ) bot.generate(directory: directory, config_file: cfg_path) plugins = Cinch::BotTemplate::Classes::Plugin.new( shell: @shell, options: @options, all: true ) plugins.generate(directory: directory) end |