Subject: rake and rake command what is brief introduction

Rake ( are to build a language, and make (
ant ( is to imagine. Rake is written in Ruby, it supported its own DSL to handle and maintain
Ruby applications. Rails using rake extension to complete a variety of different tasks. Following some of the most used Rails mission Rake.
Through the procedure in your rails root directory to run rake-T to be a complete list of tasks.

  • rake: do not run rake with no parameters will be to rebuild the test database migrations, and run the test directory of all the unit testing, functional testing and integration testing
  • rake db: migrate: to update the current environment of the database to the latest version. You can specify the directory version in order to add VERSION = X.
  • rake db: sessions: create: in the database to create a table used to store user session data. Rails will be automatically allocated for each user session cookie used to track users. Conversation as a very useful mechanism for user authentication.
  • rake db: sessions: clear: clear the sessions table. Time interval in the rules to run this command used to prevent excessive growth of the size of the table. Each user access applications will result in the sessions table to add a record.
  • rake log: clear: cut-off application log directory of log files. Sessions as data, log files have also become very large, so it is best when the removal of them from time to time.
  • rake rails: freeze: gems: locking rails applications rails gem version to the latest version. If you are not running this command (or rake rails: freeze: edge) to your application's gem version in the latest version and old versions floating, this will lead to the issue of backward compatibility, if the rails of the code changed.
  • rake rails: freeze: edge: and rake rails: freeze: gem similar to rails code in order to distinguish it locked in the latest version. rails code was Kaodao application vendor / rails directory.
  • rake rails: unfreeze: interruption of the two described above freeze command to create applications and rails version of the connection.
  • rake stats: the output of your application's useful statistics, including lines of code and code to test ratio.


Ways to generate API documentation:

rdoc-f chm-n xxx README src /

Note:-f chm generate chm format means that document
chm file xxx is the file name (will be automatically included chm suffix)
README is to add the readme file name and path
src / yes-source directory is located (here, "src /" are the path of ruby source)
Generated files into the doc directory of the current directory, if already exist will be prompted to doc directory already exists can not be implemented

Note: The path must be /-separated, rather than windows of \
Generate chm must have Microsoft's HTML Help Workshop

分类:Ruby 时间:2009-03-04 人气:623
blog comments powered by Disqus


iOS 开发

Android 开发

Python 开发



PHP 开发

Ruby 开发






Javascript 开发

.NET 开发



Copyright (C), All Rights Reserved. 版权所有 闽ICP备15018612号

processed in 0.037 (s). 13 q(s)