Class: Volley::Scm::Git
Instance Method Summary collapse
- #branch ⇒ Object
-
#initialize(opt = { }) ⇒ Git
constructor
A new instance of Git.
- #revision ⇒ Object
- #update ⇒ Object
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
#branch ⇒ Object
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.}" Volley::Log.debug e end |
#revision ⇒ Object
19 20 21 |
# File 'lib/volley/scm/git.rb', line 19 def revision @revision ||= data[:revision] end |
#update ⇒ Object
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 |