surikat 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ece53ccac4f047a703b0ece88e5085256835d66c
4
- data.tar.gz: fb1405586935ed6bdc2dc8eacceb2e919c3cd79f
3
+ metadata.gz: e7194b79492a3dc3f0ddfb1eab9f8c9df28a7e5f
4
+ data.tar.gz: 58a608261a1f0f878c82c53e0a50bf57eb3ee0a4
5
5
  SHA512:
6
- metadata.gz: 599959a8136c265f358c9f856d07b3cc7043de6ad423bccc8d5625450d60de5a7cea2b058c806c0ba79e143df0bd9016b7901570e01b9c0792a013f83a800fb2
7
- data.tar.gz: ab2f7771abeaef70a3cb895c8f306457812acbb58ea02db8c13a2e462b6cce00a459045d01e58c6c8578ab4d2070da78e00a4c06f360112e7a044e82fefb4814
6
+ metadata.gz: 9007fdd4f64f21132b6af005d4cfcb304e83b8939d71a6ee1232633a84cda3701513461ff2fed983cc26dad4b1628b3ed77c3c51c5f875c7ceb0c330f5b9fcc8
7
+ data.tar.gz: afeaac0a5e2c5bf024d211a312cc77eec285b35f9f0e47b8a02f7e9c92fba3f300ba9f55bcc4db3baee21416464496e47b48511b63d268a89045940176855540
data/.idea/workspace.xml CHANGED
@@ -3,14 +3,7 @@
3
3
  <component name="ChangeListManager">
4
4
  <list default="true" id="66400b9f-bfb7-48ab-a1ab-331b1d21e8c6" name="Default" comment="">
5
5
  <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
6
- <change beforePath="$PROJECT_DIR$/bin/console" beforeDir="false" afterPath="$PROJECT_DIR$/bin/console" afterDir="false" />
7
- <change beforePath="$PROJECT_DIR$/exe/surikat" beforeDir="false" afterPath="$PROJECT_DIR$/exe/surikat" afterDir="false" />
8
- <change beforePath="$PROJECT_DIR$/lib/surikat.rb" beforeDir="false" afterPath="$PROJECT_DIR$/lib/surikat.rb" afterDir="false" />
9
- <change beforePath="$PROJECT_DIR$/lib/surikat/base_model.rb" beforeDir="false" afterPath="$PROJECT_DIR$/lib/surikat/base_model.rb" afterDir="false" />
10
- <change beforePath="$PROJECT_DIR$/lib/surikat/templates/base_spec.rb.tmpl" beforeDir="false" afterPath="$PROJECT_DIR$/lib/surikat/templates/base_spec.rb.tmpl" afterDir="false" />
11
- <change beforePath="$PROJECT_DIR$/lib/surikat/templates/console.tmpl" beforeDir="false" afterPath="$PROJECT_DIR$/lib/surikat/templates/console.tmpl" afterDir="false" />
12
- <change beforePath="$PROJECT_DIR$/lib/surikat/version.rb" beforeDir="false" afterPath="$PROJECT_DIR$/lib/surikat/version.rb" afterDir="false" />
13
- <change beforePath="$PROJECT_DIR$/surikat-0.2.2.gem" beforeDir="false" afterPath="$PROJECT_DIR$/surikat-0.2.2.gem" afterDir="false" />
6
+ <change beforePath="$PROJECT_DIR$/surikat.gemspec" beforeDir="false" afterPath="$PROJECT_DIR$/surikat.gemspec" afterDir="false" />
14
7
  </list>
15
8
  <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
16
9
  <option name="TRACKING_ENABLED" value="true" />
@@ -24,8 +17,8 @@
24
17
  <file leaf-file-name="TODO" pinned="true" current-in-tab="false">
25
18
  <entry file="file://$PROJECT_DIR$/TODO">
26
19
  <provider selected="true" editor-type-id="text-editor">
27
- <state relative-caret-position="34">
28
- <caret line="2" column="22" selection-start-line="2" selection-start-column="22" selection-end-line="2" selection-end-column="22" />
20
+ <state relative-caret-position="476">
21
+ <caret line="28" column="74" selection-start-line="28" selection-start-column="74" selection-end-line="28" selection-end-column="74" />
29
22
  </state>
30
23
  </provider>
31
24
  </entry>
@@ -34,14 +27,23 @@
34
27
  <entry file="file://$PROJECT_DIR$/README.md">
35
28
  <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
36
29
  <state split_layout="SPLIT">
37
- <first_editor relative-caret-position="532">
38
- <caret line="384" column="10" selection-start-line="384" selection-start-column="10" selection-end-line="384" selection-end-column="10" />
30
+ <first_editor relative-caret-position="17">
31
+ <caret line="189" column="4" selection-start-line="189" selection-start-column="4" selection-end-line="189" selection-end-column="4" />
39
32
  </first_editor>
