Class: Volley::Scm::Subversion

Inherits:
Base
  • Object
show all
Defined in:
lib/volley/scm/subversion.rb

Instance Method Summary collapse

Constructor Details

#initialize(opt = { }) ⇒ Subversion

Returns a new instance of Subversion.



6
7
8
9
10
# File 'lib/volley/scm/subversion.rb', line 6

def initialize(opt={ })
  @options = {
      :update => false
  }.merge(opt)
end

Instance Method Details

#branchObject



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/volley/scm/subversion.rb', line 12

def branch
  @branch ||= begin
    if data["URL"] =~ /\/trunk/
      "trunk"
    elsif  data["URL"] =~ /\/branches\//
      m = data["URL"].match(/\/branches\/([^\/]+)\/*/)
      m[1]
    else
      nil
    end
  end
end

#revisionObject



25
26
27
28
29
# File 'lib/volley/scm/subversion.rb', line 25

def revision
  @revision ||= begin
    data["Revision"]
  end
end

#updateObject



31
32
33
34
35
# File 'lib/volley/scm/subversion.rb', line 31

def update
  @options.delete(:update)
  up = %x{svn update}
  @data = nil
end