Class: Cerberus::SCM::SVN
- Inherits:
-
Base
- Object
- Base
- Cerberus::SCM::SVN
show all
- Defined in:
- lib/cerberus/scm/svn.rb
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Instance Method Details
#current_revision ⇒ Object
28
29
30
|
# File 'lib/cerberus/scm/svn.rb', line 28
def current_revision
info['Revision'].to_i
end
|
#has_changes? ⇒ Boolean
24
25
26
|
# File 'lib/cerberus/scm/svn.rb', line 24
def has_changes?
@status =~ /[A-Z]\s+[\w\/]+/ ? true : false
end
|
#installed? ⇒ Boolean
6
7
8
|
# File 'lib/cerberus/scm/svn.rb', line 6
def installed?
exec_successful? "#{@config[:bin_path]}svn --version"
end
|
#last_author ⇒ Object
46
47
48
|
# File 'lib/cerberus/scm/svn.rb', line 46
def last_author
info['Last Changed Author']
end
|
#last_commit_message ⇒ Object
36
37
38
39
40
41
42
43
44
|
# File 'lib/cerberus/scm/svn.rb', line 36
def last_commit_message
message = execute("log", "--limit 1 -v")
if (idx = message.index('-'*72))
message[idx..-1]
else
message
end
end
|
#update! ⇒ Object
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/cerberus/scm/svn.rb', line 10
def update!
if test(?d, @path + '/.svn') execute("cleanup") if locked?
say "Could not unlock svn directory #{@encoded_path}. Please do it manually." if locked? end
if test(?d, @path + '/.svn')
@status = execute("update")
else
FileUtils.mkpath(@path) unless test(?d,@path)
@status = execute("checkout", nil, @config[:scm, :url])
end
end
|
#url ⇒ Object
32
33
34
|
# File 'lib/cerberus/scm/svn.rb', line 32
def url
info['URL']
end
|