Class: Jambots::Controllers::InitController
- Inherits:
-
Object
- Object
- Jambots::Controllers::InitController
- Defined in:
- lib/jambots/controllers/init_controller.rb
Instance Method Summary collapse
- #init_jambots_path ⇒ Object
-
#initialize(options) ⇒ InitController
constructor
A new instance of InitController.
Constructor Details
#initialize(options) ⇒ InitController
Returns a new instance of InitController.
4 5 6 |
# File 'lib/jambots/controllers/init_controller.rb', line 4 def initialize() @options = end |
Instance Method Details
#init_jambots_path ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/jambots/controllers/init_controller.rb', line 8 def init_jambots_path path = if @options[:globally] File.("~/.jambots") elsif @options[:path] File.(@options[:path]) else "./.jambots" end FileUtils.mkdir_p(path) puts "Jambots directory initialized at '#{path}'" # Create default bot Jambots::Controllers::NewController .new(path: path) .create_bot(Jambots::Controllers::ChatController::DEFAULT_BOT) end |