git_diff_lcs 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5e272a492729c1b017559606e83a4791c7a0d388582efc226f193e44af97414c
4
- data.tar.gz: ef406c7e347e1acbfdea5ca4c0c4ada7135044d3b730b5283b6dda0841934270
3
+ metadata.gz: 27c41ba96f0780ddde8e5fc9886468fdd2dbcb3f78b5a04abaf0e8ea8aef3d48
4
+ data.tar.gz: 500b08528232906422bb977bfbf00db547978a51cfc1b11c53ceca17e76d53a6
5
5
  SHA512:
6
- metadata.gz: d9743ca91179cbc87e26e85a8307c1efef197b6b951776a6d5afddb569e92272b4cdabe0f72b82abc30c94a1b255d0770d3e0e7521ad0b272c10feeba7f15f35
7
- data.tar.gz: 3e6f78375468c2a003a51a202e246ca036f04b7b84b5d14a83b0851c8c630074670753ec5513b66be8866a57d7dd9e05342bac4caf6590a3906692c7ab90e296
6
+ metadata.gz: 2b48c2026d3328296d85dd784a51ce28c2ff88ae1564c7070d4c1c1de34359ed1fda976401f64fce2236d29b9d4a9942f2a8b2bb2438320ccb9b0be2d7b6e495
7
+ data.tar.gz: 666690cbeb5c6b8c34c3a64075163da19090d4c1361aa79658423a016cf6825dd4d0a5eb3448b3e878f7dfb7b5165bb59572156d0129f25a70a6eacedd86ee23
data/.gitignore CHANGED
@@ -1,4 +1,3 @@
1
- *.gem
2
1
  memo.txt
3
2
 
4
3
  /.bundle/
data/Gemfile.lock CHANGED
@@ -1,61 +1,63 @@
1
- PATH
2
- remote: .
3
- specs:
4
- git_diff_lcs (0.0.3)
5
- diff-lcs (= 1.4.4)
6
- git (= 1.8.1)
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- ast (2.4.2)
12
- diff-lcs (1.4.4)
13
- git (1.8.1)
14
- rchardet (~> 1.8)
15
- parallel (1.20.1)
16
- parser (3.0.0.0)
17
- ast (~> 2.4.1)
18
- rainbow (3.0.0)
19
- rake (13.0.3)
20
- rchardet (1.8.0)
21
- regexp_parser (2.1.1)
22
- rexml (3.2.4)
23
- rspec (3.10.0)
24
- rspec-core (~> 3.10.0)
25
- rspec-expectations (~> 3.10.0)
26
- rspec-mocks (~> 3.10.0)
27
- rspec-core (3.10.1)
28
- rspec-support (~> 3.10.0)
29
- rspec-expectations (3.10.1)
30
- diff-lcs (>= 1.2.0, < 2.0)
31
- rspec-support (~> 3.10.0)
32
- rspec-mocks (3.10.2)
33
- diff-lcs (>= 1.2.0, < 2.0)
34
- rspec-support (~> 3.10.0)
35
- rspec-support (3.10.2)
36
- rubocop (0.93.1)
37
- parallel (~> 1.10)
38
- parser (>= 2.7.1.5)
39
- rainbow (>= 2.2.2, < 4.0)
40
- regexp_parser (>= 1.8)
41
- rexml
42
- rubocop-ast (>= 0.6.0)
43
- ruby-progressbar (~> 1.7)
44
- unicode-display_width (>= 1.4.0, < 2.0)
45
- rubocop-ast (1.4.1)
46
- parser (>= 2.7.1.5)
47
- ruby-progressbar (1.11.0)
48
- unicode-display_width (1.7.0)
49
-
50
- PLATFORMS
51
- x64-mingw32
52
- x86_64-linux
53
-
54
- DEPENDENCIES
55
- git_diff_lcs!
56
- rake (~> 13.0)
57
- rspec (~> 3.0)
58
- rubocop (~> 0.80)
59
-
60
- BUNDLED WITH
61
- 2.2.13
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ git_diff_lcs (0.0.4)
5
+ diff-lcs (= 1.4.4)
6
+ git (= 1.8.1)
7
+ thor (= 1.1.0)
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ ast (2.4.2)
13
+ diff-lcs (1.4.4)
14
+ git (1.8.1)
15
+ rchardet (~> 1.8)
16
+ parallel (1.20.1)
17
+ parser (3.0.0.0)
18
+ ast (~> 2.4.1)
19
+ rainbow (3.0.0)
20
+ rake (13.0.3)
21
+ rchardet (1.8.0)
22
+ regexp_parser (2.1.1)
23
+ rexml (3.2.4)
24
+ rspec (3.10.0)
25
+ rspec-core (~> 3.10.0)
26
+ rspec-expectations (~> 3.10.0)
27
+ rspec-mocks (~> 3.10.0)
28
+ rspec-core (3.10.1)
29
+ rspec-support (~> 3.10.0)
30
+ rspec-expectations (3.10.1)
31
+ diff-lcs (>= 1.2.0, < 2.0)
32
+ rspec-support (~> 3.10.0)
33
+ rspec-mocks (3.10.2)
34
+ diff-lcs (>= 1.2.0, < 2.0)
35
+ rspec-support (~> 3.10.0)
36
+ rspec-support (3.10.2)
37
+ rubocop (0.93.1)
38
+ parallel (~> 1.10)
39
+ parser (>= 2.7.1.5)
40
+ rainbow (>= 2.2.2, < 4.0)
41
+ regexp_parser (>= 1.8)
42
+ rexml
43
+ rubocop-ast (>= 0.6.0)
44
+ ruby-progressbar (~> 1.7)
45
+ unicode-display_width (>= 1.4.0, < 2.0)
46
+ rubocop-ast (1.4.1)
47
+ parser (>= 2.7.1.5)
48
+ ruby-progressbar (1.11.0)
49
+ thor (1.1.0)
50
+ unicode-display_width (1.7.0)
51
+
52
+ PLATFORMS
53
+ x64-mingw32
54
+ x86_64-linux
55
+
56
+ DEPENDENCIES
57
+ git_diff_lcs!
58
+ rake (~> 13.0)
59
+ rspec (~> 3.0)
60
+ rubocop (~> 0.80)
61
+
62
+ BUNDLED WITH
63
+ 2.2.13
data/README.md CHANGED
@@ -1,16 +1,38 @@
1
- # GitDiffLcs
2
-
3
- Generally, git diff --stat does not contain modifications, so we added it to display modifications using the LCS algorithm.
4
-
5
- ## Installation
6
- ```bash
7
- $ gem install git_diff-lcs
8
- ```
9
-
10
- ## How to use
11
- ```ruby
12
- require 'git_diff_lcs'
13
-
14
- GitDiffLcs.diff('https://github.com/btpink-seo/git-diff-lcs.git', 'main', 'gem')
15
- # => 169 files changed, 10407 insertions(+), 84 deletions(-), 134 modifications(!), total(10625)
16
- ```
1
+ # GitDiffLcs
2
+
3
+ Generally, git diff --stat does not contain modifications, so we added it to display modifications using the LCS algorithm.
4
+
5
+ ## Installation
6
+ ```bash
7
+ $ gem install git_diff-lcs
8
+ ```
9
+
10
+ ## How to use
11
+
12
+ ### diff(repo, src, dest)
13
+
14
+ src, dest is branch name or commit
15
+
16
+ example
17
+ ```ruby
18
+ require 'git_diff_lcs'
19
+
20
+ GitDiffLcs.diff('https://github.com/btpink-seo/git-diff-lcs.git', 'test/src', 'test/dest')
21
+ # => 5 files changed, 13 insertions(+), 6 deletions(-), 2 modifications(!), total(21)
22
+ ```
23
+
24
+ ### GitDiffLcs::Stat.new(repo, src, dest)
25
+
26
+ ```ruby
27
+ require 'git_diff_lcs'
28
+
29
+ stat = GitDiffLcs::Stat.new('https://github.com/btpink-seo/git-diff-lcs.git', 'test/src', 'test/dest')
30
+ stat.summary
31
+ # => 5 files changed, 13 insertions(+), 6 deletions(-), 2 modifications(!), total(21)
32
+ stat.insertions
33
+ # => 13
34
+ stat.deletions
35
+ # => 6
36
+ stat.modifications
37
+ # => 2
38
+ ```
data/exe/git_diff_lcs ADDED
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ #!/usr/bin/env ruby
4
+
5
+ require "git_diff_lcs"
6
+
7
+ GitDiffLcs::CLI.start(ARGV)
data/git_diff_lcs.gemspec CHANGED
@@ -23,4 +23,5 @@ Gem::Specification.new do |spec|
23
23
  spec.license = "MIT"
