class Monolith::BranchFinder
Public Class Methods
new(repo)
click to toggle source
# File lib/monolith/branch_finder.rb 5 def initialize(repo) 6 @repo = repo 7 end
Public Instance Methods
all()
click to toggle source
# File lib/monolith/branch_finder.rb 9 def all 10 unique_branches.map do |branch| 11 Branch.new(@repo, branch) 12 end 13 end
Private Instance Methods
branches()
click to toggle source
# File lib/monolith/branch_finder.rb 33 def branches 34 @repo.run("branch -a").split("\n") 35 end
formatted_branches()
click to toggle source
# File lib/monolith/branch_finder.rb 27 def formatted_branches 28 branches.map do |branch| 29 BranchNameFormatter.new(branch).name 30 end 31 end
non_head_branches()
click to toggle source
# File lib/monolith/branch_finder.rb 21 def non_head_branches 22 formatted_branches.reject do |branch| 23 branch =~ /HEAD\s*->/ 24 end 25 end
unique_branches()
click to toggle source
# File lib/monolith/branch_finder.rb 17 def unique_branches 18 non_head_branches.uniq 19 end