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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e3b41b08c6a9dccc59f7a462cdcdb68e5b1cfaec
4
- data.tar.gz: 366a324e52d933f22147093c90d8844d4af34710
3
+ metadata.gz: aa01fe77b7f1845c9feb7cb917b4f6ec852a7ea3
4
+ data.tar.gz: 9c2a059e515b676f57215214262cdb9fab89724e
5
5
  SHA512:
6
- metadata.gz: bb7a0f39886899976aeb0a98aedd8ffbb7588a61177072dd77c082ee14b72a11ebb30908af0d7d99ac5e50eb9db1e3a9d46cd9dfbfdae657020ba7a885f33309
7
- data.tar.gz: 7d0e155533df7ef127f9c1769b7f81e281cba163c22dc72af5b8a1f0fe845aa3d21e2368712c4c383d96ff8cd68762303b2d99ed7b91af680a07c12e7e5e4670
6
+ metadata.gz: 551a65b09a2a618daaa345205f821666612ed6a8ad588fd8ef137b13d57e6ae4c2acfd0ea8b538b8f8f847baeb211779b83f061b1c8f57065c7778b25bb48a48
7
+ data.tar.gz: 907132b50e27f720f8d1397988a88258f967ae8bd7aada9403208afe7e3dc4872a55a054d43961cf7053f47e304147ecb1e86b207c8dd9de9b955e5f97adc4db
data/.travis.yml CHANGED
@@ -1,4 +1,8 @@
1
1
  language: ruby
2
2
  rvm:
3
3
  - 1.9.3
4
- - 2.0.0
4
+ - 2.0.0
5
+ - 2.1.10
6
+ - 2.2.7
7
+ - 2.3.4
8
+ - 2.4.1
data/README.md CHANGED
@@ -9,7 +9,7 @@ A Ruby library for parsing the unified diff format generated with `git diff`
9
9
 
10
10
  Add this line to your application's Gemfile:
11
11
 
12
- gem 'git_diff', git: 'https://github.com/anolson/git_diff.git'
12
+ gem 'git_diff'
13
13
 
14
14
  And then execute:
15
15
 
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 = ["aolson@geezeo.com"]
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
@@ -1,6 +1,6 @@
1
1
  module GitDiff
2
2
  class Diff
3
- attr_reader :files, :stats
3
+ attr_reader :files
4
4
 
5
5
  def initialize
6
6
  @files = []
@@ -35,4 +35,4 @@ module GitDiff
35
35
  current_file << line
36
36
  end
37
37
  end
38
- end
38
+ end
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
@@ -1,3 +1,3 @@
1
1
  module GitDiff
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
@@ -1,6 +1,6 @@
1
1
  require "test_helper"
2
2
 
3
- class DiffFileTest < MiniTest::Unit::TestCase
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
@@ -1,6 +1,6 @@
1
1
  require "test_helper"
2
2
 
3
- class GitDiffTest < MiniTest::Unit::TestCase
3
+ class GitDiffTest < Minitest::Test
4
4
 
5
5
  def setup
6
6
  string = <<-'DIFF'
data/test/hunk_test.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require "test_helper"
2
2
 
3
- class HunkTest < MiniTest::Unit::TestCase
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
@@ -1,6 +1,6 @@
1
1
  require "test_helper"
2
2
 
3
- class AdditionTest < MiniTest::Unit::TestCase
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
@@ -1,6 +1,6 @@
1
1
  require "test_helper"
2
2
 
3
- class ContextTest < MiniTest::Unit::TestCase
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
@@ -1,6 +1,6 @@
1
1
  require "test_helper"
2
2
 
3
- class DeletionTest < MiniTest::Unit::TestCase
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 < MiniTest::Unit::TestCase
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 < MiniTest::Unit::TestCase
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 test_from_string_with_empty_string
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
@@ -1,6 +1,6 @@
1
1
  require "test_helper"
2
2
 
3
- class LineNumberTest < MiniTest::Unit::TestCase
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 < MiniTest::Unit::TestCase
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
@@ -1,6 +1,6 @@
1
1
  require "test_helper"
2
2
 
3
- class RangeInfoTest < MiniTest::Unit::TestCase
3
+ class RangeInfoTest < Minitest::Test
4
4
  def setup
5
5
  @range_info = GitDiff::RangeInfo.new("180,7", "180,7", "module Grit")
6
6
  end
@@ -25,7 +25,7 @@ class Collector
25
25
  end
26
26
  end
27
27
 
28
- class StatsCalculatorTest < MiniTest::Unit::TestCase
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.0
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: 2016-12-26 00:00:00.000000000 Z
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
- - aolson@geezeo.com
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/diff_file_test.rb
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.2.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/diff_file_test.rb
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:
data/Gemfile.lock DELETED
@@ -1,17 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- git_diff (0.3.0)
5
-
6
- GEM
7
- remote: https://rubygems.org/
8
- specs:
9
- rake (10.1.0)
10
-
11
- PLATFORMS
12
- ruby
13
-
14
- DEPENDENCIES
15
- bundler (~> 1.3)
16
- git_diff!
17
- rake