40
33
  <second_editor />
41
34
  </state>
42
35
  </provider>
43
36
  </entry>
44
37
  </file>
38
+ <file leaf-file-name="session_manager.rb" pinned="false" current-in-tab="false">
39
+ <entry file="file://$PROJECT_DIR$/lib/surikat/session_manager.rb">
40
+ <provider selected="true" editor-type-id="text-editor">
41
+ <state relative-caret-position="459">
42
+ <caret line="27" column="7" selection-start-line="27" selection-start-column="7" selection-end-line="27" selection-end-column="7" />
43
+ </state>
44
+ </provider>
45
+ </entry>
46
+ </file>
45
47
  <file leaf-file-name=".gitignore" pinned="false" current-in-tab="false">
46
48
  <entry file="file://$PROJECT_DIR$/.gitignore">
47
49
  <provider selected="true" editor-type-id="text-editor">
@@ -51,16 +53,16 @@
51
53
  </provider>
52
54
  </entry>
53
55
  </file>
54
- <file leaf-file-name="surikat.gemspec" pinned="false" current-in-tab="false">
56
+ <file leaf-file-name="surikat.gemspec" pinned="false" current-in-tab="true">
55
57
  <entry file="file://$PROJECT_DIR$/surikat.gemspec">
56
58
  <provider selected="true" editor-type-id="text-editor">
57
- <state relative-caret-position="833">
58
- <caret line="54" column="50" selection-start-line="54" selection-start-column="50" selection-end-line="54" selection-end-column="50" />
59
+ <state relative-caret-position="578">
60
+ <caret line="39" column="2" selection-start-line="39" selection-start-column="2" selection-end-line="39" selection-end-column="2" />
59
61
  </state>
60
62
  </provider>
61
63
  </entry>
62
64
  </file>
63
- <file leaf-file-name="version.rb" pinned="false" current-in-tab="true">
65
+ <file leaf-file-name="version.rb" pinned="false" current-in-tab="false">
64
66
  <entry file="file://$PROJECT_DIR$/lib/surikat/version.rb">
65
67
  <provider selected="true" editor-type-id="text-editor">
66
68
  <state relative-caret-position="17">
@@ -72,8 +74,13 @@
72
74
  <file leaf-file-name="surikat.rb" pinned="false" current-in-tab="false">
73
75
  <entry file="file://$PROJECT_DIR$/lib/surikat.rb">
74
76
  <provider selected="true" editor-type-id="text-editor">
75
- <state relative-caret-position="51">
76
- <caret line="3" column="15" selection-start-line="3" selection-start-column="15" selection-end-line="3" selection-end-column="15" />
77
+ <state relative-caret-position="381">
78
+ <caret line="81" lean-forward="true" selection-start-line="81" selection-end-line="81" />
79
+ <folding>
80
+ <element signature="e#2343#9042#0" />
81
+ <element signature="e#9048#9302#0" />
82
+ <element signature="e#9308#10900#0" />
83
+ </folding>
77
84
  </state>
78
85
  </provider>
79
86
  </entry>
@@ -94,9 +101,6 @@
94
101
  </component>
95
102
  <component name="FindInProjectRecents">
96
103
  <findStrings>
97
- <find>database.</find>
98
- <find>yaml_config</find>
99
- <find>.config</find>
100
104
  <find>surikat_ses</find>
101
105
  <find>app:</find>
102
106
  <find>columns_new_</find>
@@ -124,6 +128,9 @@
124
128
  <find>puts 71</find>
125
129
  <find>puts 'eee</find>
126
130
  <find>Author</find>
131
+ <find>puts</find>
132
+ <find>1</find>
133
+ <find>unknown</find>
127
134
  </findStrings>
128
135
  <replaceStrings>
129
136
  <replace>@@routes</replace>
@@ -172,24 +179,24 @@
172
179
  <option value="$PROJECT_DIR$/lib/surikat/templates/routes.yml.tmpl" />
173
180
  <option value="$PROJECT_DIR$/lib/surikat/templates/application.yml.tmpl" />
174
181
  <option value="$PROJECT_DIR$/lib/surikat/session.rb" />
175
- <option value="$PROJECT_DIR$/lib/surikat/session_manager.rb" />
176
182
  <option value="$PROJECT_DIR$/lib/surikat/scaffold.rb" />
177
183
  <option value="$PROJECT_DIR$/lib/surikat/new_app.rb" />
178
184
  <option value="$PROJECT_DIR$/lib/surikat/templates/test_helper.rb.tmpl" />
