diff options
author | José Valim <jose.valim@gmail.com> | 2009-06-16 09:39:36 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2009-06-19 16:10:42 +0200 |
commit | 42e51ea9c03cdd4833585239c239c420cf808758 (patch) | |
tree | e6df4ea7cd345317465e070a13e1ea21be65618c | |
parent | 489f42215223bda3a0a2d8f9b740007a6ee3fc54 (diff) | |
download | rails-42e51ea9c03cdd4833585239c239c420cf808758.tar.gz rails-42e51ea9c03cdd4833585239c239c420cf808758.tar.bz2 rails-42e51ea9c03cdd4833585239c239c420cf808758.zip |
More tasks into app generator.
-rw-r--r-- | railties/configs/empty.log | 0 | ||||
-rw-r--r-- | railties/helpers/application_controller.rb | 10 | ||||
-rw-r--r-- | railties/helpers/application_helper.rb | 3 | ||||
-rw-r--r-- | railties/lib/generator/generators/app.thor | 72 | ||||
-rw-r--r-- | railties/lib/generator/templates/app/doc/README_FOR_APP (renamed from railties/doc/README_FOR_APP) | 0 |
5 files changed, 39 insertions, 46 deletions
diff --git a/railties/configs/empty.log b/railties/configs/empty.log deleted file mode 100644 index e69de29bb2..0000000000 --- a/railties/configs/empty.log +++ /dev/null diff --git a/railties/helpers/application_controller.rb b/railties/helpers/application_controller.rb deleted file mode 100644 index 6635a3f487..0000000000 --- a/railties/helpers/application_controller.rb +++ /dev/null @@ -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 diff --git a/railties/helpers/application_helper.rb b/railties/helpers/application_helper.rb deleted file mode 100644 index 22a7940eb2..0000000000 --- a/railties/helpers/application_helper.rb +++ /dev/null @@ -1,3 +0,0 @@ -# Methods added to this helper will be available to all templates in the application. -module ApplicationHelper -end diff --git a/railties/lib/generator/generators/app.thor b/railties/lib/generator/generators/app.thor index 6e9bae9ce0..cadc53c494 100644 --- a/railties/lib/generator/generators/app.thor +++ b/railties/lib/generator/generators/app.thor @@ -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 diff --git a/railties/doc/README_FOR_APP b/railties/lib/generator/templates/app/doc/README_FOR_APP index fe41f5cc24..fe41f5cc24 100644 --- a/railties/doc/README_FOR_APP +++ b/railties/lib/generator/templates/app/doc/README_FOR_APP |