daff 1.3.17 → 1.3.18

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: d6f65a385fee358bbe09425bdcc8ca32e04d4ea4
4
- data.tar.gz: f031cd934043e01a77c3b69a7042a45b98ca159e
3
+ metadata.gz: 099f0b4a80e2ba78cdf6b7bf2fbe0272186d421a
4
+ data.tar.gz: bce4be10631472f0b8af958c314519ef4f30daef
5
5
  SHA512:
6
- metadata.gz: 935bf82b13cbfcb5ee4b0719cc8d98fd6ac01025ef6cd9e10ac8785c753456d69959409a5a53a9df07023d4ac8060cb332503691c9263f786f6f300d3c6a0705
7
- data.tar.gz: 78e3e2b296d6d344e365e64ec5c14380f0a98c6186cd6bb2a7523bbd918797b893a7fc0f3ef391c8bd4f1556d21b86123c884b380cb891437ae8cc95adc387af
6
+ metadata.gz: 589bbd9cf10186e6b29214c4b2e0e15d781f6b87069994211f3041d3466e86e9fee5673ce874cb2a72314990d4a3b12a1384981f5362c76856c0f596105e9948
7
+ data.tar.gz: 4e260943a9253cb18a8e72ff6b6c79c593f3aeca80391db45ac145f24934146778d29d5e5a39f9c223968ea99f1dca5dbffef58027354876c8119aab73fb255b
@@ -27,6 +27,7 @@ module Coopy
27
27
  @ignore_whitespace = false
28
28
  @ignore_case = false
29
29
  @terminal_format = nil
30
+ @use_glyphs = true
30
31
  end
31
32
 
32
33
  attr_accessor :ordered
@@ -52,6 +53,7 @@ module Coopy
52
53
  attr_accessor :ignore_whitespace
53
54
  attr_accessor :ignore_case
54
55
  attr_accessor :terminal_format
56
+ attr_accessor :use_glyphs
55
57
 
56
58
  def filter(act,allow)
57
59
  if @acts == nil
@@ -20,7 +20,6 @@ module Coopy
20
20
  attr_accessor :order_set
21
21
  attr_accessor :order_preference
22
22
  attr_accessor :io
23
- attr_accessor :pretty
24
23
  attr_accessor :strategy
25
24
  attr_accessor :css_output
26
25
  attr_accessor :fragment
@@ -38,7 +37,6 @@ module Coopy
38
37
  @order_set = false
39
38
  @order_preference = false
40
39
  @strategy = nil
41
- @pretty = true
42
40
  @css_output = nil
43
41
  @fragment = false
44
42
  @flags = nil
@@ -95,7 +93,7 @@ module Coopy
95
93
 
96
94
  def get_renderer
97
95
  renderer = ::Coopy::DiffRender.new
98
- renderer.use_pretty_arrows(@pretty)
96
+ renderer.use_pretty_arrows(@flags.use_glyphs)
99
97
  renderer
100
98
  end
101
99
 
@@ -540,7 +538,7 @@ module Coopy
540
538
  break
541
539
  elsif tag == "--plain"
542
540
  more = true
543
- @pretty = false
541
+ @flags.use_glyphs = false
544
542
  args.slice!(i,1)
545
543
  break
546
544
  elsif tag == "--all"
@@ -837,7 +835,7 @@ module Coopy
837
835
  class << self
838
836
  attr_accessor :version
839
837
  end
840
- @version = "1.3.17"
838
+ @version = "1.3.18"
841
839
 
842
840
  def Coopy.diff_as_html(local,remote,flags = nil)
843
841
  comp = ::Coopy::TableComparisonState.new
@@ -7,10 +7,12 @@ module Coopy
7
7
  def initialize(flags = nil)
8
8
  @align_columns = true
9
9
  @wide_columns = false
10
+ @use_glyphs = true
10
11
  @flags = flags
11
12
  if flags != nil
12
13
  @align_columns = false if flags.padding_strategy == "dense"
13
14
  @wide_columns = true if flags.padding_strategy == "sparse"
15
+ @use_glyphs = flags.use_glyphs
14
16
  end
15
17
  end
16
18
 
@@ -22,6 +24,7 @@ module Coopy
22
24
  attr_accessor :v
23
25
  attr_accessor :align_columns
24
26
  attr_accessor :wide_columns
27
+ attr_accessor :use_glyphs
25
28
  attr_accessor :flags
26
29
 
27
30
  public
@@ -106,16 +109,28 @@ module Coopy
106
109
  code = code_tr if code_tr != nil
107
110
  end
108
111
  if code != nil
112
+ separator = nil
113
+ if @use_glyphs
114
+ separator = cell.pretty_separator
115
+ else
116
+ separator = cell.separator
117
+ end
109
118
  if cell.rvalue != nil
110
- 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"])
111
- val = _hx_str(@codes["conflict"]) + _hx_str(cell.pvalue) + _hx_str(@codes["modify"]) + _hx_str(cell.pretty_separator) + _hx_str(val.to_s) if cell.pvalue != nil
119
+ val = _hx_str(@codes["remove"]) + _hx_str(cell.lvalue) + _hx_str(@codes["modify"]) + _hx_str(separator) + _hx_str(@codes["add"]) + _hx_str(cell.rvalue) + _hx_str(@codes["done"])
120
+ val = _hx_str(@codes["conflict"]) + _hx_str(cell.pvalue) + _hx_str(@codes["modify"]) + _hx_str(separator) + _hx_str(val.to_s) if cell.pvalue != nil
112
121
  else
113
- val = cell.pretty_value
122
+ if @use_glyphs
123
+ val = cell.pretty_value
124
+ else
125
+ val = cell.value
126
+ end
114
127
  val = _hx_str(code) + _hx_str(val.to_s) + _hx_str(@codes["done"])
115
128
  end
116
129
  end
117
- else
130
+ elsif @use_glyphs
118
131
  val = cell.pretty_value
132
+ else
133
+ val = cell.value
119
134
  end
120
135
  @csv.render_cell(@v,val)
121
136
  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.3.17
4
+ version: 1.3.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Smith
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-06-05 00:00:00.000000000 Z
12
+ date: 2016-06-24 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Diff and patch tables
15
15
  email: