提交 42e51ea9 编写于 作者: J José Valim

More tasks into app generator.

上级 489f4221
# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.
class ApplicationController < ActionController::Base
helper :all # include all helpers, all the time
protect_from_forgery # See ActionController::RequestForgeryProtection for details
# Scrub sensitive parameters from your log
# filter_parameter_logging :password
end
# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
end
......@@ -42,44 +42,50 @@ class App < Thor::Group
end
def create_app_files
%w(
app/controllers
app/helpers
app/models
app/views/layouts
).each { |path| empty_directory(path) }
directory "app"
end
def directories
%w(
config/environments
config/initializers
config/locales
db
doc
lib
lib/tasks
log
public/images
public/javascripts
public/stylesheets
script/performance
test/fixtures
test/functional
test/integration
test/performance
test/unit
vendor
vendor/plugins
tmp/sessions
tmp/sockets
tmp/cache
tmp/pids
).each { |path| empty_directory(path) }
def create_doc_files
directory "doc"
end
def create_log_files
empty_directory "log"
inside "log" do
%w( server production development test ).each do |file|
create_file "#{file}.log"
chmod "#{file}.log", 0666, false
end
end
end
# def directories
# %w(
# config/environments
# config/initializers
# config/locales
# db
# lib
# lib/tasks
# public/images
# public/javascripts
# public/stylesheets
# script/performance
# test/fixtures
# test/functional
# test/integration
# test/performance
# test/unit
# vendor
# vendor/plugins
# tmp/sessions
# tmp/sockets
# tmp/cache
# tmp/pids
# ).each { |path| empty_directory(path) }
# end
protected
def app_name
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册