Class: Taza::ProjectGenerator

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/taza/generators/project_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



12
13
14
# File 'lib/taza/generators/project_generator.rb', line 12

def self.source_root
  File.dirname(__FILE__)
end

Instance Method Details

#createObject



17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/taza/generators/project_generator.rb', line 17

def create
  template('templates/project/Gemfile.tt', 'Gemfile') unless File.exists? 'Gemfile'
  template('templates/project/Rakefile.tt', 'Rakefile') unless File.exists? 'Rakefile'
  template('templates/project/config.yml.tt', 'config/config.yml') unless File.exists? 'config/config.yml'
  empty_directory 'lib/sites'
  empty_directory 'spec'
  template('templates/project/spec_helper.rb.tt', 'spec/spec_helper.rb') unless File.exists? 'spec/spec_helper.rb'
  empty_directory 'spec/isolation'
  empty_directory 'spec/integration'
  empty_directory 'bin'
  template('templates/project/taza.tt', 'bin/taza') unless File.exists? 'bin/taza'
end