html-diff 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/html_diff.rb +1 -4
- metadata +1 -1
data/lib/html_diff.rb
CHANGED
@@ -8,7 +8,7 @@ class HtmlDiff
|
|
8
8
|
|
9
9
|
def stats_line
|
10
10
|
stats=`git diff --stat #{@argv.join(" ")}`
|
11
|
-
if stats
|
11
|
+
if stats == ""
|
12
12
|
return "no changes"
|
13
13
|
end
|
14
14
|
stats.scan(/\d+ files? changed, \d+ insertions?\(\+\), \d+ deletions?\(\-\)/).last
|
@@ -21,9 +21,6 @@ class HtmlDiff
|
|
21
21
|
|
22
22
|
def html_diff
|
23
23
|
diff=`git diff #{@argv.join(" ")}`
|
24
|
-
if diff.blank?
|
25
|
-
return
|
26
|
-
end
|
27
24
|
diff.gsub!(/^diff \-\-git a\/([^\s]*).*\n.*$/) { "<div class='diff-file'>"+$1+"</div>" }
|
28
25
|
diff.gsub!(/^(\-\-\-\s)(a.*)$/) { "<div class='code'><span class='delete'>"+$1+" "+$2+"</span>" }
|
29
26
|
diff.gsub!(/(\n\<div class\=\'diff-file\'\>)/) { "</div>"+$1}
|