Class: Middleman::Cli::Extension

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/middleman-core/cli/extension.rb

Overview

A thor task for creating new projects

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootString

Template files are relative to this file

Returns:



17
18
19
# File 'lib/middleman-core/cli/extension.rb', line 17

def self.source_root
  File.join(File.dirname(__FILE__), "..", "templates", "extension")
end

Instance Method Details

#extensionObject

The extension task

Parameters:



25
26
27
28
29
30
31
32
33
34
# File 'lib/middleman-core/cli/extension.rb', line 25

def extension
  generate_gitignore!
  template "Rakefile", File.join(name, "Rakefile")
  template "gemspec", File.join(name, "#{name}.gemspec")
  template "Gemfile", File.join(name, "Gemfile")
  template "lib/middleman_extension.rb", File.join(name, "lib", "middleman_extension.rb")
  template "lib/lib.rb", File.join(name, "lib", "#{name}.rb")
  template "features/support/env.rb", File.join(name, "features", "support", "env.rb")
  empty_directory File.join(name, "fixtures")
end