jsonsl 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/jsonsl_ext/jsonsl_row_parser.c +7 -3
- data/lib/jsonsl/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31d56076ec6092f8cf9024f9c100cb37acb0a9cc22700b7d907f478afbe462a4
|
4
|
+
data.tar.gz: fb5cdc81b227ffccd52ee3ffa320940c54c03996a9fa79efbfd1ce9e00e391c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0593dad215bc868ddde6e24aa5c7cd108e68ef874c5b3b91a2a4d9599c5478e238004d63af34972b35a7f985a7563d9b06cc516e26fa987a73d0a767a64ede4b'
|
7
|
+
data.tar.gz: 134c6b06d16f19e3e64ca14d96365288854761672c2635290fba8fbd633f942ca6e1e58bc6eb6071e5616a96f496b389d5a3106755ea55c82134382277a13266
|
@@ -127,6 +127,9 @@ static void jsl_parser_row_pop_callback(jsonsl_t jsn, jsonsl_action_t action, st
|
|
127
127
|
if (state->val == jsl_sym_rows) {
|
128
128
|
jsn->action_callback_POP = jsl_parser_cover_pop_callback;
|
129
129
|
jsn->action_callback_PUSH = NULL;
|
130
|
+
if (parser->rowcount == 0) {
|
131
|
+
parser->header_len = state->pos_begin + 1;
|
132
|
+
}
|
130
133
|
return;
|
131
134
|
}
|
132
135
|
|
@@ -135,7 +138,7 @@ static void jsl_parser_row_pop_callback(jsonsl_t jsn, jsonsl_action_t action, st
|
|
135
138
|
if (state->type == JSONSL_T_SPECIAL) {
|
136
139
|
len--;
|
137
140
|
}
|
138
|
-
rb_funcall(parser->proc, jsl_id_call, 2,
|
141
|
+
rb_funcall(parser->proc, jsl_id_call, 2, rb_str_new(ptr, len), INT2FIX(parser->rowcount));
|
139
142
|
parser->rowcount++;
|
140
143
|
|
141
144
|
(void)action;
|
@@ -245,12 +248,13 @@ static VALUE jsl_parser_inspect(VALUE self)
|
|
245
248
|
static VALUE jsl_parser_feed(VALUE self, VALUE data)
|
246
249
|
{
|
247
250
|
jsl_PARSER *parser = DATA_PTR(self);
|
248
|
-
size_t old_len
|
251
|
+
size_t old_len;
|
249
252
|
|
250
253
|
if (NIL_P(parser->buffer)) {
|
251
|
-
|
254
|
+
return self;
|
252
255
|
}
|
253
256
|
Check_Type(data, T_STRING);
|
257
|
+
old_len = RSTRING_LEN(parser->buffer);
|
254
258
|
rb_str_buf_append(parser->buffer, data);
|
255
259
|
jsonsl_feed(parser->jsn, RSTRING_PTR(parser->buffer) + old_len, RSTRING_LEN(data));
|
256
260
|
|
data/lib/jsonsl/version.rb
CHANGED