Skip to content

kudelabs/SVNHelper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SVNHelper
=========
原创:黄文斌, Adeh DeSandies.
这个小插件是专门写给使用SVN版本控制的Rails应用程序。
有了它,我们可以在网页上面直接看到我们的程序revision版本,最后的修改日期,甚至所有的svn信息。
它的实现原理并不复杂,自动判断操作系统类型,并保存最新的svn版本信息.
操作系统:linux or mac OS=> 保存'svn info'命令终端输出的结果;
操作系统: windows系列 => 直接读取.svn/entries文件的记录.
如何安装和使用:
=======
安装: $ ruby script/plugin install git@github.com:kudelabs/SVNHelper.git
如果无法安装成功,请直接下载并解压到你程序vendor/plugins目录下.
使用: 在environment.rb里面用全局变量记录它:
$current_version = SVNHelper.version(RAILS_ROOT)
这样子,你可以在erb页面里面调用这个变量,比如:程序版本:<%=$current_version.rev_with_date%>
同时,它会在每次服务器重启的时候重新记录最新修改的svn版本。


This little plugin is specialized for those Rails Applications which are using SVN as version control. It allows us to 
view the revision, the last modified date and even all the svn information of our application on the website.
It's rather simple to implement such function, firstly, we will judge the Operation System type.
Mac OS or Linux => save the output of 'svn info' in terminal
Windows serials => look into the "RAILS_ROOT/.svn/enries" file and save the things we want inside.

Example
=======
 
Install:
Gemfile:
  gem 'SVNHelper', git: 'git://github.com/kudelabs/SVNHelper.git'

Use:
 Set up a global variable in config/environment.rb:
 $current_version = SVNHelper.version(RAILS_ROOT) 
And then you can use this variable everywhere you wish to see the revision and last modified date or the whole svn information. By the way, its value may be changed each time you restart the server if any changes to the SVN found.


Author
=======
Mysen Huang, Adeh DeSandies

Copyright (c) 2009 SVNHelper by Kude Labs, released under the MIT license

About

return simple svn information for Rails Applications

Resources

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
MIT-LICENSE

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages