Class: Middleman::Cli::Init
- Inherits:
-
Thor
- Object
- Thor
- Middleman::Cli::Init
- Defined in:
- middleman-core/lib/middleman-core/cli/init.rb
Overview
A thor task for creating new projects
Instance Method Summary (collapse)
-
- (Object) init(name)
The init task.
Instance Method Details
- (Object) init(name)
The init task
37 38 39 40 41 42 43 44 45 |
# File 'middleman-core/lib/middleman-core/cli/init.rb', line 37 def init(name) key = [:template].to_sym unless ::Middleman::Templates.registered.has_key?(key) raise Thor::Error.new "Unknown project template '#{key}'" end thor_group = ::Middleman::Templates.registered[key] thor_group.new([name], ).invoke_all end |