gdiff 0.0.1 → 0.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/CHANGELOG +4 -0
- data/InstalledFiles +1 -0
- data/README +7 -29
- data/lib/gdiff.rb +2 -2
- metadata +11 -6
data/CHANGELOG
CHANGED
data/InstalledFiles
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
/home/bschroed//lib/ruby/site_ruby/1.8/gdiff.rb
|
data/README
CHANGED
@@ -1,37 +1,15 @@
|
|
1
1
|
# gdiff / gpatch
|
2
2
|
|
3
3
|
## Description
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
http://ruby.brian-schroeder.de/gdiff/
|
10
|
-
|
11
|
-
## Installation:
|
12
|
-
|
13
|
-
wget http://ruby.brian-schroeder.de/gdiff/releases/gdiff-0.0.1.tar.bz2
|
14
|
-
tar -xvvjf gdiff-0.0.1.tar.bz2
|
15
|
-
cd gdiff-0.0.1
|
16
|
-
ruby setup.rb
|
4
|
+
The Generic Diff Format (GDIFF) can be used to efficiently describe the
|
5
|
+
differences between two arbirary files. The format does not make any
|
6
|
+
assumptions about the type or contents of the files, and thus can be used to
|
7
|
+
describe the differences between text files as well as binary files. The GDIFF
|
8
|
+
format is itself a binary file format.
|
17
9
|
|
18
|
-
##
|
19
|
-
|
20
|
-
gdiff file_a file_b > patch
|
21
|
-
gpatch file_a patch > file_b_from_patch
|
22
|
-
|
23
|
-
### or as a library:
|
24
|
-
|
25
|
-
require 'gdiff'
|
26
|
-
|
27
|
-
File.open("patch", "wb") do | patch |
|
28
|
-
patch << Diff::GDiff.diff(File.read("file_a"), File.read("file_b")).pack
|
29
|
-
end
|
10
|
+
## An implementation of the gdiff protocol
|
11
|
+
[Protocol description](http://www.w3.org/TR/NOTE-gdiff-19970901)
|
30
12
|
|
31
|
-
File.open("file_b_from_patch", "wb") do | file_b_2 |
|
32
|
-
file_b_2 << Diff::GDiff.unpack(File.read("patch")).apply_to(File.read("file_a"))
|
33
|
-
end
|
34
|
-
|
35
13
|
## Authors
|
36
14
|
This was implemented by Brian Schroeder with the help of Zed Shaws wonderfull
|
37
15
|
suffix-tree extension.
|
data/lib/gdiff.rb
CHANGED
@@ -69,8 +69,8 @@ module Diff
|
|
69
69
|
operation = self.new(string[position+1, length])
|
70
70
|
position += length + 1
|
71
71
|
return position, operation
|
72
|
-
elsif (type = {247 => USHORT, 248 => INT}
|
73
|
-
length = string[position + 1, type[2]].unpack(type[0])
|
72
|
+
elsif (type = {247 => USHORT, 248 => INT}[string[position]])
|
73
|
+
length = string[position + 1, type[2]].unpack(type[0])[0]
|
74
74
|
operation = self.new(string[position + 1 + type[2], length])
|
75
75
|
position += operation.data.length + 1 + type[2]
|
76
76
|
return position, operation
|
metadata
CHANGED
@@ -3,9 +3,9 @@ rubygems_version: 0.8.11
|
|
3
3
|
specification_version: 1
|
4
4
|
name: gdiff
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.0.
|
7
|
-
date:
|
8
|
-
summary:
|
6
|
+
version: 0.0.2
|
7
|
+
date: 2006-02-10 00:00:00 +01:00
|
8
|
+
summary: The Generic Diff Format (GDIFF) can be used to efficiently describe the differences between two arbirary files
|
9
9
|
require_paths:
|
10
10
|
- lib
|
11
11
|
- lib
|
@@ -13,7 +13,11 @@ require_paths:
|
|
13
13
|
email: gdiff@brian-schroeder.de
|
14
14
|
homepage: http://ruby.brian-schroeder.de/gdiff/
|
15
15
|
rubyforge_project:
|
16
|
-
description:
|
16
|
+
description: "The Generic Diff Format (GDIFF) can be used to efficiently describe the
|
17
|
+
differences between two arbirary files. The format does not make any assumptions
|
18
|
+
about the type or contents of the files, and thus can be used to describe the
|
19
|
+
differences between text files as well as binary files. The GDIFF format is
|
20
|
+
itself a binary file format."
|
17
21
|
autorequire: gdiff.rb
|
18
22
|
default_executable:
|
19
23
|
bindir: bin
|
@@ -36,6 +40,7 @@ files:
|
|
36
40
|
- README
|
37
41
|
- LICENSE.suffix_array
|
38
42
|
- CHANGELOG
|
43
|
+
- InstalledFiles
|
39
44
|
- setup.rb
|
40
45
|
- bin
|
41
46
|
- doc
|
@@ -96,10 +101,10 @@ files:
|
|
96
101
|
- doc/classes/SuffixArray.src/M000007.html
|
97
102
|
- ext/gdiff
|
98
103
|
- ext/gdiff/COPYING
|
99
|
-
- ext/gdiff/LICENSE
|
100
|
-
- ext/gdiff/README
|
101
104
|
- ext/gdiff/extconf.rb
|
102
105
|
- ext/gdiff/lcp.c
|
106
|
+
- ext/gdiff/LICENSE
|
107
|
+
- ext/gdiff/README
|
103
108
|
- ext/gdiff/sarray.3
|
104
109
|
- ext/gdiff/sarray.c
|
105
110
|
- ext/gdiff/sarray.h
|