Class: Git

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

Overview

Class Method Summary collapse

Class Method Details

.current_branchObject



9
10
11
# File 'lib/git.rb', line 9

def self.current_branch
  self.run('rev-parse', '--abbrev-ref HEAD', :quiet => true).squish
end

.remote_url(remote = 'origin') ⇒ Object



4
5
6
7
# File 'lib/git.rb', line 4

def self.remote_url remote='origin'
  output = `git remote -v`.scan(/^#{remote}\s+(.*.git)(.*)/)
  output.first[0] if output
end