24
24
  spec.add_dependency "diff-lcs", "1.4.4"
25
25
  spec.add_dependency "git", "1.8.1"
26
+ spec.add_runtime_dependency "thor", "1.1.0"
26
27
  end
data/lib/git_diff_lcs.rb CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  require "git_diff_lcs/stat"
4
4
  require "git_diff_lcs/version"
5
+ require "git_diff_lcs/cli"
5
6
 
6
7
  # git diff lcs
7
8
  module GitDiffLcs
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "thor"
4
+
5
+ # git diff lcs
6
+ module GitDiffLcs
7
+ # Command Line Interface
8
+ class CLI < Thor
9
+ def self.exit_on_failure?
10
+ true
11
+ end
12
+
13
+ desc "diff GIT_REPOSITORY, SRC(BRANCH OR COMMIT), DEST(BRANCH OR COMMIT)", "get diff with LCS"
14
+ def diff(repo, src, dest)
15
+ puts GitDiffLcs.diff(repo, src, dest)
16
+ end
17
+ end
18
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GitDiffLcs
4
- VERSION = "0.0.3"
4
+ VERSION = "0.0.4"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git_diff_lcs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - SEO SANG HYUN
@@ -38,9 +38,24 @@ dependencies:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
40
  version: 1.8.1
41
+ - !ruby/object:Gem::Dependency
42
+ name: thor
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '='
46
+ - !ruby/object:Gem::Version
47
+ version: 1.1.0
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '='
53
+ - !ruby/object:Gem::Version
54
+ version: 1.1.0
41
55
  description: Add modifications to 'git diff --shortstat' using the LCS algorithm.
42
56
  email: btpink.seo@gmail.com
43
- executables: []
57
+ executables:
58
+ - git_diff_lcs
44
59
  extensions: []
45
60
  extra_rdoc_files: []
46
61
  files:
@@ -55,8 +70,10 @@ files:
55
70
  - Rakefile
56
71
  - bin/console
57
72
  - bin/setup
73
+ - exe/git_diff_lcs
58
74
  - git_diff_lcs.gemspec
59
75
  - lib/git_diff_lcs.rb
76
+ - lib/git_diff_lcs/cli.rb
60
77
  - lib/git_diff_lcs/stat.rb
61
78
  - lib/git_diff_lcs/version.rb
62
79
  homepage: https://github.com/btpink-seo/git-diff-lcs