Class: PrChangelog::GitProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/pr_changelog/git_proxy.rb

Overview

A boundary class between git and the rest of the gem

Constant Summary collapse

LOG_FORMAT =
'- %cn: %s%n%w(80, 2, 2)%b'

Instance Method Summary collapse

Instance Method Details

#commits_between(base_ref, current_ref) ⇒ Object



8
9
10
# File 'lib/pr_changelog/git_proxy.rb', line 8

def commits_between(base_ref, current_ref)
  `git log #{base_ref}..#{current_ref} --format='#{LOG_FORMAT}'`
end

#git_tags_listObject



16
17
18
# File 'lib/pr_changelog/git_proxy.rb', line 16

def git_tags_list
  `git tag --list`.split("\n")
end

#merge_commits_between(base_ref, current_ref) ⇒ Object



12
13
14
# File 'lib/pr_changelog/git_proxy.rb', line 12

def merge_commits_between(base_ref, current_ref)
  `git log --merges #{base_ref}..#{current_ref} --format='#{LOG_FORMAT}'`
end