git_diff 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +5 -1
- data/README.md +1 -1
- data/git_diff.gemspec +2 -1
- data/lib/git_diff/diff.rb +2 -2
- data/lib/git_diff/hunk.rb +1 -6
- data/lib/git_diff/version.rb +1 -1
- data/test/{diff_file_test.rb → file_test.rb} +2 -2
- data/test/git_diff_test.rb +1 -1
- data/test/hunk_test.rb +2 -2
- data/test/line/addition_test.rb +2 -2
- data/test/line/context_test.rb +2 -2
- data/test/line/deletion_test.rb +2 -2
- data/test/line_number_calculation_test.rb +2 -2
- data/test/line_number_range_test.rb +3 -3
- data/test/line_number_test.rb +2 -2
- data/test/line_test.rb +2 -2
- data/test/range_info_test.rb +1 -1
- data/test/stats_calculator_test.rb +2 -2
- metadata +20 -8
- data/Gemfile.lock +0 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa01fe77b7f1845c9feb7cb917b4f6ec852a7ea3
|
4
|
+
data.tar.gz: 9c2a059e515b676f57215214262cdb9fab89724e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 551a65b09a2a618daaa345205f821666612ed6a8ad588fd8ef137b13d57e6ae4c2acfd0ea8b538b8f8f847baeb211779b83f061b1c8f57065c7778b25bb48a48
|
7
|
+
data.tar.gz: 907132b50e27f720f8d1397988a88258f967ae8bd7aada9403208afe7e3dc4872a55a054d43961cf7053f47e304147ecb1e86b207c8dd9de9b955e5f97adc4db
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
data/git_diff.gemspec
CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |spec|
|
|
7
7
|
spec.name = "git_diff"
|
8
8
|
spec.version = GitDiff::VERSION
|
9
9
|
spec.authors = ["Andrew Olson"]
|
10
|
-
spec.email = ["
|
10
|
+
spec.email = ["anolson@gmail.com"]
|
11
11
|
spec.summary = %q{A Ruby library for parsing git diffs.}
|
12
12
|
spec.license = "MIT"
|
13
13
|
|
@@ -18,4 +18,5 @@ Gem::Specification.new do |spec|
|
|
18
18
|
|
19
19
|
spec.add_development_dependency "bundler", "~> 1.3"
|
20
20
|
spec.add_development_dependency "rake"
|
21
|
+
spec.add_development_dependency "minitest"
|
21
22
|
end
|
data/lib/git_diff/diff.rb
CHANGED
data/lib/git_diff/hunk.rb
CHANGED
@@ -2,11 +2,6 @@ require "forwardable"
|
|
2
2
|
|
3
3
|
module GitDiff
|
4
4
|
class Hunk
|
5
|
-
include Enumerable
|
6
|
-
extend Forwardable
|
7
|
-
|
8
|
-
def_delegators :lines, :each
|
9
|
-
|
10
5
|
attr_reader :lines, :range_info
|
11
6
|
|
12
7
|
def initialize(range_info)
|
@@ -39,4 +34,4 @@ module GitDiff
|
|
39
34
|
@line_number_calculation ||= LineNumberCalculation.new(initial_line_number)
|
40
35
|
end
|
41
36
|
end
|
42
|
-
end
|
37
|
+
end
|
data/lib/git_diff/version.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require "test_helper"
|
2
2
|
|
3
|
-
class DiffFileTest <
|
3
|
+
class DiffFileTest < Minitest::Test
|
4
4
|
|
5
5
|
def setup
|
6
6
|
@file = GitDiff::File.new
|
@@ -57,4 +57,4 @@ class DiffFileTest < MiniTest::Unit::TestCase
|
|
57
57
|
assert_equal 1, @file.stats.number_of_deletions
|
58
58
|
end
|
59
59
|
|
60
|
-
end
|
60
|
+
end
|
data/test/git_diff_test.rb
CHANGED
data/test/hunk_test.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require "test_helper"
|
2
2
|
|
3
|
-
class HunkTest <
|
3
|
+
class HunkTest < Minitest::Test
|
4
4
|
|
5
5
|
def setup
|
6
6
|
@range_info = GitDiff::RangeInfo.new("180,7", "180,7", "module Grit")
|
@@ -24,4 +24,4 @@ class HunkTest < MiniTest::Unit::TestCase
|
|
24
24
|
|
25
25
|
assert_equal 1, @hunk.stats.number_of_deletions
|
26
26
|
end
|
27
|
-
end
|
27
|
+
end
|
data/test/line/addition_test.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require "test_helper"
|
2
2
|
|
3
|
-
class AdditionTest <
|
3
|
+
class AdditionTest < Minitest::Test
|
4
4
|
def setup
|
5
5
|
@addition = GitDiff::Line::Addition.new("+ addition")
|
6
6
|
end
|
@@ -12,4 +12,4 @@ class AdditionTest < MiniTest::Unit::TestCase
|
|
12
12
|
def test_deletion_is_false
|
13
13
|
refute @addition.deletion?
|
14
14
|
end
|
15
|
-
end
|
15
|
+
end
|
data/test/line/context_test.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require "test_helper"
|
2
2
|
|
3
|
-
class ContextTest <
|
3
|
+
class ContextTest < Minitest::Test
|
4
4
|
def setup
|
5
5
|
@line_number = GitDiff::LineNumber.new(0,0)
|
6
6
|
@content = "some content"
|
@@ -18,4 +18,4 @@ class ContextTest < MiniTest::Unit::TestCase
|
|
18
18
|
def test_to_s_returns_the_content
|
19
19
|
assert_equal @content, @context.to_s
|
20
20
|
end
|
21
|
-
end
|
21
|
+
end
|
data/test/line/deletion_test.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require "test_helper"
|
2
2
|
|
3
|
-
class DeletionTest <
|
3
|
+
class DeletionTest < Minitest::Test
|
4
4
|
def setup
|
5
5
|
@deletion = GitDiff::Line::Deletion.new("- deletion")
|
6
6
|
end
|
@@ -12,4 +12,4 @@ class DeletionTest < MiniTest::Unit::TestCase
|
|
12
12
|
def test_deletion_is_true
|
13
13
|
assert @deletion.deletion?
|
14
14
|
end
|
15
|
-
end
|
15
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require "test_helper"
|
2
2
|
|
3
|
-
class LineNumberCalculationTest <
|
3
|
+
class LineNumberCalculationTest < Minitest::Test
|
4
4
|
|
5
5
|
def setup
|
6
6
|
@line_number = GitDiff::LineNumber.new(0, 0)
|
@@ -31,4 +31,4 @@ class LineNumberCalculationTest < MiniTest::Unit::TestCase
|
|
31
31
|
assert_equal 1, @line_number_calculation.current.left
|
32
32
|
assert_equal 1, @line_number_calculation.current.right
|
33
33
|
end
|
34
|
-
end
|
34
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require "test_helper"
|
2
2
|
|
3
|
-
class LineNumberRangeTest <
|
3
|
+
class LineNumberRangeTest < Minitest::Test
|
4
4
|
|
5
5
|
def test_from_string_with_empty_string
|
6
6
|
range = GitDiff::LineNumberRange.from_string("")
|
@@ -9,7 +9,7 @@ class LineNumberRangeTest < MiniTest::Unit::TestCase
|
|
9
9
|
assert_equal 0, range.number_of_lines
|
10
10
|
end
|
11
11
|
|
12
|
-
def
|
12
|
+
def test_from_string_with_not_empty_string
|
13
13
|
range = GitDiff::LineNumberRange.from_string("180,7")
|
14
14
|
|
15
15
|
assert_equal 180, range.start
|
@@ -21,4 +21,4 @@ class LineNumberRangeTest < MiniTest::Unit::TestCase
|
|
21
21
|
|
22
22
|
assert_equal "+180,7", range.to_s(:+)
|
23
23
|
end
|
24
|
-
end
|
24
|
+
end
|
data/test/line_number_test.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require "test_helper"
|
2
2
|
|
3
|
-
class LineNumberTest <
|
3
|
+
class LineNumberTest < Minitest::Test
|
4
4
|
|
5
5
|
def setup
|
6
6
|
@line_number = GitDiff::LineNumber.new(0,0)
|
@@ -27,4 +27,4 @@ class LineNumberTest < MiniTest::Unit::TestCase
|
|
27
27
|
def test_pair
|
28
28
|
assert_equal [0,0], @line_number.pair
|
29
29
|
end
|
30
|
-
end
|
30
|
+
end
|
data/test/line_test.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require "test_helper"
|
2
2
|
|
3
|
-
class LineTest <
|
3
|
+
class LineTest < Minitest::Test
|
4
4
|
|
5
5
|
def setup
|
6
6
|
@line_number = GitDiff::LineNumber.new(0, 0)
|
@@ -27,4 +27,4 @@ class LineTest < MiniTest::Unit::TestCase
|
|
27
27
|
refute_nil context
|
28
28
|
assert_instance_of GitDiff::Line::Context, context
|
29
29
|
end
|
30
|
-
end
|
30
|
+
end
|
data/test/range_info_test.rb
CHANGED
@@ -25,7 +25,7 @@ class Collector
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
-
class StatsCalculatorTest <
|
28
|
+
class StatsCalculatorTest < Minitest::Test
|
29
29
|
def setup
|
30
30
|
collector = Collector.new
|
31
31
|
|
@@ -44,4 +44,4 @@ class StatsCalculatorTest < MiniTest::Unit::TestCase
|
|
44
44
|
def test_total_number_additions_is_the_sum_of_all_the_lines
|
45
45
|
assert_equal 24, @stats.number_of_lines
|
46
46
|
end
|
47
|
-
end
|
47
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git_diff
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Olson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -38,9 +38,23 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: minitest
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
description:
|
42
56
|
email:
|
43
|
-
-
|
57
|
+
- anolson@gmail.com
|
44
58
|
executables: []
|
45
59
|
extensions: []
|
46
60
|
extra_rdoc_files: []
|
@@ -48,7 +62,6 @@ files:
|
|
48
62
|
- ".gitignore"
|
49
63
|
- ".travis.yml"
|
50
64
|
- Gemfile
|
51
|
-
- Gemfile.lock
|
52
65
|
- LICENSE.txt
|
53
66
|
- README.md
|
54
67
|
- Rakefile
|
@@ -73,7 +86,7 @@ files:
|
|
73
86
|
- lib/git_diff/stats_collector/rollup.rb
|
74
87
|
- lib/git_diff/stats_rollup.rb
|
75
88
|
- lib/git_diff/version.rb
|
76
|
-
- test/
|
89
|
+
- test/file_test.rb
|
77
90
|
- test/git_diff_test.rb
|
78
91
|
- test/hunk_test.rb
|
79
92
|
- test/line/addition_test.rb
|
@@ -106,12 +119,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
106
119
|
version: '0'
|
107
120
|
requirements: []
|
108
121
|
rubyforge_project:
|
109
|
-
rubygems_version: 2.
|
122
|
+
rubygems_version: 2.6.8
|
110
123
|
signing_key:
|
111
124
|
specification_version: 4
|
112
125
|
summary: A Ruby library for parsing git diffs.
|
113
126
|
test_files:
|
114
|
-
- test/
|
127
|
+
- test/file_test.rb
|
115
128
|
- test/git_diff_test.rb
|
116
129
|
- test/hunk_test.rb
|
117
130
|
- test/line/addition_test.rb
|
@@ -124,4 +137,3 @@ test_files:
|
|
124
137
|
- test/range_info_test.rb
|
125
138
|
- test/stats_calculator_test.rb
|
126
139
|
- test/test_helper.rb
|
127
|
-
has_rdoc:
|