Module: Scm::Git

Defined in:
lib/eo/scm/git.rb

Instance Method Summary collapse

Instance Method Details

#initObject



3
4
5
# File 'lib/eo/scm/git.rb', line 3

def init
  system("git clone #{self.repo} #{self.path}")
end

#now_commitObject



18
19
20
# File 'lib/eo/scm/git.rb', line 18

def now_commit
  return `git log --pretty=format:%H -1`
end

#updateObject



7
8
9
10
11
12
13
14
15
16
# File 'lib/eo/scm/git.rb', line 7

def update
  old_commit = now_commit
  system("git pull")
  new_commit = now_commit
  if new_commit != old_commit && self.autorun
    self.autorun.split(';').each do |x|
      eval x
    end
  end
end