179
185
  <option value="$PROJECT_DIR$/lib/surikat/templates/crud_queries.rb.tmpl" />
180
186
  <option value="$PROJECT_DIR$/lib/surikat/templates/database.yml.tmpl" />
181
187
  <option value="$PROJECT_DIR$/lib/surikat/templates/config.ru.tmpl" />
182
- <option value="$PROJECT_DIR$/TODO" />
183
188
  <option value="$PROJECT_DIR$/.gitignore" />
184
- <option value="$PROJECT_DIR$/README.md" />
185
- <option value="$PROJECT_DIR$/surikat.gemspec" />
186
189
  <option value="$PROJECT_DIR$/bin/console" />
187
190
  <option value="$PROJECT_DIR$/lib/surikat/templates/console.tmpl" />
188
191
  <option value="$PROJECT_DIR$/exe/surikat" />
189
- <option value="$PROJECT_DIR$/lib/surikat.rb" />
190
192
  <option value="$PROJECT_DIR$/lib/surikat/base_model.rb" />
191
193
  <option value="$PROJECT_DIR$/lib/surikat/templates/base_spec.rb.tmpl" />
194
+ <option value="$PROJECT_DIR$/lib/surikat/session_manager.rb" />
195
+ <option value="$PROJECT_DIR$/README.md" />
196
+ <option value="$PROJECT_DIR$/TODO" />
197
+ <option value="$PROJECT_DIR$/lib/surikat.rb" />
192
198
  <option value="$PROJECT_DIR$/lib/surikat/version.rb" />
199
+ <option value="$PROJECT_DIR$/surikat.gemspec" />
193
200
  </list>
194
201
  </option>
195
202
  </component>
@@ -264,7 +271,7 @@
264
271
  </component>
265
272
  <component name="PropertiesComponent">
266
273
  <property name="RakeTaksPopup.undocumentedIncluded" value="false" />
267
- <property name="SearchEverywhereHistoryKey" value="diagram&#9;ACTION&#9;ShowUmlDiagram&#10;highlight&#9;ACTION&#9;HighlightUsagesInFile&#10;list&#9;null&#9;null&#10;list_ty&#9;FILE&#9;file:///Users/alxx/.rvm/gems/ruby-2.4.1/gems/graphql-1.7.7/lib/graphql/list_type.rb&#10;generate_t&#9;null&#9;null&#10;generate_aaa&#9;null&#9;null&#10;exempl&#9;null&#9;null&#10;scaf&#9;FILE&#9;file:///Users/alxx/Projects/surikat/lib/surikat/scaffold.rb&#10;new_a&#9;FILE&#9;file:///Users/alxx/Projects/surikat/lib/surikat/new_app.rb&#10;scaff&#9;FILE&#9;file:///Users/alxx/Projects/surikat/lib/surikat/scaffold.rb" />
274
+ <property name="SearchEverywhereHistoryKey" value="session_ma&#9;FILE&#9;file:///Users/alxx/Projects/surikat/lib/surikat/session_manager.rb&#10;diagram&#9;ACTION&#9;ShowUmlDiagram&#10;highlight&#9;ACTION&#9;HighlightUsagesInFile&#10;list&#9;null&#9;null&#10;list_ty&#9;FILE&#9;file:///Users/alxx/.rvm/gems/ruby-2.4.1/gems/graphql-1.7.7/lib/graphql/list_type.rb&#10;generate_t&#9;null&#9;null&#10;generate_aaa&#9;null&#9;null&#10;exempl&#9;null&#9;null&#10;scaf&#9;FILE&#9;file:///Users/alxx/Projects/surikat/lib/surikat/scaffold.rb&#10;new_a&#9;FILE&#9;file:///Users/alxx/Projects/surikat/lib/surikat/new_app.rb&#10;scaff&#9;FILE&#9;file:///Users/alxx/Projects/surikat/lib/surikat/scaffold.rb" />
268
275
  <property name="WebServerToolWindowFactoryState" value="false" />
269
276
  <property name="nodejs_interpreter_path.stuck_in_default_project" value="/usr/local/bin/node" />
270
277
  <property name="nodejs_npm_path_reset_for_default_project" value="true" />
@@ -304,7 +311,8 @@
304
311
  <workItem from="1526473553950" duration="20600000" />
305
312
  <workItem from="1527061061177" duration="45000" />
306
313
  <workItem from="1527080050867" duration="68864000" />
307
- <workItem from="1527681663233" duration="13661000" />
314
+ <workItem from="1527681663233" duration="14504000" />
315
+ <workItem from="1528216280645" duration="1564000" />
308
316
  </task>
