Skip to content

Commit 1d8fa0c

Browse files
committed
Fix bug introduced with diff-lcs support
1 parent acc258b commit 1d8fa0c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.DS_Store
22
doc
33
pkg
4+
test
45
.yardoc

lib/csv-diff-report/html.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
require 'cgi'
2-
require 'lcs-diff' rescue nil
2+
begin
3+
require 'lcs-diff'
4+
rescue LoadError
5+
end
36

47

58
class CSVDiff
@@ -171,7 +174,7 @@ def html_diff(body, file_diff)
171174
body << '<td>'
172175
if style == 'update' && @lcs_available && old && new && (old.to_s.lines.count > 1 || new.to_s.lines.count > 1)
173176
body << '<code>'
174-
Diff::LCS.diff(old.lines, new.lines).each_with_index |chg_set, j|
177+
Diff::LCS.diff(old.lines, new.lines).each_with_index do |chg_set, j|
175178
body << '...' unless j == 0
176179
chg_set.each do |lcs_diff|
177180
body << "#{lcs_diff.position}&nbsp;&nbsp;<span class='#{

0 commit comments

Comments
 (0)