add --rack flag
This commit is contained in:
parent
ee06e01b54
commit
f5550d6fbb
|
@ -18,6 +18,7 @@ module Middleman
|
||||||
method_option "css_dir", :default => "stylesheets", :desc => 'The path to the css files'
|
method_option "css_dir", :default => "stylesheets", :desc => 'The path to the css files'
|
||||||
method_option "js_dir", :default => "javascripts", :desc => 'The path to the javascript files'
|
method_option "js_dir", :default => "javascripts", :desc => 'The path to the javascript files'
|
||||||
method_option "images_dir", :default => "images", :desc => 'The path to the image files'
|
method_option "images_dir", :default => "images", :desc => 'The path to the image files'
|
||||||
|
method_option "rack", :type => :boolean, :default => false, :desc => 'Include a config.ru file'
|
||||||
def init(name)
|
def init(name)
|
||||||
key = options[:template].to_sym
|
key = options[:template].to_sym
|
||||||
unless Middleman::Templates.registered_templates.has_key?(key)
|
unless Middleman::Templates.registered_templates.has_key?(key)
|
||||||
|
|
|
@ -5,7 +5,9 @@ class Middleman::Templates::Default < Middleman::Templates::Base
|
||||||
|
|
||||||
def build_scaffold
|
def build_scaffold
|
||||||
template "shared/config.tt", File.join(location, "config.rb")
|
template "shared/config.tt", File.join(location, "config.rb")
|
||||||
|
if options[:rack]
|
||||||
template "shared/config.ru", File.join(location, "config.ru")
|
template "shared/config.ru", File.join(location, "config.ru")
|
||||||
|
end
|
||||||
copy_file "default/source/index.html.erb", File.join(location, "source/index.html.erb")
|
copy_file "default/source/index.html.erb", File.join(location, "source/index.html.erb")
|
||||||
copy_file "default/source/layout.erb", File.join(location, "source/layout.erb")
|
copy_file "default/source/layout.erb", File.join(location, "source/layout.erb")
|
||||||
empty_directory File.join(location, "source", options[:css_dir])
|
empty_directory File.join(location, "source", options[:css_dir])
|
||||||
|
|
Loading…
Reference in a new issue