Class: GitDiffLCS::LibGit

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

Overview

Git

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(git_target, dir, src, dest) ⇒ LibGit

initialize GitDiffLCS::LibGit

Arguments:

[String] git_target: git repository address or working directory
[String] dir: temporary folder
[String] src: commit or branch
[String] dest: commit or branch


17
18
19
20
21
22
# File 'lib/git_diff_lcs/lib_git.rb', line 17

def initialize(git_target, dir, src, dest)
  @dir = dir
  @src = src
  @dest = dest
  get_git(git_target)
end

Instance Attribute Details

#gitObject (readonly)

Returns the value of attribute git.



8
9
10
# File 'lib/git_diff_lcs/lib_git.rb', line 8

def git
  @git
end

Instance Method Details

#diffObject



24
25
26
# File 'lib/git_diff_lcs/lib_git.rb', line 24

def diff
  @diff ||= @git.diff(@src, @dest)
end