Class: LeanCloud::Initializer

Inherits:
LeanObject show all
Defined in:
lib/leancloud/initializer.rb

Overview

Leanfile template initializer

Instance Method Summary collapse

Methods inherited from LeanObject

#exit_with_error, #exit_with_info, #show_error, #show_message, #show_success

Constructor Details

#initialize(opts) ⇒ Initializer

Returns a new instance of Initializer.



6
7
8
9
# File 'lib/leancloud/initializer.rb', line 6

def initialize(opts)
  @options = opts
  @leanfile_path = LeanCloud::Installer::LEANFILE_PATH
end

Instance Method Details

#createObject



93
94
95
96
97
98
# File 'lib/leancloud/initializer.rb', line 93

def create
  validate_options
  existed = File.exist?(@leanfile_path)
  generate_leanfile
  prompt(existed)
end