mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
More tasks into app generator.
This commit is contained in:
@@ -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
|
||||
@@ -1,3 +0,0 @@
|
||||
# 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
|
||||
|
||||
Reference in New Issue
Block a user