Class: Middleman::Cli::Extension
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Middleman::Cli::Extension
- Includes:
- Thor::Actions
- Defined in:
- middleman-cli/lib/middleman-cli/extension.rb
Overview
A thor task for creating new projects
Class Method Summary collapse
-
.source_root ⇒ String
Template files are relative to this file.
Instance Method Summary collapse
-
#extension ⇒ Object
The extension task.
Class Method Details
.source_root ⇒ String
Template files are relative to this file
14 15 16 |
# File 'middleman-cli/lib/middleman-cli/extension.rb', line 14 def self.source_root File.join(File.dirname(__FILE__), 'templates') end |
Instance Method Details
#extension ⇒ Object
The extension task
28 29 30 31 32 33 34 35 36 37 |
# File 'middleman-cli/lib/middleman-cli/extension.rb', line 28 def extension copy_file 'extension/gitignore', File.join(name, '.gitignore') unless [:'skip-git'] template 'extension/Rakefile', File.join(name, 'Rakefile') template 'extension/gemspec', File.join(name, "#{name}.gemspec") template 'extension/Gemfile', File.join(name, 'Gemfile') template 'extension/lib/lib.rb', File.join(name, 'lib', "#{name}.rb") template 'extension/lib/lib/extension.rb', File.join(name, 'lib', name, 'extension.rb') template 'extension/features/support/env.rb', File.join(name, 'features', 'support', 'env.rb') empty_directory File.join(name, 'fixtures') end |