Class: Makimono::Command::New

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/makimono/command/new.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



12
13
14
# File 'lib/makimono/command/new.rb', line 12

def self.source_root
  File.expand_path('../../project_template', __dir__)
end

Instance Method Details

#create_filesObject



20
21
22
23
24
25
# File 'lib/makimono/command/new.rb', line 20

def create_files
  copy_file('.gitignore')
  copy_file('Gemfile')
  template('makimono.yml', { name: name })
  copy_file('src/01-Title.md', "src/01-#{name.capitalize}.md")
end

#run_bundle_installObject



27
28
29
30
31
# File 'lib/makimono/command/new.rb', line 27

def run_bundle_install
  in_root do
    run('bundle install')
  end
end

#set_destination_rootObject



16
17
18
# File 'lib/makimono/command/new.rb', line 16

def set_destination_root
  self.destination_root = name
end