Class: Kryo::Generators::SiteGenerator
- Defined in:
- lib/kryo/generators/site/site_generator.rb
Overview
The standard site generator
Class Method Summary collapse
-
.invoke(name, directory = FileUtils.pwd) ⇒ void
Invokes the generator.
Methods inherited from Base
Class Method Details
.invoke(name, directory = FileUtils.pwd) ⇒ void
This method returns an undefined value.
Invokes the generator
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/kryo/generators/site/site_generator.rb', line 16 def self.invoke name, directory=FileUtils.pwd path = File.join(directory, name) %w{public lib}.each do |dir| FileUtils.mkpath(File.join(path, dir)) end FileUtils.touch(File.join(path, 'public', '.gitkeep')) FileUtils.touch(File.join(path, 'lib', '.gitkeep')) %w{assets pages posts template}.each do |dir| FileUtils.mkpath(File.join(path, 'source', dir)) FileUtils.touch(File.join(path, 'source', dir, '.gitkeep')) end create 'site/templates/config.rb', path create 'site/templates/Gemfile', path end |