Class: CommitCommentTools::RepositoryLoader

Inherits:
Object
  • Object
show all
Defined in:
lib/commit-comment-tools/repository-loader.rb

Instance Method Summary collapse

Constructor Details

#initialize(repository_path, base_branch_name, branch_name = "") ⇒ RepositoryLoader



28
29
30
31
32
33
34
35
36
37
# File 'lib/commit-comment-tools/repository-loader.rb', line 28

def initialize(repository_path, base_branch_name, branch_name="")
  create_table
  @repository_path = repository_path
  @repository = Grit::Repo.new(repository_path)
  @repository_name = File.basename(repository_path)
  @base_branch_name = base_branch_name
  @target_branches = @repository.remotes.select do |branch|
    branch_name === branch.name
  end
end

Instance Method Details

#load_commitsObject



39
40
41
42
43
44
45
# File 'lib/commit-comment-tools/repository-loader.rb', line 39

def load_commits
  puts @repository_name
  load_base_branch_commits
  @target_branches.each do |branch|
    load_branch_commits(branch.name)
  end
end