daff 1.1.7 → 1.1.8
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.
- data/lib/lib/coopy/cell_info.rb +1 -0
- data/lib/lib/coopy/coopy.rb +1 -1
- data/lib/lib/coopy/csv.rb +0 -1
- data/lib/lib/coopy/diff_render.rb +4 -1
- data/lib/lib/coopy/terminal_diff_render.rb +10 -3
- metadata +2 -2
data/lib/lib/coopy/cell_info.rb
CHANGED
data/lib/lib/coopy/coopy.rb
CHANGED
data/lib/lib/coopy/csv.rb
CHANGED
@@ -136,6 +136,7 @@ module Coopy
|
|
136
136
|
cell.category = ""
|
137
137
|
cell.category_given_tr = ""
|
138
138
|
cell.separator = ""
|
139
|
+
cell.pretty_separator = ""
|
139
140
|
cell.conflicted = false
|
140
141
|
cell.updated = false
|
141
142
|
cell.pvalue = cell.lvalue = cell.rvalue = nil
|
@@ -178,6 +179,7 @@ module Coopy
|
|
178
179
|
end
|
179
180
|
cell.updated = true
|
180
181
|
cell.separator = div
|
182
|
+
cell.pretty_separator = div
|
181
183
|
if cell.pretty_value == div
|
182
184
|
tokens = ["",""]
|
183
185
|
else
|
@@ -193,7 +195,8 @@ module Coopy
|
|
193
195
|
pretty_tokens[0] = ::Coopy::DiffRender.mark_spaces(ref,tokens[2])
|
194
196
|
pretty_tokens[2] = ::Coopy::DiffRender.mark_spaces(tokens[2],ref)
|
195
197
|
end
|
196
|
-
cell.
|
198
|
+
cell.pretty_separator = [8594].pack("U")
|
199
|
+
cell.pretty_value = pretty_tokens.join(cell.pretty_separator)
|
197
200
|
cell.category_given_tr = cell.category = cat
|
198
201
|
offset = nil
|
199
202
|
if cell.conflicted
|
@@ -17,10 +17,12 @@ module Coopy
|
|
17
17
|
tt = ::Coopy::TableText.new(t)
|
18
18
|
codes = {}
|
19
19
|
codes["header"] = "\x1B[0;1m"
|
20
|
+
codes["spec"] = "\x1B[35;1m"
|
20
21
|
codes["add"] = "\x1B[32;1m"
|
21
22
|
codes["conflict"] = "\x1B[33;1m"
|
22
23
|
codes["modify"] = "\x1B[34;1m"
|
23
24
|
codes["remove"] = "\x1B[31;1m"
|
25
|
+
codes["minor"] = "\x1B[2m"
|
24
26
|
codes["done"] = "\x1B[0m"
|
25
27
|
begin
|
26
28
|
_g = 0
|
@@ -32,17 +34,22 @@ module Coopy
|
|
32
34
|
while(_g1 < w)
|
33
35
|
x = _g1
|
34
36
|
_g1+=1
|
35
|
-
txt += "," if x > 0
|
37
|
+
txt += _hx_str(codes["minor"]) + "," + _hx_str(codes["done"]) if x > 0
|
36
38
|
val = tt.get_cell_text(x,y)
|
37
39
|
val = "" if val == nil
|
38
40
|
cell = ::Coopy::DiffRender.render_cell(tt,x,y)
|
39
41
|
code = nil
|
40
42
|
code = codes[cell.category] if cell.category != nil
|
43
|
+
if cell.category_given_tr != nil
|
44
|
+
code_tr = codes[cell.category_given_tr]
|
45
|
+
code = code_tr if code_tr != nil
|
46
|
+
end
|
41
47
|
if code != nil
|
42
48
|
if cell.rvalue != nil
|
43
|
-
val = _hx_str(codes["remove"]) + _hx_str(cell.lvalue) + _hx_str(codes["modify"]) + _hx_str(cell.
|
44
|
-
val = _hx_str(codes["conflict"]) + _hx_str(cell.pvalue) + _hx_str(codes["modify"]) + _hx_str(cell.
|
49
|
+
val = _hx_str(codes["remove"]) + _hx_str(cell.lvalue) + _hx_str(codes["modify"]) + _hx_str(cell.pretty_separator) + _hx_str(codes["add"]) + _hx_str(cell.rvalue) + _hx_str(codes["done"])
|
50
|
+
val = _hx_str(codes["conflict"]) + _hx_str(cell.pvalue) + _hx_str(codes["modify"]) + _hx_str(cell.pretty_separator) + _hx_str(val) if cell.pvalue != nil
|
45
51
|
else
|
52
|
+
val = cell.pretty_value
|
46
53
|
val = _hx_str(code) + _hx_str(val) + _hx_str(codes["done"])
|
47
54
|
end
|
48
55
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: daff
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-07-
|
13
|
+
date: 2014-07-18 00:00:00.000000000 Z
|
14
14
|
dependencies: []
|
15
15
|
description: Diff and patch tables
|
16
16
|
email:
|