Class: Mwc::Commands::Init
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Mwc::Commands::Init
- Includes:
- Utils::Command, Thor::Actions
- Defined in:
- lib/mwc/commands/init.rb
Overview
Create a new project
Instance Method Summary collapse
-
#create_mwcrc ⇒ Object
:nodoc:.
- #create_project ⇒ Object
-
#download_mruby ⇒ Object
:nodoc:.
Methods included from Utils::Command
Instance Method Details
#create_mwcrc ⇒ Object
:nodoc:
26 27 28 29 |
# File 'lib/mwc/commands/init.rb', line 26 def create_mwcrc template('mwcrc.erb', '.mwcrc') Mwc.config = Pathname.new(destination_root).join('.mwcrc') end |
#create_project ⇒ Object
19 20 21 22 23 |
# File 'lib/mwc/commands/init.rb', line 19 def create_project directory('app', name) self.destination_root = name Mwc.root = destination_root end |
#download_mruby ⇒ Object
:nodoc:
32 33 34 35 36 37 38 39 40 41 |
# File 'lib/mwc/commands/init.rb', line 32 def download_mruby # TODO: Allow choose download mode empty_directory('vendor') inside(mruby_directory.dirname) do run("curl -OL #{archive_url}") run("tar -zxf #{filename}") remove_file(filename) run("mv mruby-#{version} #{mruby_directory}") end end |