App/Test->Most of our work takes placed in app/test directory.
DocàThe doc directory is used for application documentation. It is produced using RDoc. If you run rake doc:app, you’ll end up with HTML documentation in the directory doc/app.
LibàThe lib directory holds application code that doesn’t fit neatly into a model,view, or controller. For example, you may have written a library that creates PDF receipts that your store’s customers can download.
1 These receipts are sent directly from the controller to the browser (using the send_data method).
The code that creates these PDF receipts will sit naturally in the lib directory.
The lib directory is also a good place to put code that’s shared among models,views, or controllers.
Rake TasksàRails provides a Rake task to tell you the latest migration that has been performed.
LogàAs Rails runs, it produces a bunch of useful logging information. This is stored (by default) in the log directory. Here you’ll find three main log files, called development.log, test.log, and production.log. The logs contain more than just simple trace lines; they also contain timing statistics, cache information, and expansions of the database statements executed.
PublicàThe public directory is the external face of your application. The web server takes this directory as the base of the application. Much of the deployment configuration takes place here.
ScriptàThe script directory holds programs that are useful for developers. Run most of these scripts with no arguments to get usage information. About Displays the version numbers of Ruby and the Rails components being used by your application, along with other configuration information. Dbconsole Allows you to directly interact with your database via the command line.
Console->Allows you to use irb to interact with your Rails application methods. irb
Destroy->Removes auto generated files created by generate.
Generate->A code generator. Out of the box, it will create controllers, mailers, models, scaffolds, and web services. You can also download additional generator modules from the Rails website.2 Run generate with no arguments for usage information on a particular generator, for example: ruby scriptgenerate migration.
Plugin->Helps you install and administer plug-ins—pieces of functionality that extend the capabilities of Rails.
Runner->Executes a method in your application outside the context of the Web. You could use this to invoke cache expiry methods from a cron job or handle incoming e-mail.
Server->Runs your Rails application in a self-contained web server, using Mongrel (if it is available on your box) or WEBrick. We’ve been using this in our Depot application during development.
Benchmarker->Generates performance numbers on one or more methods in your application.
Profiler->Creates a runtime-profile summary of a chunk of code from your application.
Request->Creates a runtime-profile summary of a URI request processed by your application.
TempàIt probably isn’t a surprise that Rails keeps its temporary files tucked up in the tmp directory. You’ll find subdirectories for cache contents, sessions, and sockets in here.
VenderàIs this directory where third party code live.
No comments:
Post a Comment