class GitPrettyAccept::MergeCommand

Constants

MESSAGE_TEMPLATE_FILENAME

Attributes

branch[R]
let_user_edit_message[R]

Public Class Methods

new(branch, let_user_edit_message) click to toggle source
# File lib/git_pretty_accept/merge_command.rb, line 7
def initialize(branch, let_user_edit_message)
  @branch = branch
  @let_user_edit_message = let_user_edit_message
end

Public Instance Methods

merge_message() click to toggle source
# File lib/git_pretty_accept/merge_command.rb, line 12
def merge_message
  if File.exists?(MESSAGE_TEMPLATE_FILENAME)
    File.read(MESSAGE_TEMPLATE_FILENAME)
  end
end
merge_message_with_escaped_single_quote() click to toggle source

www.seejohncode.com/2012/10/16/proper-escaping-of-single-quotes/

# File lib/git_pretty_accept/merge_command.rb, line 19
def merge_message_with_escaped_single_quote
  merge_message.gsub("'") { %q{'\''} }
end
to_s() click to toggle source
# File lib/git_pretty_accept/merge_command.rb, line 23
def to_s
  [
    "git merge",
    "--no-ff",
    let_user_edit_message ? '--edit' : '--no-edit',
    branch,
    merge_message && "--message '#{merge_message_with_escaped_single_quote}'"
  ].join(' ')
end