Class: Bookshop::Generators::AppGenerator

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/bookshop/generators/bookshop/app/app_generator.rb

Overview

Thor based generator for creating new projects based upon a template project which is copied into the name_of_book project-folder when ‘build new name_of_book’ is issued

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject

Define source root of application



15
16
17
# File 'lib/bookshop/generators/bookshop/app/app_generator.rb', line 15

def self.source_root
  File.dirname(__FILE__)
end

Instance Method Details

#create_base_projectObject

Create the project from templates



21
22
23
24
25
# File 'lib/bookshop/generators/bookshop/app/app_generator.rb', line 21

def create_base_project
  raise GeneratorArgumentsError if app_path.nil?
  puts "creating base project"
  directory "templates", "#{app_path}"
end