309
317
  <task id="LOCAL-00001" summary="no gem">
310
318
  <created>1527697580402</created>
@@ -362,11 +370,53 @@
362
370
  <option name="project" value="LOCAL" />
363
371
  <updated>1527705324011</updated>
364
372
  </task>
365
- <option name="localTasksCounter" value="9" />
373
+ <task id="LOCAL-00009" summary="fixed gem dependency issues and a scaffold templating issue">
374
+ <created>1527709554306</created>
375
+ <option name="number" value="00009" />
376
+ <option name="presentableId" value="LOCAL-00009" />
377
+ <option name="project" value="LOCAL" />
378
+ <updated>1527709554306</updated>
379
+ </task>
380
+ <task id="LOCAL-00010" summary="doc fix">
381
+ <created>1527709738220</created>
382
+ <option name="number" value="00010" />
383
+ <option name="presentableId" value="LOCAL-00010" />
384
+ <option name="project" value="LOCAL" />
385
+ <updated>1527709738220</updated>
386
+ </task>
387
+ <task id="LOCAL-00011" summary="doc fix">
388
+ <created>1527709744308</created>
389
+ <option name="number" value="00011" />
390
+ <option name="presentableId" value="LOCAL-00011" />
391
+ <option name="project" value="LOCAL" />
392
+ <updated>1527709744308</updated>
393
+ </task>
394
+ <task id="LOCAL-00012" summary="doc fix">
395
+ <created>1527709982180</created>
396
+ <option name="number" value="00012" />
397
+ <option name="presentableId" value="LOCAL-00012" />
398
+ <option name="project" value="LOCAL" />
399
+ <updated>1527709982180</updated>
400
+ </task>
401
+ <task id="LOCAL-00013" summary="fixed casting of custom types">
402
+ <created>1528217781986</created>
403
+ <option name="number" value="00013" />
404
+ <option name="presentableId" value="LOCAL-00013" />
405
+ <option name="project" value="LOCAL" />
406
+ <updated>1528217781986</updated>
407
+ </task>
408
+ <task id="LOCAL-00014" summary="increased version to 0.2.4">
409
+ <created>1528217824781</created>
410
+ <option name="number" value="00014" />
411
+ <option name="presentableId" value="LOCAL-00014" />
412
+ <option name="project" value="LOCAL" />
413
+ <updated>1528217824781</updated>
414
+ </task>
415
+ <option name="localTasksCounter" value="15" />
366
416
  <servers />
367
417
  </component>
368
418
  <component name="TimeTrackingManager">
369
- <option name="totallyTimeSpent" value="126617000" />
419
+ <option name="totallyTimeSpent" value="129024000" />
370
420
  </component>
371
421
  <component name="TodoView">
372
422
  <todo-panel id="selected-file">
@@ -388,10 +438,10 @@
388
438
  <window_info anchor="bottom" id="Version Control" order="10" />
389
439
  <window_info anchor="right" id="Mongo Explorer" order="3" />
390
440
  <window_info anchor="bottom" id="Terminal" order="8" />
391
- <window_info active="true" content_ui="combo" id="Project" order="0" sideWeight="0.49306297" visible="true" weight="0.2512182" />
441
+ <window_info active="true" content_ui="combo" id="Project" order="0" sideWeight="0.49199572" visible="true" weight="0.2512182" />
392
442
  <window_info anchor="right" id="Database" order="4" />
393
443
  <window_info anchor="bottom" id="Find" order="1" weight="0.32977587" />
394
- <window_info id="Structure" order="1" sideWeight="0.506937" side_tool="true" visible="true" weight="0.2512182" />
444
+ <window_info id="Structure" order="1" sideWeight="0.50800425" side_tool="true" visible="true" weight="0.2512182" />
395
445
  <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
396
446
  <window_info id="Favorites" order="2" side_tool="true" />
397
447
  <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
@@ -416,11 +466,15 @@
416
466
  <MESSAGE value="fixed .gemspec" />
417
467
  <MESSAGE value="runtime deps" />
418
468
  <MESSAGE value="fixed issues with fresh project" />
419
- <option name="LAST_COMMIT_MESSAGE" value="fixed issues with fresh project" />
469
+ <MESSAGE value="fixed gem dependency issues and a scaffold templating issue" />
470
+ <MESSAGE value="doc fix" />
471
+ <MESSAGE value="fixed casting of custom types" />
472
+ <MESSAGE value="increased version to 0.2.4" />
473
+ <option name="LAST_COMMIT_MESSAGE" value="increased version to 0.2.4" />
420
474
  </component>
421
475
  <component name="XDebuggerManager">
422
476
  <breakpoint-manager>
