Class: KBuilder::Watch::ActionNewBuilder
- Inherits:
-
BaseAction
- Object
- BaseAction
- KBuilder::Watch::ActionNewBuilder
- Defined in:
- lib/k_builder/watch/action_new_builder.rb
Overview
Action for creating a new app with .builders
Instance Attribute Summary
Attributes inherited from BaseAction
Instance Method Summary collapse
Methods inherited from BaseAction
Constructor Details
This class inherits a constructor from KBuilder::Watch::BaseAction
Instance Method Details
#run ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/k_builder/watch/action_new_builder.rb', line 13 def run setup_file = File.join(.new_watch_path, 'setup.rb') config_file = File.join(.new_watch_path, 'config', '_.rb') FileUtils.mkdir_p(File.dirname(config_file)) File.write(setup_file, "require 'config/_'") unless File.exist?(setup_file) File.write(config_file, "puts '_'\n\n#require 'config/_initialize'") unless File.exist?(config_file) system("code #{File.join(.new_app_path, '.')}") end |