html-diff 0.0.2 → 0.0.3
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/html_diff.rb +2 -1
- metadata +1 -1
data/lib/html_diff.rb
CHANGED
@@ -21,8 +21,9 @@ class HtmlDiff
|
|
21
21
|
|
22
22
|
def html_diff
|
23
23
|
diff=`git diff #{@argv.join(" ")}`
|
24
|
+
diff.gsub!(/^index [a-z0-9]{7}\.\.[a-z0-9]{7}$/, "")
|
24
25
|
diff.gsub!(/^diff \-\-git a\/([^\s]*).*\n.*$/) { "<div class='diff-file'>"+$1+"</div>" }
|
25
|
-
diff.gsub!(/^(\-\-\-\s)(a.*)$/) { "<div class='code'><span class='delete'>"+$1+" "+$2+"</span>" }
|
26
|
+
diff.gsub!(/^(\-\-\-\s)((?:a.*)|(?:\/dev\/null.*))$/) { "<div class='code'><span class='delete'>"+$1+" "+$2+"</span>" }
|
26
27
|
diff.gsub!(/(\n\<div class\=\'diff-file\'\>)/) { "</div>"+$1}
|
27
28
|
diff.gsub!(/^(\@\@.*)$/) { "<br><span class='at-linenums'>"+$1+"</span>"}
|
28
29
|
|