Class: CommitCommentTools::RepositoryLoader
- Inherits:
-
Object
- Object
- CommitCommentTools::RepositoryLoader
- Defined in:
- lib/commit-comment-tools/repository-loader.rb
Instance Method Summary collapse
-
#initialize(repository_path, base_branch_name, branch_name = "") ⇒ RepositoryLoader
constructor
A new instance of RepositoryLoader.
- #load_commits ⇒ Object
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_commits ⇒ Object
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 |