Class: GitCommands::Commit

Inherits:
Command
  • Object
show all
Defined in:
lib/straight_line/common/git_commands/commit.rb

Overview

Commit

Instance Attribute Summary

Attributes inherited from Command

#working_dir

Instance Method Summary collapse

Methods inherited from Command

#arg, from_file, #run, #run_sub_commands, #sub_command

Constructor Details

#initialize(title, body = '') ⇒ Commit

Returns a new instance of Commit.



6
7
8
9
10
11
# File 'lib/straight_line/common/git_commands/commit.rb', line 6

def initialize(title, body = '')
  super 'git'
  arg 'commit -a'
  arg %(-m "#{title}") unless title.empty?
  arg %(-m "#{body}") unless body.nil? || body.empty?
end