对ror项目目录的划分还不是很清楚,逛http://guides.rubyonrails.org/getting_started.html 时发现了这个表格:
File/Folder | Purpose |
---|---|
app/ | Contains the controllers, models, views and assets for your application. You’ll focus on this folder for the remainder of this guide. |
config/ | Configure your application’s runtime rules, routes, database, and more. This is covered in more detail inConfiguring Rails Applications |
config.ru | Rack configuration for Rack based servers used to start the application. |
db/ | Contains your current database schema, as well as the database migrations. |
doc/ | In-depth documentation for your application. |
Gemfile Gemfile.lock | These files allow you to specify what gem dependencies are needed for your Rails application. |
lib/ | Extended modules for your application. |
log/ | Application log files. |
public/ | The only folder seen to the world as-is. Contains the static files and compiled assets. |
Rakefile | This file locates and loads tasks that can be run from the command line. The task definitions are defined throughout the components of Rails. Rather than changing Rakefile, you should add your own tasks by adding files to the lib/tasks directory of your application. |
README.rdoc | This is a brief instruction manual for your application. You should edit this file to tell others what your application does, how to set it up, and so on. |
script/ | Contains the rails script that starts your app and can contain other scripts you use to deploy or run your application. |
test/ | Unit tests, fixtures, and other test apparatus. These are covered in Testing Rails Applications |
tmp/ | Temporary files |
vendor/ | A place for all third-party code. In a typical Rails application, this includes Ruby Gems, the Rails source code (if you optionally install it into your project) and plugins containing additional prepackaged functionality. |
我来试着翻译下:
文件夹/文件 说明
app目录 项目的 控制器、模型、视图 和 assets , 你的主要精力将花在此目录
config目录 配置项目运行规则、数据库等等。这里包含更多的rails项目配置细节
config.ru文件
db目录 包含你当前的数据库模式,以及数据库迁移。
doc目录 项目详细文档
Gemfile 这些文件用来指定你的项目gem依赖
Gemfile.lock
lib目录 项目扩展包
log目录 系统日志文件
public目录 公共资源。包含静态文件和链接资源
RakeFile
README.rdoc readme文件
script目录 项目运行或清理的脚步
test目录 单元测试
tmp目录 历史文件
vendor目录 第三方代码,插件等