423
- <option name="time" value="3" />
477
+ <option name="time" value="4" />
424
478
  </breakpoint-manager>
425
479
  </component>
426
480
  <component name="editorHistoryManager">
@@ -573,13 +627,6 @@
573
627
  </state>
574
628
  </provider>
575
629
  </entry>
576
- <entry file="file://$PROJECT_DIR$/lib/surikat/session_manager.rb">
577
- <provider selected="true" editor-type-id="text-editor">
578
- <state relative-caret-position="338">
579
- <caret line="57" column="26" selection-start-line="57" selection-start-column="26" selection-end-line="57" selection-end-column="26" />
580
- </state>
581
- </provider>
582
- </entry>
583
630
  <entry file="file://$PROJECT_DIR$/lib/surikat/session.rb">
584
631
  <provider selected="true" editor-type-id="text-editor">
585
632
  <state relative-caret-position="306">
@@ -635,13 +682,6 @@
635
682
  </state>
636
683
  </provider>
637
684
  </entry>
638
- <entry file="file://$PROJECT_DIR$/TODO">
639
- <provider selected="true" editor-type-id="text-editor">
640
- <state relative-caret-position="34">
641
- <caret line="2" column="22" selection-start-line="2" selection-start-column="22" selection-end-line="2" selection-end-column="22" />
642
- </state>
643
- </provider>
644
- </entry>
645
685
  <entry file="file://$PROJECT_DIR$/lib/surikat/templates/config.ru.tmpl">
646
686
  <provider selected="true" editor-type-id="text-editor">
647
687
  <state relative-caret-position="116">
@@ -656,16 +696,6 @@
656
696
  </state>
657
697
  </provider>
658
698
  </entry>
659
- <entry file="file://$PROJECT_DIR$/README.md">
660
- <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
661
- <state split_layout="SPLIT">
662
- <first_editor relative-caret-position="532">
663
- <caret line="384" column="10" selection-start-line="384" selection-start-column="10" selection-end-line="384" selection-end-column="10" />
664
- </first_editor>
665
- <second_editor />
666
- </state>
667
- </provider>
668
- </entry>
669
699
  <entry file="file://$PROJECT_DIR$/lib/surikat/base_queries.rb">
670
700
  <provider selected="true" editor-type-id="text-editor">
671
701
  <state relative-caret-position="119">
@@ -1142,11 +1172,12 @@
1142
1172
  <point x="0.0" y="14.5" />
1143
1173
  </edge>
1144
1174
  </edges>
1145
- <settings layout="Hierarchic Group" zoom="0.8590062111801242" x="269.3926247288503" y="123.01626898047715" />
1175
+ <settings layout="Hierarchic Group" zoom="0.8590062111801242" x="269.0" y="123.0" />
1146
1176
  <SelectedNodes>
1147
1177
  <node>activemodel</node>
1148
1178
  </SelectedNodes>
1149
1179
  <Categories />
1180
+ <SCOPE>All</SCOPE>
1150
1181
  </state>
1151
1182
  </provider>
1152
1183
  </entry>
@@ -1178,20 +1209,42 @@
1178
1209
  </state>
1179
1210
  </provider>
1180
1211
  </entry>
1181
- <entry file="file://$PROJECT_DIR$/lib/surikat.rb">
1212
+ <entry file="file://$PROJECT_DIR$/lib/surikat/base_model.rb">
1213
+ <provider selected="true" editor-type-id="text-editor" />
1214
+ </entry>
1215
+ <entry file="file://$PROJECT_DIR$/lib/surikat/session_manager.rb">
1182
1216
  <provider selected="true" editor-type-id="text-editor">
1183
- <state relative-caret-position="51">
1184
- <caret line="3" column="15" selection-start-line="3" selection-start-column="15" selection-end-line="3" selection-end-column="15" />
1217
+ <state relative-caret-position="459">
1218
+ <caret line="27" column="7" selection-start-line="27" selection-start-column="7" selection-end-line="27" selection-end-column="7" />
1185
1219
  </state>
1186
1220
  </provider>
1187
1221
  </entry>
1188
- <entry file="file://$PROJECT_DIR$/lib/surikat/base_model.rb">
1189
- <provider selected="true" editor-type-id="text-editor" />
1222
+ <entry file="file://$PROJECT_DIR$/README.md">
1223
+ <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
1224
+ <state split_layout="SPLIT">
1225
+ <first_editor relative-caret-position="17">
1226
+ <caret line="189" column="4" selection-start-line="189" selection-start-column="4" selection-end-line="189" selection-end-column="4" />
1227
+ </first_editor>
1228
+ <second_editor />
1229
+ </state>
1230
+ </provider>
1190
1231
  </entry>
