class GitBrd::BranchExecutioner

Public Class Methods

new(regex_str) click to toggle source
# File lib/git_brd.rb, line 6
def initialize(regex_str)
        @regex      = /#{regex_str}/
        @git                = Git.open(Dir.pwd)
end

Public Instance Methods

delete_matching_branches!() click to toggle source
# File lib/git_brd.rb, line 15
def delete_matching_branches!
        matching_branches.each(&:delete)
end
matching_branches() click to toggle source
# File lib/git_brd.rb, line 11
def matching_branches
        @matching_branches ||= @git.branches.local.select{ |branch| branch.name =~ @regex }
end