https://svn.lrde.epita.fr/svn/lrdetools/trunk
Index: ChangeLog
from Nicolas Pouillard <ertai(a)lrde.epita.fr>
Add two commands `url' and `script'.
* vcs/lib/vcs/url.rb: New. Just extract the url from the info command.
* vcs/lib/vcs/script.rb: New.
Provides a simple but powerful way to make custom request from your
favorite version control system, this method takes a ruby block code
and evaluate it in your vcs instance context.
script.rb | 19 +++++++++++++++++++
url.rb | 16 ++++++++++++++++
2 files changed, 35 insertions(+)
Index: vcs/lib/vcs/script.rb
--- vcs/lib/vcs/script.rb (revision 0)
+++ vcs/lib/vcs/script.rb (revision 0)
@@ -0,0 +1,19 @@
+# Author:: Nicolas Pouillard <ertai(a)lrde.epita.fr>fr>.
+# Copyright:: Copyright (c) 2005 LRDE. All rights reserved.
+# License:: GNU General Public License (GPL).
+# Revision:: $Id$
+
+require 'vcs/vcs'
+
+class Vcs
+
+ def script! ( code, *args )
+ begin
+ eval(code)
+ rescue Exception => ex
+ LOG.error { 'Vcs#script: during the client execution' }
+ LOG.error { ex.long_pp }
+ end
+ end
+
+end # class Svn
Property changes on: vcs/lib/vcs/script.rb
___________________________________________________________________
Name: svn:keywords
+ Id
Index: vcs/lib/vcs/url.rb
--- vcs/lib/vcs/url.rb (revision 0)
+++ vcs/lib/vcs/url.rb (revision 0)
@@ -0,0 +1,16 @@
+# Author:: Nicolas Pouillard <ertai(a)lrde.epita.fr>fr>.
+# Copyright:: Copyright (c) 2004 LRDE. All rights reserved.
+# License:: GNU General Public License (GPL).
+# Revision:: $Id$
+
+require 'vcs/svn'
+
+class Svn
+
+ def url! ( *args )
+ puts info.read[/^URL:\s+(.*)$/, 1]
+ end
+
+ alias_command :date, :last_changed_date
+
+end # class Svn
Property changes on: vcs/lib/vcs/url.rb
___________________________________________________________________
Name: svn:keywords
+ Id