Class: Vlad::Subversion
- Inherits:
-
Object
- Object
- Vlad::Subversion
- Defined in:
- lib/vlad/subversion.rb
Instance Method Summary collapse
-
#checkout(revision, destination) ⇒ Object
Returns the command that will check out
revision
from the repository into directorydestination
. -
#export(revision_or_source, destination) ⇒ Object
Returns the command that will export
revision
from the repository into the directorydestination
. -
#revision(revision) ⇒ Object
Returns a command that maps human-friendly revision identifier
revision
into a subversion revision specification.
Instance Method Details
#checkout(revision, destination) ⇒ Object
Returns the command that will check out revision
from the repository into directory destination
10 11 12 |
# File 'lib/vlad/subversion.rb', line 10 def checkout(revision, destination) "#{svn_cmd} co -r #{revision} #{repository} #{destination}" end |
#export(revision_or_source, destination) ⇒ Object
Returns the command that will export revision
from the repository into the directory destination
.
18 19 20 21 22 23 24 |
# File 'lib/vlad/subversion.rb', line 18 def export(revision_or_source, destination) if revision_or_source =~ /^(\d+|head)$/i then "#{svn_cmd} export -r #{revision_or_source} #{repository} #{destination}" else "#{svn_cmd} export #{revision_or_source} #{destination}" end end |
#revision(revision) ⇒ Object
Returns a command that maps human-friendly revision identifier revision
into a subversion revision specification.
30 31 32 |
# File 'lib/vlad/subversion.rb', line 30 def revision(revision) "`#{svn_cmd} info #{repository} | grep 'Revision:' | cut -f2 -d\\ `" end |