Module: GitDiffLCS
- Defined in:
- lib/git_diff_lcs.rb,
lib/git_diff_lcs/cli.rb,
lib/git_diff_lcs/lib_git.rb,
lib/git_diff_lcs/constants.rb,
lib/git_diff_lcs/shortstat.rb
Overview
Git Diff LCS
Defined Under Namespace
Classes: CLI, LibGit, Shortstat
Constant Summary collapse
- VERSION =
gem version
"0.1.0"
- SRC_FOLDER =
Source folder
"src_#{SecureRandom.uuid}"
- DEST_FOLDER =
Destination folder
"dest_#{SecureRandom.uuid}"
- INIT_COUNT =
Initial diff count number
[0, 0, 0].freeze
Class Method Summary collapse
-
.shortstat(git_target, src, dest) ⇒ Object
Get diff –shortstat with LCS algorithm.
Class Method Details
.shortstat(git_target, src, dest) ⇒ Object
Get diff –shortstat with LCS algorithm
Arguments:
[String] git_target: git repository address or working directory
[String] src: commit or branch
[String] dest: commit or branch
Return:
[String] diff summary (changed files, insertions, deletions, modifications and total)
Example:
>> GitDiffLCS.shortstat("https://github.com/btpink-seo/git-diff-lcs.git", "test/src", "test/dest")
=> 5 files changed, 13 insertions(+), 6 deletions(-), 2 modifications(!), total(21)
23 24 25 26 |
# File 'lib/git_diff_lcs.rb', line 23 def self.shortstat(git_target, src, dest) shortstat = GitDiffLCS::Shortstat.new(git_target, src, dest) shortstat.errors.empty? ? shortstat.summary : shortstat.errors.first end |