Class: Create

Inherits:
Thor::Group
  • Object
show all
Includes:
GeneratorBase::Template, Thor::Actions
Defined in:
lib/centuria/generators/create.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from GeneratorBase::Template

#make_dir, #templater

Class Method Details

.source_rootObject



9
10
11
# File 'lib/centuria/generators/create.rb', line 9

def self.source_root
  File.dirname(__FILE__)
end

Instance Method Details

#create_templateObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/centuria/generators/create.rb', line 13

def create_template
  
  if !use_symbol?(file_name)
    
    files = %w(lib/app.rb Gemfile)
    files.each do |file|
      template "templates/#{file}", "#{file_name}/#{file}"
    end
    
    template "templates/ruby-version.tt", "#{file_name}/.ruby-version"
    create_file "#{file_name}/README.md"
    
    comment(file_name)
  else
    puts "your app name is include symbol cannot use this.\nplease one more."
  end
  
end