Class: Augit::Repo

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Repo

Returns a new instance of Repo.



5
6
7
# File 'lib/augit/repo.rb', line 5

def initialize(options = {})
  @regexp = options[:regexp]
end

Instance Attribute Details

#regexpObject (readonly)

Returns the value of attribute regexp.



3
4
5
# File 'lib/augit/repo.rb', line 3

def regexp
  @regexp
end

Instance Method Details

#branch_namesObject



14
15
16
# File 'lib/augit/repo.rb', line 14

def branch_names
  `git branch -r | #{sanitize_string}`.split("\n").uniq
end

#merged_branchesObject



18
19
20
# File 'lib/augit/repo.rb', line 18

def merged_branches
  `git branch -r --merged master | #{sanitize_string}`.split("\n").uniq
end

#originObject



9
10
11
12
# File 'lib/augit/repo.rb', line 9

def origin
  origin = `git remote show -n origin | grep "Fetch URL:"`.match(/.*\:(.*)\./)
  origin.nil? ? origin : origin[1]
end