1191
- <entry file="file://$PROJECT_DIR$/surikat.gemspec">
1232
+ <entry file="file://$PROJECT_DIR$/TODO">
1233
+ <provider selected="true" editor-type-id="text-editor">
1234
+ <state relative-caret-position="476">
1235
+ <caret line="28" column="74" selection-start-line="28" selection-start-column="74" selection-end-line="28" selection-end-column="74" />
1236
+ </state>
1237
+ </provider>
1238
+ </entry>
1239
+ <entry file="file://$PROJECT_DIR$/lib/surikat.rb">
1192
1240
  <provider selected="true" editor-type-id="text-editor">
1193
- <state relative-caret-position="833">
1194
- <caret line="54" column="50" selection-start-line="54" selection-start-column="50" selection-end-line="54" selection-end-column="50" />
1241
+ <state relative-caret-position="381">
1242
+ <caret line="81" lean-forward="true" selection-start-line="81" selection-end-line="81" />
1243
+ <folding>
1244
+ <element signature="e#2343#9042#0" />
1245
+ <element signature="e#9048#9302#0" />
1246
+ <element signature="e#9308#10900#0" />
1247
+ </folding>
1195
1248
  </state>
1196
1249
  </provider>
1197
1250
  </entry>
@@ -1202,5 +1255,12 @@
1202
1255
  </state>
1203
1256
  </provider>
1204
1257
  </entry>
1258
+ <entry file="file://$PROJECT_DIR$/surikat.gemspec">
1259
+ <provider selected="true" editor-type-id="text-editor">
1260
+ <state relative-caret-position="578">
1261
+ <caret line="39" column="2" selection-start-line="39" selection-start-column="2" selection-end-line="39" selection-end-column="2" />
1262
+ </state>
1263
+ </provider>
1264
+ </entry>
1205
1265
  </component>
1206
1266
  </project>
data/README.md CHANGED
@@ -148,61 +148,80 @@ Example:
148
148
  surikat generate model Book title:string
149
149
  ```
150
150
 
151
- ### Custom Data
152
-
153
- Sometimes you need to supply for the frontend things that don't come directly from the database.
154
- In fact, you can send anything you want; here are a few simple recipes:
155
-
156
- 1 To add an additional field to the ones already provided by the database, the easiest way
157
- is to define a method in the model.
158
-
159
- ```ruby
160
- class Person < Surikat::BaseModel
161
- def favourite_number
162
- rand(10)
163
- end
164
- end
165
- ```
166
-
167
- Then, you can add `favourite_number` into the `Author` output type, and you're set.
168
-
169
- 2 If you need this field to have arguments:
151
+ #### A Note About Ransack
170
152
 
171
- ```ruby
172
- class Person < Surikat::BaseModel
173
- def square(num)
174
- num * num
175
- end
176
- end
177
- ```
153
+ Surikat comes with Ransack, so that when you retrieve a collection of ActiveRecord objects, you can
154
+ already filter and sort them using [Ransack search matchers](https://github.com/activerecord-hackery/ransack#search-matchers).
178
155
 
179
- And in the query:
156
+ Example query:
180
157
 
181
158
  ```graphql
