class AccuHook::Accurev::Command

Public Instance Methods

add(file_path) click to toggle source
# File lib/accuhook/command.rb, line 9
def add(file_path)
  if File.directory?(file_path) # Recursively add directory (`accurev add -x -R {Dir}`)
    execute("add -x -R \"#{file_path}\"")
  else  # Add single file (`accurev add {File}`)
    execute("add \"#{file_path}\"")
  end
end
defunct(file_path, message) click to toggle source
# File lib/accuhook/command.rb, line 21
def defunct(file_path, message)
  execute("defunct -c \"#{@last_commit_message}\" \"#{diff.a_path}\"")
end
keep(file_path, message) click to toggle source
# File lib/accuhook/command.rb, line 17
def keep(file_path, message)
  execute("keep -c \"#{message}\" \"#{file_path}\"")
end

Private Instance Methods

execute(command) click to toggle source
# File lib/accuhook/command.rb, line 26
def execute(command)
  args = Shellwords.split(command)
  escaped_args = args.map {|arg| Shellwords.escape(arg)}
  sub_command = Shellwords.join(escaped_args)
  #puts "Running accurev #{sub_command}"
  system("accurev #{sub_command}")
end