fastapi 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/fastapi.rb +22 -6
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 328f3a1e05457ead48ba2c6d01c09bfd7dcdfeb0
4
- data.tar.gz: 40861b7243fede0344304840c81344e3c1a06db4
3
+ metadata.gz: f63fbcf57897ab8ecee8a900a93516b97acff713
4
+ data.tar.gz: 423602ac6ead2c5a13601358a5d6dc0cd908dc9f
5
5
  SHA512:
6
- metadata.gz: 18773bd2adf7042592c600e7a00c4c0af2514d39796f20dfe195f6eb789396ed40facbf52e46b63fcebf81b7775b648773e7f0da82c9acdce2207f0e2587df9e
7
- data.tar.gz: 7d21483a9259b0d76c78aac7d40afb0d499b4924855255b622fdd4998a20d306281956f72fa093eb57ac6beae9da76fc8a52342c23088e88a77643db4216d0ae
6
+ metadata.gz: 427a8df5aa5fb190764684dfbc50aca87c78fe430b860c0e94898f72d78c5c16791682fdb8f9f49e0b9fbcddd72090f4679370db924a295ea1d4cde2f02f1928
7
+ data.tar.gz: aceba336fc6a779b0e26e0a4f59aa5965bdcbf02446147b478ced92eac26bd6b0c23b5470ee281ec2506fc59f494a2b66d7e674a6296c29fdf18c81663d461ef
data/lib/fastapi.rb CHANGED
@@ -236,7 +236,7 @@ class FastAPI
236
236
  types: model.fastapi_fields_sub.map { |field| (columns_hash.has_key? field.to_s) ? columns_hash[field.to_s].type : nil },
237
237
  }
238
238
  end
239
- # model_lookup = model_lookup.map { |model| }
239
+
240
240
  error = nil
241
241
 
242
242
  begin
@@ -306,7 +306,7 @@ class FastAPI
306
306
 
307
307
  my_end = Time.now()
308
308
 
309
- # logger.info dataset.size.to_s + '-length array parsed in ' + (my_end - start).to_s
309
+ # puts dataset.size.to_s + '-length array parsed in ' + (my_end - start).to_s
310
310
 
311
311
  {
312
312
  data: dataset,
@@ -337,31 +337,46 @@ class FastAPI
337
337
 
338
338
  while i < len
339
339
 
340
- if str[i] == ')'
340
+ c = str[i]
341
+
342
+ if c == ')'
341
343
 
342
344
  rows << cur_row
343
345
  cur_row = {}
344
346
  entry_index = 0
345
347
  i = i + 3
346
348
 
347
- elsif str[i] == '"'
349
+ elsif c == '"'
348
350
 
349
351
  i = i + 1
350
352
  nextIndex = str.index('"', i)
351
353
 
352
354
  while str[nextIndex - 1] == '\\'
355
+
356
+ j = 1
357
+ while str[nextIndex - j] == '\\'
358
+ j = j + 1
359
+ end
360
+
361
+ if j & 1 == 1
362
+ break
363
+ end
364
+
353
365
  nextIndex = str.index('"', nextIndex + 1)
366
+
354
367
  end
355
368
 
356
369
  cur_row[fields[entry_index]] = api_convert_type(str[i...nextIndex], types[entry_index])
357
370
  entry_index = entry_index + 1
358
371
 
359
372
  i = nextIndex + 1
373
+
360
374
  else
361
375
 
362
- if str[i] == ','
376
+ if c == ','
363
377
  i = i + 1
364
378
  end
379
+
365
380
  parensIndex = str.index(')', i)
366
381
  nextIndex = str.index(',', i)
367
382
 
@@ -394,6 +409,7 @@ class FastAPI
394
409
 
395
410
  end
396
411
 
412
+
397
413
  def api_comparison(comparator, value)
398
414
 
399
415
  if comparator == 'is'
@@ -595,7 +611,7 @@ class FastAPI
595
611
  if model.nil? and self_obj.reflect_on_all_associations(:has_many).map(&:name).include? key
596
612
 
597
613
  filter_result = parse_filters(value, safe, field.singularize.classify.constantize)
598
- # logger.info filter_result
614
+ # puts filter_result
599
615
  filter_has_many[key] = filter_result[:main]
600
616
  order_has_many[key] = filter_result[:main_order]
601
617
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Keith Horwood
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-24 00:00:00.000000000 Z
11
+ date: 2014-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oj