Class: Volley::Scm::Git

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

Instance Method Summary collapse

Constructor Details

#initialize(opt = { }) ⇒ Git

Returns a new instance of Git.



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

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

Instance Method Details

#branchObject



12
13
14
15
16
17
# File 'lib/volley/scm/git.rb', line 12

def branch
  @branch ||= data[:branch]
rescue => e
  Volley::Log.error "git: could not get branch: #{e.message}"
  Volley::Log.debug e
end

#revisionObject



19
20
21
# File 'lib/volley/scm/git.rb', line 19

def revision
  @revision ||= data[:revision]
end

#updateObject



23
24
25
26
27
28
# File 'lib/volley/scm/git.rb', line 23

def update
  @options.delete(:update)
  up = %x{git pull --rebase}
  @branch = nil
  @revision = nil
end