gdiff 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +11 -2
- data/bin/gdiff +2 -1
- data/bin/gpatch +2 -1
- data/ext/gdiff/suffix_array.c +6 -6
- data/lib/gdiff.rb +1 -1
- data/test/tc_gdiff.rb +2 -0
- metadata +95 -96
data/CHANGELOG
CHANGED
@@ -1,6 +1,15 @@
|
|
1
|
+
0.0.3
|
2
|
+
* Use print instead of puts, removing unneccessary newlines.
|
3
|
+
[Proposed by Leslie Vilijoen]
|
4
|
+
* Open files explicitly in binmode, to make it work under
|
5
|
+
windows. [Proposed by Leslie Vilijoen]
|
6
|
+
* Removed some signedness-errors from the suffixarray code.
|
7
|
+
* Made all the testcases pass again
|
8
|
+
|
9
|
+
|
1
10
|
0.0.2
|
2
|
-
* Removed bug
|
3
|
-
|
11
|
+
* Removed bug, where gdiff crashed with certain large files.
|
12
|
+
[Reported by David Felstead]
|
4
13
|
|
5
14
|
0.0.1
|
6
15
|
* Improved documentation
|
data/bin/gdiff
CHANGED
data/bin/gpatch
CHANGED
data/ext/gdiff/suffix_array.c
CHANGED
@@ -45,7 +45,7 @@ inline int scan_string(unsigned char *source, size_t src_len,
|
|
45
45
|
|
46
46
|
size_t find_longest_match(unsigned char *source, size_t src_len,
|
47
47
|
unsigned char *target, size_t *tgt_len,
|
48
|
-
unsigned int starts[], unsigned int ends[],
|
48
|
+
unsigned int starts[], unsigned int ends[], int sa[])
|
49
49
|
{
|
50
50
|
size_t high = ends[*target] + 1;
|
51
51
|
size_t low = starts[*target];
|
@@ -149,7 +149,7 @@ static VALUE SuffixArray_initialize(int argc, VALUE *argv, VALUE self)
|
|
149
149
|
rb_iv_set(self, "@source", sa_source_str);
|
150
150
|
|
151
151
|
// setup temporary variables for the source and length pointers
|
152
|
-
unsigned char *sa_source = RSTRING(sa_source_str)->ptr;
|
152
|
+
unsigned char *sa_source = (unsigned char *) RSTRING(sa_source_str)->ptr;
|
153
153
|
size_t sa_source_len = RSTRING(sa_source_str)->len;
|
154
154
|
|
155
155
|
// error check the whole thing
|
@@ -231,14 +231,14 @@ static VALUE SuffixArray_longest_match(VALUE self, VALUE target, VALUE from_inde
|
|
231
231
|
|
232
232
|
|
233
233
|
// get better pointers for the source (should already be in String form)
|
234
|
-
unsigned char *source_ptr = RSTRING(sa_source)->ptr;
|
234
|
+
unsigned char *source_ptr = (unsigned char *) RSTRING(sa_source)->ptr;
|
235
235
|
size_t source_len = RSTRING(sa_source)->len;
|
236
236
|
|
237
237
|
// get the target as a string
|
238
238
|
VALUE target_str = StringValue(target);
|
239
239
|
|
240
240
|
// better pointers again, we also need target_len as an in/out parameter
|
241
|
-
unsigned char *target_ptr = RSTRING(target_str)->ptr;
|
241
|
+
unsigned char *target_ptr = (unsigned char *) RSTRING(target_str)->ptr;
|
242
242
|
size_t target_len = RSTRING(target_str)->len;
|
243
243
|
|
244
244
|
// check the input for validity, returning nil like in array operations
|
@@ -297,14 +297,14 @@ static VALUE SuffixArray_longest_nonmatch(VALUE self, VALUE target, VALUE from_i
|
|
297
297
|
size_t min = NUM2INT(min_match);
|
298
298
|
|
299
299
|
// get better pointers for the source (should already be in String form)
|
300
|
-
unsigned char *source_ptr = RSTRING(sa_source)->ptr;
|
300
|
+
unsigned char *source_ptr = (unsigned char *) RSTRING(sa_source)->ptr;
|
301
301
|
size_t source_len = RSTRING(sa_source)->len;
|
302
302
|
|
303
303
|
// get the target as a string
|
304
304
|
VALUE target_str = StringValue(target);
|
305
305
|
|
306
306
|
// better pointers again, we also need target_len as an in/out parameter
|
307
|
-
unsigned char *target_ptr = RSTRING(target_str)->ptr;
|
307
|
+
unsigned char *target_ptr = (unsigned char *) RSTRING(target_str)->ptr;
|
308
308
|
size_t target_len = RSTRING(target_str)->len;
|
309
309
|
|
310
310
|
// check the input for validity, returning nil like in array operations
|
data/lib/gdiff.rb
CHANGED
data/test/tc_gdiff.rb
CHANGED
metadata
CHANGED
@@ -3,122 +3,121 @@ 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: 2006-
|
6
|
+
version: 0.0.3
|
7
|
+
date: 2006-07-21 00:00:00 +02:00
|
8
8
|
summary: The Generic Diff Format (GDIFF) can be used to efficiently describe the differences between two arbirary files
|
9
9
|
require_paths:
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
- lib
|
11
|
+
- lib
|
12
|
+
- ext
|
13
13
|
email: gdiff@brian-schroeder.de
|
14
14
|
homepage: http://ruby.brian-schroeder.de/gdiff/
|
15
15
|
rubyforge_project:
|
16
|
-
description:
|
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."
|
16
|
+
description: The Generic Diff Format (GDIFF) can be used to efficiently describe the differences between two arbirary files. The format does not make any assumptions about the type or contents of the files, and thus can be used to describe the differences between text files as well as binary files. The GDIFF format is itself a binary file format.
|
21
17
|
autorequire: gdiff.rb
|
22
18
|
default_executable:
|
23
19
|
bindir: bin
|
24
20
|
has_rdoc: true
|
25
21
|
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
26
22
|
requirements:
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
version: 0.0.0
|
23
|
+
- - ">"
|
24
|
+
- !ruby/object:Gem::Version
|
25
|
+
version: 0.0.0
|
31
26
|
version:
|
32
27
|
platform: ruby
|
33
28
|
signing_key:
|
34
29
|
cert_chain:
|
35
30
|
authors:
|
36
|
-
|
31
|
+
- Brian Schroeder
|
37
32
|
files:
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
33
|
+
- COPYING.suffix_array
|
34
|
+
- README.suffix_array
|
35
|
+
- README
|
36
|
+
- LICENSE.suffix_array
|
37
|
+
- CHANGELOG
|
38
|
+
- InstalledFiles
|
39
|
+
- setup.rb
|
40
|
+
- bin
|
41
|
+
- doc
|
42
|
+
- ext
|
43
|
+
- lib
|
44
|
+
- test
|
45
|
+
- bin/gdiff
|
46
|
+
- bin/gpatch
|
47
|
+
- doc/index.html
|
48
|
+
- doc/rdoc-style.css
|
49
|
+
- doc/fr_method_index.html
|
50
|
+
- doc/fr_class_index.html
|
51
|
+
- doc/fr_file_index.html
|
52
|
+
- doc/created.rid
|
53
|
+
- doc/files
|
54
|
+
- doc/classes
|
55
|
+
- doc/files/ext
|
56
|
+
- doc/files/lib
|
57
|
+
- doc/files/ext/gdiff
|
58
|
+
- doc/files/ext/gdiff/suffix_array
|
59
|
+
- doc/files/ext/gdiff/suffix_array/sarray_c.html
|
60
|
+
- doc/files/ext/gdiff/suffix_array/suffix_array_c.html
|
61
|
+
- doc/files/ext/gdiff/suffix_array/extconf_rb.html
|
62
|
+
- doc/files/ext/gdiff/suffix_array/lcp_c.html
|
63
|
+
- doc/files/lib/gdiff_rb.html
|
64
|
+
- doc/classes/SuffixArray.html
|
65
|
+
- doc/classes/SAError.html
|
66
|
+
- doc/classes/Diff.html
|
67
|
+
- doc/classes/Diff
|
68
|
+
- doc/classes/SuffixArray.src
|
69
|
+
- doc/classes/Diff/GDiff.html
|
70
|
+
- doc/classes/Diff/GDiff
|
71
|
+
- doc/classes/Diff/GDiff/EPrematureEndOfStream.html
|
72
|
+
- doc/classes/Diff/GDiff/ENoGdiffStream.html
|
73
|
+
- doc/classes/Diff/GDiff/EGdiffError.html
|
74
|
+
- doc/classes/Diff/GDiff/Operations.html
|
75
|
+
- doc/classes/Diff/GDiff/Operations
|
76
|
+
- doc/classes/Diff/GDiff/Operations/Copy.html
|
77
|
+
- doc/classes/Diff/GDiff/Operations/Data.html
|
78
|
+
- doc/classes/Diff/GDiff/Operations/Copy.src
|
79
|
+
- doc/classes/Diff/GDiff/Operations/Data.src
|
80
|
+
- doc/classes/Diff/GDiff/Operations/Copy.src/M000014.html
|
81
|
+
- doc/classes/Diff/GDiff/Operations/Copy.src/M000015.html
|
82
|
+
- doc/classes/Diff/GDiff/Operations/Copy.src/M000016.html
|
83
|
+
- doc/classes/Diff/GDiff/Operations/Copy.src/M000017.html
|
84
|
+
- doc/classes/Diff/GDiff/Operations/Data.src/M000009.html
|
85
|
+
- doc/classes/Diff/GDiff/Operations/Data.src/M000010.html
|
86
|
+
- doc/classes/Diff/GDiff/Operations/Data.src/M000011.html
|
87
|
+
- doc/classes/Diff/GDiff/Operations/Data.src/M000012.html
|
88
|
+
- doc/classes/Diff/GDiff/Operations/Data.src/M000013.html
|
89
|
+
- doc/classes/SuffixArray.src/M000008.html
|
90
|
+
- doc/classes/SuffixArray.src/M000001.html
|
91
|
+
- doc/classes/SuffixArray.src/M000002.html
|
92
|
+
- doc/classes/SuffixArray.src/M000003.html
|
93
|
+
- doc/classes/SuffixArray.src/M000004.html
|
94
|
+
- doc/classes/SuffixArray.src/M000005.html
|
95
|
+
- doc/classes/SuffixArray.src/M000006.html
|
96
|
+
- doc/classes/SuffixArray.src/M000007.html
|
97
|
+
- ext/gdiff
|
98
|
+
- ext/gdiff/COPYING
|
99
|
+
- ext/gdiff/extconf.rb
|
100
|
+
- ext/gdiff/lcp.c
|
101
|
+
- ext/gdiff/LICENSE
|
102
|
+
- ext/gdiff/README
|
103
|
+
- ext/gdiff/sarray.3
|
104
|
+
- ext/gdiff/sarray.c
|
105
|
+
- ext/gdiff/sarray.h
|
106
|
+
- ext/gdiff/suffix_array.c
|
107
|
+
- lib/gdiff.rb
|
108
|
+
- test/tc_gdiff.rb
|
114
109
|
test_files:
|
115
|
-
|
110
|
+
- test/tc_gdiff.rb
|
116
111
|
rdoc_options: []
|
112
|
+
|
117
113
|
extra_rdoc_files: []
|
114
|
+
|
118
115
|
executables:
|
119
|
-
|
120
|
-
|
116
|
+
- gpatch
|
117
|
+
- gdiff
|
121
118
|
extensions:
|
122
|
-
|
119
|
+
- ext/gdiff/extconf.rb
|
123
120
|
requirements: []
|
124
|
-
|
121
|
+
|
122
|
+
dependencies: []
|
123
|
+
|