精華區beta Ruby 關於我們 聯絡資訊
出自我的 Blog http://lightyror.blogspot.com/2006/09/subversion-ruby-on-rails.html 研發程式時通常都會做 Version Control 現在當然很多 team 都使用 subversion 做 version control 但是今天才發現到 原來 Ruby on Rails 有 Subversion 支援,真令人意外 Ruby on Rails 裡面通常最難做 version control 的地方是 generator 產生的程式 因為產生的程式會放在不同資料夾下面 但是但是 Ruby on Rails 什麼都有什麼都賣,什麼都不奇怪 ruby script/generate xxx abc --svn 或是 ruby script/generate xxx abc -c 我們發現到他的輸出 exists app/models/ exists test/unit/ exists test/fixtures/ create app/models/abc.rb A app/models/abc.rb create test/unit/abc_test.rb A test/unit/abc_test.rb create test/fixtures/abcs.yml A test/fixtures/abcs.yml exists db/migrate create db/migrate/008_create_abcs.rb A db/migrate/008_create_abcs.rb 我們發現到他會幫你 svn add 所有產生的程式 雖然不是跨時代的發明 但是是一個貼心的好設計 ps . 底下是我之前寫的幫所有新增程式做 svn add 的 script 有這個小技巧,這隻程式就功成身退了 rails_locates.each do |i| `#{find_command} #{i} -type d`.split("\n").each do |i| `#{svn_command} add #{i}/*` unless i =~ /\/\.svn/ end end -- lighty RoR 是一個介紹 lighttpd , SQLite , Ruby and Rails 的 Blog http://lightyror.blogspot.com/ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.230.100.32