Class: Bob::SCM::Svn

Inherits:
Abstract show all
Defined in:
lib/bob/scm/svn.rb

Instance Attribute Summary

Attributes inherited from Abstract

#branch, #uri

Instance Method Summary collapse

Methods inherited from Abstract

#initialize, #working_dir

Constructor Details

This class inherits a constructor from Bob::SCM::Abstract

Instance Method Details

#headObject



15
16
17
18
# File 'lib/bob/scm/svn.rb', line 15

def head
  `svn info #{uri}`.split("\n").detect { |l| l =~ /^Revision: (\d+)/ }
  $1.to_s
end

#info(revision) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/bob/scm/svn.rb', line 6

def info(revision)
  dump = `svn log --non-interactive --revision #{revision} #{uri}`.split("\n")
  meta = dump[1].split(" | ")

  { :message => dump[3],
    :author  => meta[1],
    :committed_at => Time.parse(meta[2]) }
end

#with_commit(commit_id) ⇒ Object



20
21
22
23
24
# File 'lib/bob/scm/svn.rb', line 20

def with_commit(commit_id)
  update_code
  checkout(commit_id)
  yield
end