Class: Middleman::Cli::Init
- Inherits:
-
Thor
- Object
- Thor
- Middleman::Cli::Init
- Defined in:
- lib/middleman-core/cli/init.rb
Overview
A thor task for creating new projects
Instance Method Summary collapse
-
#init(name) ⇒ Object
The init task.
Instance Method Details
#init(name) ⇒ Object
The init task
45 46 47 48 49 50 51 52 53 |
# File 'lib/middleman-core/cli/init.rb', line 45 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 |