diff options
Diffstat (limited to 'railties/lib/generator')
-rw-r--r-- | railties/lib/generator/generators/app.thor | 72 | ||||
-rw-r--r-- | railties/lib/generator/templates/app/doc/README_FOR_APP | 2 |
2 files changed, 41 insertions, 33 deletions
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/lib/generator/templates/app/doc/README_FOR_APP b/railties/lib/generator/templates/app/doc/README_FOR_APP new file mode 100644 index 0000000000..fe41f5cc24 --- /dev/null +++ b/railties/lib/generator/templates/app/doc/README_FOR_APP @@ -0,0 +1,2 @@ +Use this README file to introduce your application and point to useful places in the API for learning more. +Run "rake doc:app" to generate API documentation for your models, controllers, helpers, and libraries. |