More tasks into app generator.

This commit is contained in:
José Valim
2009-06-16 09:39:36 +02:00
parent 489f422152
commit 42e51ea9c0
5 changed files with 39 additions and 46 deletions

View File

@@ -1,10 +0,0 @@
# 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

View File

@@ -1,3 +0,0 @@
# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
end

View File

@@ -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