unified 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/unified/chunk.rb +3 -1
- data/lib/unified/version.rb +1 -1
- data/spec/chunk_spec.rb +12 -0
- metadata +2 -2
data/lib/unified/chunk.rb
CHANGED
@@ -64,10 +64,12 @@ module Unified
|
|
64
64
|
elsif line.deletion?
|
65
65
|
yield line, original_line_number, nil
|
66
66
|
original_line_number += 1
|
67
|
-
|
67
|
+
elsif line.unchanged?
|
68
68
|
yield line, original_line_number, modified_line_number
|
69
69
|
original_line_number += 1
|
70
70
|
modified_line_number += 1
|
71
|
+
else
|
72
|
+
yield line
|
71
73
|
end
|
72
74
|
end
|
73
75
|
end
|
data/lib/unified/version.rb
CHANGED
data/spec/chunk_spec.rb
CHANGED
@@ -96,6 +96,18 @@ describe "Unified::Chunk" do
|
|
96
96
|
index += 1
|
97
97
|
end
|
98
98
|
end
|
99
|
+
|
100
|
+
it "does not pass line numbers for the no newline warning", focus: true do
|
101
|
+
no_newline_chunk = Unified::Chunk.new original: 1, modified: 1, lines: [" Line 1", "\"]
|
102
|
+
index = 0
|
103
|
+
no_newline_chunk.each_line do |line, original_line_number, modified_line_number|
|
104
|
+
if index == 1
|
105
|
+
original_line_number.should be_nil
|
106
|
+
modified_line_number.should be_nil
|
107
|
+
end
|
108
|
+
index += 1
|
109
|
+
end
|
110
|
+
end
|
99
111
|
end
|
100
112
|
|
101
113
|
describe "#==" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unified
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-04-
|
12
|
+
date: 2013-04-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|