Class: ConventionalCommits::Git

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

Instance Method Summary collapse

Instance Method Details

#current_branch_nameObject



5
6
7
# File 'lib/git/git.rb', line 5

def current_branch_name
  run_system_command "git symbolic-ref --short HEAD"
end

#run_system_command(_cmd) ⇒ Object



13
14
15
# File 'lib/git/git.rb', line 13

def run_system_command(_cmd)
  Open3.popen3(_cmd) { |_stdin, stdout, _stderr, _wait_thr| stdout.read }
end

#set_commit_msg(_msg) ⇒ Object



9
10
11
# File 'lib/git/git.rb', line 9

def set_commit_msg(_msg)
  run_system_command "git symbolic-ref --short HEAD"
end