artemv-diff_to_html 1.0.1 → 1.0.2
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/README.rdoc +9 -0
- data/examples/test.rb +5 -2
- data/lib/diff_to_html.rb +1 -1
- metadata +1 -1
data/README.rdoc
CHANGED
@@ -22,6 +22,15 @@ things to improve, so contribution/patches are very welcome.
|
|
22
22
|
converter = DiffToHtml.new
|
23
23
|
...
|
24
24
|
|
25
|
+
* to use in any Ruby program:
|
26
|
+
|
27
|
+
require 'rubygems'
|
28
|
+
gem 'artemv-diff_to_html'
|
29
|
+
require 'diff_to_html'
|
30
|
+
...
|
31
|
+
|
32
|
+
(just like in test.rb)
|
33
|
+
|
25
34
|
== License
|
26
35
|
|
27
36
|
diff_to_html is released under the MIT license.
|
data/examples/test.rb
CHANGED
@@ -1,6 +1,9 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
gem 'artemv-diff_to_html'
|
1
3
|
require 'diff_to_html'
|
2
|
-
|
3
|
-
|
4
|
+
#require '../lib/diff_to_html.rb'
|
5
|
+
diff = `svn diff -r 46:47 svn://hamptoncatlin.com/haml --diff-cmd diff -x "-U 2"`
|
6
|
+
#diff = `cat diff`
|
4
7
|
puts <<EOF
|
5
8
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
6
9
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
data/lib/diff_to_html.rb
CHANGED
@@ -123,7 +123,7 @@ EOF
|
|
123
123
|
line = line[1..-1]
|
124
124
|
|
125
125
|
if ((@last_op != ' ' and op == ' ') or (@last_op == ' ' and op != ' '))
|
126
|
-
flush_changes(result, left_ln, right_ln)
|
126
|
+
left_ln, right_ln = flush_changes(result, left_ln, right_ln)
|
127
127
|
end
|
128
128
|
|
129
129
|
# truncate and escape
|