excelsior 0.0.7 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -8,7 +8,7 @@ PKG_FILES = %w(Rakefile) +
8
8
 
9
9
  gem_spec = Gem::Specification.new do |gem_spec|
10
10
  gem_spec.name = 'excelsior'
11
- gem_spec.version = '0.0.7'
11
+ gem_spec.version = '0.0.9'
12
12
  gem_spec.summary = 'A Ruby gem that uses C bindings to read CSV files superfast. I\'m totally serial!'
13
13
  gem_spec.description = 'A Ruby gem that uses C bindings to read CSV files superfast. I\'m totally serial!'
14
14
  gem_spec.email = 'matt@toastyapps.com'
@@ -1,5 +1,5 @@
1
1
 
2
- #line 1 "excelsior_reader.rl"
2
+ #line 1 "ext/excelsior_reader/excelsior_reader.rl"
3
3
  #include <ruby.h>
4
4
 
5
5
  static ID s_read;
@@ -8,11 +8,11 @@ int has_found = 0;
8
8
  #define BUFSIZE 16384
9
9
 
10
10
 
11
- #line 23 "excelsior_reader.rl"
11
+ #line 23 "ext/excelsior_reader/excelsior_reader.rl"
12
12
 
13
13
 
14
14
 
15
- #line 16 "excelsior_reader.c"
15
+ #line 16 "ext/excelsior_reader/excelsior_reader.c"
16
16
  static const char _excelsior_scan_actions[] = {
17
17
  0, 1, 2, 1, 7, 1, 8, 1,
18
18
  9, 1, 10, 1, 11, 2, 0, 1,
@@ -71,7 +71,7 @@ static const int excelsior_scan_error = 0;
71
71
  static const int excelsior_scan_en_main = 2;
72
72
 
73
73
 
74
- #line 26 "excelsior_reader.rl"
74
+ #line 26 "ext/excelsior_reader/excelsior_reader.rl"
75
75
 
76
76
 
77
77
  VALUE e_rows(int argc, VALUE *argv, VALUE self) {
@@ -92,7 +92,7 @@ VALUE e_rows(int argc, VALUE *argv, VALUE self) {
92
92
  buf = (char *) malloc(buffer_size); //ALLOC_N(char, buffer_size); <= This caused problems
93
93
 
94
94
 
95
- #line 96 "excelsior_reader.c"
95
+ #line 96 "ext/excelsior_reader/excelsior_reader.c"
96
96
  {
97
97
  cs = excelsior_scan_start;
98
98
  ts = 0;
@@ -100,7 +100,7 @@ VALUE e_rows(int argc, VALUE *argv, VALUE self) {
100
100
  act = 0;
101
101
  }
102
102
 
103
- #line 46 "excelsior_reader.rl"
103
+ #line 46 "ext/excelsior_reader/excelsior_reader.rl"
104
104
 
105
105
  while(!done) {
106
106
 
@@ -116,12 +116,11 @@ VALUE e_rows(int argc, VALUE *argv, VALUE self) {
116
116
  } else {
117
117
  // Going to assume it's a string and already in memory
118
118
  //str = io;
119
- len = buffer_size = RSTRING_LEN(io);
120
- memcpy(p, StringValuePtr(io), len);
121
- space = buffer_size - have;
122
- pe = p + buffer_size;
123
- eof = pe;
124
- done = 1;
119
+ p = RSTRING_PTR(io);
120
+ len = RSTRING_LEN(io);
121
+ pe = p + len;
122
+ eof = pe;
123
+ done = 1;
125
124
  }
126
125
 
127
126
  if(len < space) {
@@ -134,7 +133,7 @@ VALUE e_rows(int argc, VALUE *argv, VALUE self) {
134
133
  }
135
134
 
136
135
 
137
- #line 138 "excelsior_reader.c"
136
+ #line 137 "ext/excelsior_reader/excelsior_reader.c"
138
137
  {
139
138
  int _klen;
140
139
  unsigned int _trans;
@@ -152,10 +151,10 @@ _resume:
152
151
  while ( _nacts-- > 0 ) {
153
152
  switch ( *_acts++ ) {
154
153
  case 2:
155
- #line 1 "excelsior_reader.rl"
154
+ #line 1 "ext/excelsior_reader/excelsior_reader.rl"
156
155
  {ts = p;}
157
156
  break;
158
- #line 159 "excelsior_reader.c"
157
+ #line 158 "ext/excelsior_reader/excelsior_reader.c"
159
158
  }
160
159
  }
161
160
 
@@ -221,39 +220,39 @@ _eof_trans:
221
220
  switch ( *_acts++ )
222
221
  {
223
222
  case 3:
224
- #line 1 "excelsior_reader.rl"
223
+ #line 1 "ext/excelsior_reader/excelsior_reader.rl"
225
224
  {te = p+1;}
226
225
  break;
227
226
  case 4:
228
- #line 18 "excelsior_reader.rl"
227
+ #line 18 "ext/excelsior_reader/excelsior_reader.rl"
229
228
  {act = 2;}
230
229
  break;
231
230
  case 5:
232
- #line 19 "excelsior_reader.rl"
231
+ #line 19 "ext/excelsior_reader/excelsior_reader.rl"
233
232
  {act = 3;}
234
233
  break;
235
234
  case 6:
236
- #line 20 "excelsior_reader.rl"
235
+ #line 20 "ext/excelsior_reader/excelsior_reader.rl"
237
236
  {act = 4;}
238
237
  break;
239
238
  case 7:
240
- #line 17 "excelsior_reader.rl"
239
+ #line 17 "ext/excelsior_reader/excelsior_reader.rl"
241
240
  {te = p+1;{ if(has_found ==0) rb_ary_push(arr, Qnil); rb_yield(arr); arr = rb_ary_new(); has_found = 0; }}
242
241
  break;
243
242
  case 8:
244
- #line 21 "excelsior_reader.rl"
243
+ #line 21 "ext/excelsior_reader/excelsior_reader.rl"
245
244
  {te = p+1;{ if(has_found == 0) rb_ary_push(arr, Qnil); has_found = 0;}}
246
245
  break;
247
246
  case 9:
248
- #line 17 "excelsior_reader.rl"
247
+ #line 17 "ext/excelsior_reader/excelsior_reader.rl"
249
248
  {te = p;p--;{ if(has_found ==0) rb_ary_push(arr, Qnil); rb_yield(arr); arr = rb_ary_new(); has_found = 0; }}
250
249
  break;
251
250
  case 10:
252
- #line 20 "excelsior_reader.rl"
251
+ #line 20 "ext/excelsior_reader/excelsior_reader.rl"
253
252
  {te = p;p--;{ rb_ary_push(arr, rb_str_new(ts + 1, te - ts - 2)); has_found = 1;}}
254
253
  break;
255
254
  case 11:
256
- #line 1 "excelsior_reader.rl"
255
+ #line 1 "ext/excelsior_reader/excelsior_reader.rl"
257
256
  { switch( act ) {
258
257
  case 0:
259
258
  {{cs = 0; goto _again;}}
@@ -270,7 +269,7 @@ _eof_trans:
270
269
  }
271
270
  }
272
271
  break;
273
- #line 274 "excelsior_reader.c"
272
+ #line 273 "ext/excelsior_reader/excelsior_reader.c"
274
273
  }
275
274
  }
276
275
 
@@ -280,14 +279,14 @@ _again:
280
279
  while ( _nacts-- > 0 ) {
281
280
  switch ( *_acts++ ) {
282
281
  case 0:
283
- #line 1 "excelsior_reader.rl"
282
+ #line 1 "ext/excelsior_reader/excelsior_reader.rl"
284
283
  {ts = 0;}
285
284
  break;
286
285
  case 1:
287
- #line 1 "excelsior_reader.rl"
286
+ #line 1 "ext/excelsior_reader/excelsior_reader.rl"
288
287
  {act = 0;}
289
288
  break;
290
- #line 291 "excelsior_reader.c"
289
+ #line 290 "ext/excelsior_reader/excelsior_reader.c"
291
290
  }
292
291
  }
293
292
 
@@ -307,7 +306,7 @@ _again:
307
306
  _out: {}
308
307
  }
309
308
 
310
- #line 79 "excelsior_reader.rl"
309
+ #line 78 "ext/excelsior_reader/excelsior_reader.rl"
311
310
 
312
311
  if(ts != 0) { // we are not at the end
313
312
  have = pe - ts; //so copy stuff back in
@@ -58,12 +58,11 @@ VALUE e_rows(int argc, VALUE *argv, VALUE self) {
58
58
  } else {
59
59
  // Going to assume it's a string and already in memory
60
60
  //str = io;
61
- len = buffer_size = RSTRING_LEN(io);
62
- memcpy(p, StringValuePtr(io), len);
63
- space = buffer_size - have;
64
- pe = p + buffer_size;
65
- eof = pe;
66
- done = 1;
61
+ p = RSTRING_PTR(io);
62
+ len = RSTRING_LEN(io);
63
+ pe = p + len;
64
+ eof = pe;
65
+ done = 1;
67
66
  }
68
67
 
69
68
  if(len < space) {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: excelsior
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Mongeau
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-09 00:00:00 -05:00
12
+ date: 2009-12-10 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies: []
15
15