Class: RubyLambda::Init
- Inherits:
-
Object
- Object
- RubyLambda::Init
- Defined in:
- lib/ruby_lambda/init.rb
Constant Summary collapse
- TEMPLATE_DIR =
"#{__dir__}/templates"
Instance Method Summary collapse
-
#initialize(current_directory) ⇒ Init
constructor
A new instance of Init.
- #run(mute: false) ⇒ Object
Constructor Details
#initialize(current_directory) ⇒ Init
Returns a new instance of Init.
6 7 8 9 |
# File 'lib/ruby_lambda/init.rb', line 6 def initialize(current_directory) @current_directory = current_directory @shell = Thor::Base.shell.new end |
Instance Method Details
#run(mute: false) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/ruby_lambda/init.rb', line 11 def run(mute: false) @mute = mute unless File.writable?(@current_directory) @shell.say "Can not create files as the current directory is not writable: #{@current_directory}", :red return end move_template_files rename_env_file update_function_name end |