专注于互联网--专注于架构

最新标签
网站地图
文章索引
Rss订阅

首页 »Java教程 » rails:java基础之rails命令大全 »正文

rails:java基础之rails命令大全

来源: 发布时间:星期四, 2009年2月12日 浏览:127次 评论:0


<SPAN style="FONT-SIZE: x-small"> 创建个Rails应用
</SPAN>


$ rails app_name
可选项:
-d, database=xxx 指定安装个数据库(mysql oracle postgresql sqlite2 sqlite3 ), 默认情况下是数据库
-r, ruby-path= 指定Ruby安装路径,如果没有指定scripts使用env去找Ruby
-f, freeze (冻结)freezes Rails在vendor/rails目录

<SPAN style="FONT-SIZE: x-small"><SPAN> API Documentation</SPAN>
<STRONG>
</STRONG>
</SPAN>


$ gem_server
启动个WEBrick服务器这时候你可以通过Http://localhost:8808/ 打开浏览器去查看rails API文档


<SPAN style="FONT-SIZE: x-small"> Rake</SPAN>

rake db:fixtures:load
# 载入fixtures到当前环境数据库
# 载入指定fixtures使用FIXTURES=x,y
rake db:migrate
# 迁移数据库通过在db/migrate目录下脚本.可以指定版本号通过VERSION=x
rake db:schema:dump
# 创建个db/schema.rb文件通过AR能过够支持任何数据库去使用
rake db:schema:load
# 载入个schema.rb文件进数据库
rake db:sessions:clear
# 清空sessions表
rake db:sessions:create
# 用CGI::Session::ActiveRecordStore创建个sessions表为用户
rake db:structure:dump
# 导出数据库结构为个SQL文件
rake db:test:clone
# 重新创建个测试数据库从当前环境数据库中
rake db:test:clone_structure
# 重新创建测试数据库从开发模式数据库
rake db:test:prepare
# 准备测试数据库并在入schema
rake db:test:purge
# 清空测试数据库
rake doc:app
# 创建HTML文件API Documentation
rake doc:clobber_app
# 删除Documentation
rake doc:clobber_plugins
# 删除 plugin Documentation
rake doc:clobber_rails
# 删除Documentation
rake doc:plugins
# 产生Documation为所有安装plugins
rake doc:rails
# 创建HTML文件API Documentation
rake doc:reapp
# 强制重新创建HTML文件API Documentation
rake doc:rerails
# 强制重新创建HTML文件API Documentation
rake log:clear
# 清空目录log/下所有日志文件
rake rails:freeze:edge
# Lock this application to latest Edge Rails. Lock a specic revision with REVISION=X
rake rails:freeze:gems
# Lock this application to the current gems (by unpacking them o vendor/rails)
rake rails:unfreeze
# Unlock this application from freeze of gems or edge and to a fluid use of system gems
rake rails:update
# Update both scripts and public/javascripts from Rails
rake rails:update:javascripts
# Update your javascripts from your current rails
rake rails:update:scripts
# Add scripts to the application script/ directory
rake stats





# Report code statistics (KLOCs, etc) from the application
rake test
# Test all units and functionals
rake test:functionals
# Run tests for functionalsdb:test:prepare
rake test:egration
# Run tests for egrationdb:test:prepare
rake test:plugins
# Run tests for pluginsenvironment
rake test:recent
# Run tests for recentdb:test:prepare
rake test:uncommitted
# Run tests for uncommitteddb:test:prepare
rake test:units
# Run tests for unitsdb:test:prepare
rake tmp:cache:clear
# 清空tmp/cache目录下所有文件
rake tmp:clear
# 清空session, cache, 和文件从tmp/目录
rake tmp:create
# 为sessions, cache, and s创建tmp/目录
rake tmp:sessions:clear
# 清空所有在tmp/sessions目录下文件
rake tmp:s:clear
# 清空所有在tmp/sessions 目录下ruby_sess.* 文件

<SPAN style="FONT-SIZE: x-small"><SPAN>Scripts</SPAN>
<STRONG>
</STRONG>
</SPAN>


script/about
# 输出当前环境信息
script/poer
# 启动断点server
script/console
# 启动交换式Rails控制台
script/destroy
# 删除通过generators创建文件
script/generate
# -> generators
script/plugin
# -> Plugins
script/runner
# 执行个任务在rails上下文中
script/server
# 启动开发模式服务器http://localhost:3000
//以下几个不知道如何去使用
script/performance/profiler
script/performance/benchmarker
script/process/reaper
script/process/spawner


<SPAN style="FONT-SIZE: x-small">Generators</SPAN>

ruby script/generate model ModelName
ruby script/generate controller ListController show edit
ruby script/generate scaffold ModelName ControllerName
ruby script/generate migration AddNewTable
ruby script/generate plugin PluginName
ruby script/generate mailer Notication lost_password signup
ruby script/generate web_service ServiceName api_one api_two
ruby script/generate egration_test TestName
ruby script/generate session_migration
可选项:
-p, --pretend Run but do not make any changes.
-f, --force Overwrite files that already exist.
-s, --skip Skip files that already exist.
-q, --quiet Suppress normal output.
-t, --backtrace Debugging: show backtrace _disibledevent=>




<SPAN style="FONT-SIZE: x-small">Plugins</SPAN>

script/plugin discover
# discover plugin repositories
script/plugin list
# list all available plugins
script/plugin where
# the a€wherea€? plugin
script/plugin -x where
# where plugin as SVN external
script/plugin http://invisible.ch/projects/plugins/where
script/plugin update
# update ed plugins
script/plugin source
# add a source repository
script/plugin unsource
# removes a source repository
script/plugin sources
# lists source repositories

0

相关文章

读者评论

发表评论

  • 昵称:
  • 内容: