ccsv 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.
Potentially problematic release.
This version of ccsv might be problematic. Click here for more details.
- data.tar.gz.sig +0 -0
- data/CHANGELOG +2 -0
- data/ccsv.gemspec +2 -2
- data/ext/ccsv.c +6 -6
- metadata +1 -1
- metadata.gz.sig +0 -0
data.tar.gz.sig
CHANGED
Binary file
|
data/CHANGELOG
CHANGED
data/ccsv.gemspec
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
|
2
|
-
# Gem::Specification for Ccsv-0.0.
|
2
|
+
# Gem::Specification for Ccsv-0.0.2
|
3
3
|
# Originally generated by Echoe
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = %q{ccsv}
|
7
|
-
s.version = "0.0.
|
7
|
+
s.version = "0.0.2"
|
8
8
|
s.date = %q{2007-09-26}
|
9
9
|
s.summary = %q{A pure-C CSV parser.}
|
10
10
|
s.require_paths = ["lib", "ext"]
|
data/ext/ccsv.c
CHANGED
@@ -11,19 +11,19 @@ static VALUE foreach(VALUE self, VALUE filename) {
|
|
11
11
|
|
12
12
|
char line[MAX_LENGTH];
|
13
13
|
char *token;
|
14
|
-
VALUE
|
15
|
-
|
14
|
+
VALUE ary = rb_ary_new();
|
15
|
+
int idx;
|
16
16
|
|
17
|
-
int i, j;
|
18
17
|
while (fgets(line, sizeof(line), file) != NULL) {
|
19
18
|
token = strtok(line, DELIMITERS);
|
20
|
-
|
19
|
+
idx = 0;
|
21
20
|
|
22
21
|
while (token != NULL) {
|
23
|
-
|
22
|
+
rb_ary_store(ary, idx, rb_str_new(token, strlen(token)));
|
23
|
+
idx ++;
|
24
24
|
token = strtok(NULL, DELIMITERS);
|
25
25
|
}
|
26
|
-
rb_yield(
|
26
|
+
rb_yield(ary);
|
27
27
|
}
|
28
28
|
|
29
29
|
return Qnil;
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|