182
- {
183
- Person(id: 1) {
184
- square(num: 5)
159
+ {
160
+ Authors(q: "is_any_good_eq=false&id_lt=20 ") {
161
+ id
162
+ name
163
+ created_at
164
+ is_any_good
165
+ year_of_birth
185
166
  }
186
167
  }
187
168
  ```
188
169
 
189
- 3 Returning custom types is also easy. If you have an output type that defines the fields
190
- `favourite_food` and `favourite_drink`, all your query needs to do is to return a Ruby `Hash`
191
- that has those two keys.
170
+ ### Custom Data
192
171
 
193
- ```ruby
194
- class MyQueries < Surikat::BaseQueries
195
- def favourite_stuff
172
+ Sometimes you need to supply for the frontend things that don't come directly from the database.
173
+ In fact, you can send anything you want; here are a few simple recipes:
174
+
175
+ 1. To add an additional field to the ones already provided by the database, the easiest way
176
+ is to define a method in the model.
177
+
178
+ ```ruby
179
+ class Person < Surikat::BaseModel
180
+ def favourite_number
181
+ rand(10)
182
+ end
183
+ end
184
+ ```
185
+
186
+ Then, you can add `favourite_number` into the `Author` output type, and you're set.
187
+
188
+ 2. If you need this field to have arguments:
189
+
190
+ ```ruby
191
+ class Person < Surikat::BaseModel
192
+ def square(num)
193
+ num * num
194
+ end
195
+ end
196
+ ```
197
+
198
+ And in the query:
199
+
200
+ ```graphql
196
201
  {
197
- favourite_food: 'air',
198
- favourite_drink: 'water'
202
+ Person(id: 1) {
203
+ square(num: 5)
204
+ }
199
205
  }
200
- end
201
- end
202
- ```
206
+ ```
207
+
208
+ 3. Returning custom types is also easy. If you have an output type that defines the fields
209
+ `favourite_food` and `favourite_drink`, all your query needs to do is to return a Ruby `Hash`
210
+ that has those two keys.
203
211
 
204
- This works for arrays, too. You can return an array of such objects, and use them
205
- in your output types using the brackets notation, for example `[FavouriteStuffType]`.
212
+ ```ruby
213
+ class MyQueries < Surikat::BaseQueries
214
+ def favourite_stuff
215
+ {
216
+ favourite_food: 'air',
217
+ favourite_drink: 'water'
218
+ }
219
+ end
220
+ end
221
+ ```
222
+
223
+ This works for arrays, too. You can return an array of such objects, and use them
224
+ in your output types using the brackets notation, for example `[FavouriteStuffType]`.
206
225
 
207
226
  #### Errors
208
227
 
@@ -354,7 +373,7 @@ come with a solution to this issue. Until then, you have to adapt the tests to y
354
373
 
355
374
  ### Web Server
356
375
 
357
- Surikat uses (Phusion Passenger)[https://www.phusionpassenger.com/] as a web server. Simply type
376
+ Surikat uses [Phusion Passenger](https://www.phusionpassenger.com/) as a web server. Simply type
358
377
 
359
378
  ```bash
360
379
  passenger serve
@@ -363,25 +382,6 @@ passenger serve
363
382
  to start a server on port 3000. Then you can use GraphiQL, curl or your actual frontend app to start
364
383
  querying the backend.
365
384
 
366
- #### A Note About Ransack
367
-
368
- Surikat comes with Ransack, so that when you retrieve a collection of ActiveRecord objects, you can
369
- already filter and sort them using [Ransack search matchers](https://github.com/activerecord-hackery/ransack#search-matchers).
370
-
371
- Example query:
372
-
373
- ```graphql
374
- {
375
- Authors(q: "is_any_good_eq=false&id_lt=20 ") {
376
- id
377
- name
378
- created_at
379
- is_any_good
380
- year_of_birth
381
- }
382
- }
383
- ```
384
-
385
385
  ## System Dependencies
386
386
 
387
387
  For improved performance, Surikat uses a C++ library to parse GraplQL queries, [libgraphqlparser](https://github.com/graphql/libgraphqlparser).
data/lib/surikat.rb CHANGED
@@ -67,10 +67,36 @@ module Surikat
67
67
 
68
68
  if is_array
69
69
  raise "List of data of type #{type_name} in field '#{field_name}' may not contain nil values" if type_name.include?('!') && data.include?(nil)
70
- result = data.to_a.map {|x| cast_scalar(x, type_singular_nobang)}
70
+ result = data.to_a.map do |x|
71
+ if Types::BASIC.include? type_singular_nobang
72
+ cast_scalar(x, type_singular_nobang)
73
+ else
74
+ r = {}
75
+ type = Surikat.types[type_singular_nobang]
76
+ allowed_fields = x.keys & type['fields'].keys
77
+ allowed_fields.each do |af|
78
+ type_name = type['fields'][af]
79
+
80
+ r[af] = cast(x[af], type_name, type_name.first == '[', af)
81
+ end
82
+
83
+ r
84
+ end
85
+ end
71
86
  else
72
87
  raise "Data of type #{type_name} for field '#{field_name}' may not be nil" if type_name.last == '!' && data.nil?
73
- result = cast_scalar(data, type_singular_nobang)
88
+
89
+ if Types::BASIC.include? type_singular_nobang
90
+ result = cast_scalar(data, type_singular_nobang)
91
+ else
92
+ result = {}
93
+ type = Surikat.types[type_singular_nobang]
94
+ allowed_fields = data.keys & type['fields'].keys
95
+ allowed_fields.each do |af|
96
+ type_name = type['fields'][af]
97
+ result[af] = cast(data[af], type_name, type_name.first == '[', af)
98
+ end
99
+ end
74
100
  end
75
101
  result
76
102
  end
@@ -161,6 +187,7 @@ module Surikat
161
187
  end
162
188
 
163
189
  deep_selectors.each do |s|
190
+ data = data.first if data.class.to_s.include?('ActiveRecord_Relation')
164
191
  uncast = data.is_a?(Hash) ? (data[s.name] || data[s.name.to_sym]) : hashify(data.send(s.name), s.selections, fields[s.name])
165
192
  hashified_data[s.name] = cast(uncast, fields[s.name], uncast.is_a?(Array), s.name)
166
193
  end
@@ -27,12 +27,6 @@ module Surikat
27
27
  end
28
28
  end
29
29
 
30
- # def create
31
- # key = SecureRandom.hex(30)
32
- # merge! key, {created_at: Time.now}
33
- # key
34
- # end
35
-
36
30
  def merge!(key, hash)
37
31
  return if key.nil?
38
32
 
@@ -1,3 +1,3 @@
1
1
  module Surikat
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
data/surikat.gemspec CHANGED
@@ -32,14 +32,14 @@ Gem::Specification.new do |spec|
32
32
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
33
33
  spec.require_paths = ["lib"]
34
34
 
35
- spec.add_development_dependency "bundler", "~> 1.15"
35
+ # spec.add_development_dependency "bundler", "~> 1.15"
36
36
  #spec.add_development_dependency "rake", "~> 10.0"
37
- spec.add_development_dependency "rspec", "~> 3.0"
37
+ #spec.add_development_dependency "rspec", "~> 3.0"
38
38
  spec.add_development_dependency "pry", "~> 0.10"
39
39
 
40
- spec.add_development_dependency "activesupport", "~> 5.2", ">= 5.2.0"
41
- spec.add_development_dependency "graphql-libgraphqlparser", "~> 1.2", ">= 1.2.0"
42
- spec.add_development_dependency "oj", "~> 3.3", ">= 3.3.5"
40
+ # spec.add_development_dependency "activesupport", "~> 5.2", ">= 5.2.0"
41
+ # spec.add_development_dependency "graphql-libgraphqlparser", "~> 1.2", ">= 1.2.0"
42
+ # spec.add_development_dependency "oj", "~> 3.3", ">= 3.3.5"
43
43
  # spec.add_development_dependency "standalone_migrations", "~> 5.2", ">= 5.2.5"
44
44
  # spec.add_development_dependency "ransack", "~> 1.8", ">= 1.8.2"
45
45
 
metadata CHANGED
@@ -1,43 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: surikat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Deva
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-05-30 00:00:00.000000000 Z
11
+ date: 2018-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: bundler
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '1.15'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '1.15'
27
- - !ruby/object:Gem::Dependency
28
- name: rspec
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '3.0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '3.0'
41
13
  - !ruby/object:Gem::Dependency
42
14
  name: pry
43
15
  requirement: !ruby/object:Gem::Requirement
@@ -52,66 +24,6 @@ dependencies:
52
24
  - - "~>"
53
25
  - !ruby/object:Gem::Version
54
26
  version: '0.10'
55
- - !ruby/object:Gem::Dependency
56
- name: activesupport
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '5.2'
62
- - - ">="
63
- - !ruby/object:Gem::Version
64
- version: 5.2.0
65
- type: :development
66
- prerelease: false
67
- version_requirements: !ruby/object:Gem::Requirement
68
- requirements:
69
- - - "~>"
70
- - !ruby/object:Gem::Version
71
- version: '5.2'
72
- - - ">="
73
- - !ruby/object:Gem::Version
74
- version: 5.2.0
75
- - !ruby/object:Gem::Dependency
76
- name: graphql-libgraphqlparser
77
- requirement: !ruby/object:Gem::Requirement
78
- requirements:
79
- - - "~>"
80
- - !ruby/object:Gem::Version
81
- version: '1.2'
82
- - - ">="
83
- - !ruby/object:Gem::Version
84
- version: 1.2.0
85
- type: :development
86
- prerelease: false
87
- version_requirements: !ruby/object:Gem::Requirement
88
- requirements:
89
- - - "~>"
90
- - !ruby/object:Gem::Version
91
- version: '1.2'
92
- - - ">="
93
- - !ruby/object:Gem::Version
94
- version: 1.2.0
95
- - !ruby/object:Gem::Dependency
96
- name: oj
97
- requirement: !ruby/object:Gem::Requirement
98
- requirements:
99
- - - "~>"
100
- - !ruby/object:Gem::Version
101
- version: '3.3'
102
- - - ">="
103
- - !ruby/object:Gem::Version
104
- version: 3.3.5
105
- type: :development
106
- prerelease: false
107
- version_requirements: !ruby/object:Gem::Requirement
108
- requirements:
109
- - - "~>"
110
- - !ruby/object:Gem::Version
111
- version: '3.3'
112
- - - ">="
113
- - !ruby/object:Gem::Version
114
- version: 3.3.5
115
27
  - !ruby/object:Gem::Dependency
116
28
  name: oj
117
29
  requirement: !ruby/object:Gem::Requirement