graphql-idl-parser 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (181) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +18 -1
  3. data/Rakefile +6 -4
  4. data/ext/graphql-idl-parser/graphql-idl-parser/Cargo.lock +295 -0
  5. data/ext/graphql-idl-parser/graphql-idl-parser/Cargo.toml +16 -0
  6. data/ext/graphql-idl-parser/graphql-idl-parser/LICENSE.txt +21 -0
  7. data/ext/graphql-idl-parser/graphql-idl-parser/README.md +53 -0
  8. data/ext/graphql-idl-parser/graphql-idl-parser/build.rs +5 -0
  9. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/Cargo.lock +305 -0
  10. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/Cargo.toml +18 -0
  11. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/README.md +48 -0
  12. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/example/example.c +33 -0
  13. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/includes/gql-idl-parser.h +138 -0
  14. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/src/lib.rs +128 -0
  15. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/src/types.rs +485 -0
  16. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/graphql-idl-parser-1d630313aa5d216c/build-script-build +0 -0
  17. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/graphql-idl-parser-1d630313aa5d216c/build_script_build-1d630313aa5d216c +0 -0
  18. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/graphql-idl-parser-3e27951e7158def5/build-script-build +0 -0
  19. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/graphql-idl-parser-3e27951e7158def5/build_script_build-3e27951e7158def5 +0 -0
  20. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/graphql-idl-parser-481c4176d6a6472d/output +0 -0
  21. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/graphql-idl-parser-481c4176d6a6472d/stderr +0 -0
  22. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/graphql-idl-parser-5e9a4656cd081ee1/output +0 -0
  23. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/graphql-idl-parser-5e9a4656cd081ee1/stderr +0 -0
  24. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/kernel32-sys-2b7eb293aa6c1ae8/output +0 -0
  25. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/kernel32-sys-2b7eb293aa6c1ae8/stderr +0 -0
  26. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/kernel32-sys-da175f6bc66f228c/build-script-build +0 -0
  27. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/kernel32-sys-da175f6bc66f228c/build_script_build-da175f6bc66f228c +0 -0
  28. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/lalrpop-d0f0dc8a044bb86f/build-script-build +0 -0
  29. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/lalrpop-d0f0dc8a044bb86f/build_script_build-d0f0dc8a044bb86f +0 -0
  30. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/lalrpop-db9b482018d6c515/output +0 -0
  31. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/lalrpop-db9b482018d6c515/stderr +0 -0
  32. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libaho_corasick-07ac37ff1c5ebb39.rlib +0 -0
  33. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libascii_canvas-37ba58d788f6e28b.rlib +0 -0
  34. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libatty-3d34ead0eff1f49c.rlib +0 -0
  35. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libbit_set-05034a00bed6372c.rlib +0 -0
  36. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libbit_vec-ba66b7b721a96204.rlib +0 -0
  37. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libbuild-d4f96a70b883038d.rlib +0 -0
  38. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libdiff-9cac472257fa481b.rlib +0 -0
  39. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libdocopt-5b3087b1b6e5d091.rlib +0 -0
  40. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libeither-8157fecd348c1485.rlib +0 -0
  41. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libena-b40ce2cd268672c3.rlib +0 -0
  42. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libfixedbitset-c7f65ed08cebcf3b.rlib +0 -0
  43. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libgraphql_idl_parser-38237266b2814db0.rlib +0 -0
  44. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libgraphql_idl_parser-85dc5bc4abe95968.rlib +0 -0
  45. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libgraphqlidlparser.dylib +0 -0
  46. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libitertools-8d570d6c59d3b2d0.rlib +0 -0
  47. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libkernel32-fa4855bd85e0519b.rlib +0 -0
  48. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/liblalrpop-8888f5942735b084.rlib +0 -0
  49. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/liblalrpop_intern-70b4cf4d149e3995.rlib +0 -0
  50. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/liblalrpop_snap-695e4827988eac78.rlib +0 -0
  51. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/liblalrpop_util-90bdd1a9fd691a70.rlib +0 -0
  52. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/liblazy_static-a6b1325db7ee41a1.rlib +0 -0
  53. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/liblibc-0d055c7503ac4180.rlib +0 -0
  54. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libmemchr-7e8d0bb06e3caae0.rlib +0 -0
  55. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libordermap-f92645c599568d9f.rlib +0 -0
  56. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libpetgraph-62c5b51f9db3f0c7.rlib +0 -0
  57. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libregex-5d259a9431f27ed9.rlib +0 -0
  58. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libregex_syntax-e6a16469e776d773.rlib +0 -0
  59. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/librustc_serialize-21d20a12dd90991b.rlib +0 -0
  60. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libstrsim-8e26967d29bdf2e6.rlib +0 -0
  61. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libterm-189de8985c74cf03.rlib +0 -0
  62. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libthread_local-036458f1fbee14fb.rlib +0 -0
  63. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libunicode_xid-8adffabb9e6dd184.rlib +0 -0
  64. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libunreachable-bd47b36c4e87f432.rlib +0 -0
  65. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libutf8_ranges-220e9d44a3644657.rlib +0 -0
  66. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libvoid-d761da60d30362e9.rlib +0 -0
  67. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libwinapi-753252e15931e6fc.rlib +0 -0
  68. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/libgraphqlidlparser.d +1 -0
  69. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/libgraphqlidlparser.dylib +0 -0
  70. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/clar.c +673 -0
  71. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/clar.h +161 -0
  72. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/clar/fixtures.h +54 -0
  73. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/clar/fs.h +341 -0
  74. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/clar/print.h +74 -0
  75. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/clar/sandbox.h +154 -0
  76. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/clar_test.h +19 -0
  77. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/enums.c +40 -0
  78. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/generate.py +243 -0
  79. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/helpers.c +60 -0
  80. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/helpers.h +6 -0
  81. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/input_objects.c +48 -0
  82. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/interfaces.c +41 -0
  83. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/main.c +35 -0
  84. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/objects.c +130 -0
  85. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/scalars.c +39 -0
  86. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/unions.c +38 -0
  87. data/ext/graphql-idl-parser/graphql-idl-parser/script/compile +11 -0
  88. data/ext/graphql-idl-parser/graphql-idl-parser/script/fmt +23 -0
  89. data/ext/graphql-idl-parser/graphql-idl-parser/script/test +30 -0
  90. data/ext/graphql-idl-parser/graphql-idl-parser/src/gqlidl.lalrpop +199 -0
  91. data/ext/graphql-idl-parser/graphql-idl-parser/src/gqlidl.rs +29491 -0
  92. data/ext/graphql-idl-parser/graphql-idl-parser/src/lib.rs +9 -0
  93. data/ext/graphql-idl-parser/graphql-idl-parser/src/macros.rs +61 -0
  94. data/ext/graphql-idl-parser/graphql-idl-parser/src/tests.rs +561 -0
  95. data/ext/graphql-idl-parser/graphql-idl-parser/src/type_definition.rs +404 -0
  96. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/graphql-idl-parser-0ed64d9cad312f79/output +0 -0
  97. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/graphql-idl-parser-0ed64d9cad312f79/stderr +0 -0
  98. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/graphql-idl-parser-0fa24f7f5e35d20a/build-script-build +0 -0
  99. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/graphql-idl-parser-0fa24f7f5e35d20a/build_script_build-0fa24f7f5e35d20a +0 -0
  100. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/graphql-idl-parser-0fa24f7f5e35d20a/build_script_build-0fa24f7f5e35d20a.dSYM/Contents/Info.plist +20 -0
  101. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/graphql-idl-parser-0fa24f7f5e35d20a/build_script_build-0fa24f7f5e35d20a.dSYM/Contents/Resources/DWARF/build_script_build-0fa24f7f5e35d20a +0 -0
  102. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/graphql-idl-parser-57f7e3c3ef8471d2/build-script-build +0 -0
  103. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/graphql-idl-parser-57f7e3c3ef8471d2/build_script_build-57f7e3c3ef8471d2 +0 -0
  104. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/graphql-idl-parser-57f7e3c3ef8471d2/build_script_build-57f7e3c3ef8471d2.dSYM/Contents/Info.plist +20 -0
  105. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/graphql-idl-parser-57f7e3c3ef8471d2/build_script_build-57f7e3c3ef8471d2.dSYM/Contents/Resources/DWARF/build_script_build-57f7e3c3ef8471d2 +0 -0
  106. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/graphql-idl-parser-5e9a4656cd081ee1/output +0 -0
  107. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/graphql-idl-parser-5e9a4656cd081ee1/stderr +0 -0
  108. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/kernel32-sys-2b7eb293aa6c1ae8/output +0 -0
  109. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/kernel32-sys-2b7eb293aa6c1ae8/stderr +0 -0
  110. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/kernel32-sys-d2306aba19864163/build-script-build +0 -0
  111. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/kernel32-sys-d2306aba19864163/build_script_build-d2306aba19864163 +0 -0
  112. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/kernel32-sys-d2306aba19864163/build_script_build-d2306aba19864163.dSYM/Contents/Info.plist +20 -0
  113. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/kernel32-sys-d2306aba19864163/build_script_build-d2306aba19864163.dSYM/Contents/Resources/DWARF/build_script_build-d2306aba19864163 +0 -0
  114. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/lalrpop-4a05302baa5fb2a2/build-script-build +0 -0
  115. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/lalrpop-4a05302baa5fb2a2/build_script_build-4a05302baa5fb2a2 +0 -0
  116. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/lalrpop-4a05302baa5fb2a2/build_script_build-4a05302baa5fb2a2.dSYM/Contents/Info.plist +20 -0
  117. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/lalrpop-4a05302baa5fb2a2/build_script_build-4a05302baa5fb2a2.dSYM/Contents/Resources/DWARF/build_script_build-4a05302baa5fb2a2 +0 -0
  118. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/lalrpop-db9b482018d6c515/output +0 -0
  119. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/lalrpop-db9b482018d6c515/stderr +0 -0
  120. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libaho_corasick-a9ec1f95080d1f6a.rlib +0 -0
  121. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libascii_canvas-92c3bf0cf98f6d67.rlib +0 -0
  122. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libatty-35b65e46cfc403bc.rlib +0 -0
  123. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libbit_set-d9484919f1726cf1.rlib +0 -0
  124. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libbit_vec-8716b059e7c4619b.rlib +0 -0
  125. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libbuild-0b12b372edd4cd19.rlib +0 -0
  126. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libdiff-c81afd03f1d10610.rlib +0 -0
  127. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libdocopt-f02dfd6fea4878cc.rlib +0 -0
  128. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libeither-20b79fd67623dec7.rlib +0 -0
  129. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libena-e8706d9d37da725b.rlib +0 -0
  130. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libfixedbitset-da616d0027237c90.rlib +0 -0
  131. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libgraphql_idl_parser-33a4c3bdcdc654b7.rlib +0 -0
  132. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libgraphql_idl_parser-d6636cf90a34aa47.rlib +0 -0
  133. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libitertools-34d50068529acf4d.rlib +0 -0
  134. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libkernel32-56b5a11a7716f7c7.rlib +0 -0
  135. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/liblalrpop-65f3c84608c05ce1.rlib +0 -0
  136. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/liblalrpop_intern-a3c97188386c0872.rlib +0 -0
  137. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/liblalrpop_snap-d6e467def27f0a55.rlib +0 -0
  138. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/liblalrpop_util-e59e6b2e2aec1b3e.rlib +0 -0
  139. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/liblazy_static-4518bdaa60b81936.rlib +0 -0
  140. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/liblibc-ab7be4fcfaa3a31b.rlib +0 -0
  141. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libmemchr-85dd561868acc188.rlib +0 -0
  142. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libordermap-4691b832eea88398.rlib +0 -0
  143. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libpetgraph-0220c5a13678d70e.rlib +0 -0
  144. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libregex-44e22d9874a5fb64.rlib +0 -0
  145. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libregex_syntax-490c2654111b5bf0.rlib +0 -0
  146. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/librustc_serialize-a7771718d4ee73a5.rlib +0 -0
  147. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libstrsim-038156debd12bd7a.rlib +0 -0
  148. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libterm-d12b955648e4f4b4.rlib +0 -0
  149. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libthread_local-84091b6b04cf1914.rlib +0 -0
  150. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libunicode_xid-89ce822c6e6dbe69.rlib +0 -0
  151. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libunreachable-654322b1fcb434b1.rlib +0 -0
  152. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libutf8_ranges-53f91d3b6e8885c9.rlib +0 -0
  153. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libvoid-181e881e54467554.rlib +0 -0
  154. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libwinapi-9c9d2aba65add76c.rlib +0 -0
  155. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/libgraphql_idl_parser.rlib +0 -0
  156. data/ext/graphql-idl-parser/graphql-idl-parser/test/enums.graphql +8 -0
  157. data/ext/graphql-idl-parser/graphql-idl-parser/test/github.graphql +5115 -0
  158. data/ext/graphql-idl-parser/graphql-idl-parser/test/input_objects.graphql +11 -0
  159. data/ext/graphql-idl-parser/graphql-idl-parser/test/interfaces.graphql +5 -0
  160. data/ext/graphql-idl-parser/graphql-idl-parser/test/objects.graphql +54 -0
  161. data/ext/graphql-idl-parser/graphql-idl-parser/test/scalars.graphql +4 -0
  162. data/ext/graphql-idl-parser/graphql-idl-parser/test/unions.graphql +2 -0
  163. data/graphql-idl-parser.gemspec +8 -6
  164. data/lib/graphql-idl-parser/version.rb +1 -1
  165. data/test/graphql-idl-parser/enums_test.rb +20 -0
  166. data/test/graphql-idl-parser/graphql-idl-parser_test.rb +48 -0
  167. data/test/graphql-idl-parser/input_objects_test.rb +28 -0
  168. data/test/graphql-idl-parser/interfaces_test.rb +20 -0
  169. data/test/graphql-idl-parser/objects_test.rb +104 -0
  170. data/test/graphql-idl-parser/scalars_test.rb +19 -0
  171. data/test/graphql-idl-parser/unions_test.rb +18 -0
  172. data/test/test_helper.rb +12 -0
  173. metadata +194 -12
  174. data/.gitignore +0 -18
  175. data/.gitmodules +0 -4
  176. data/.rubocop.yml +0 -10
  177. data/.travis.yml +0 -28
  178. data/Gemfile +0 -4
  179. data/script/bootstrap +0 -11
  180. data/script/cibuild +0 -5
  181. data/script/update_submodules +0 -21
@@ -0,0 +1,60 @@
1
+ #include "helpers.h"
2
+ #include "clar.h"
3
+ #include <stdio.h>
4
+ #include <stdlib.h>
5
+ #include <string.h>
6
+
7
+ char *file2strl(const char *path, unsigned int *file_len_out)
8
+ {
9
+ FILE *file;
10
+
11
+ if (!(file = fopen(path, "rb"))) {
12
+ fprintf(stderr, "Unable to open file %s\n", path);
13
+ return NULL;
14
+ }
15
+
16
+ if (-1 == fseek(file, 0, SEEK_END)) {
17
+ fprintf(stderr, "Unable to seek file %s\n", path);
18
+ return NULL;
19
+ }
20
+
21
+ int file_len;
22
+ if (-1 == (file_len = ftell(file))) {
23
+ fprintf(stderr, "Unable to ftell() file %s\n", path);
24
+ return NULL;
25
+ }
26
+
27
+ if (-1 == fseek(file, 0, SEEK_SET)) {
28
+ fprintf(stderr, "Unable to seek file %s\n", path);
29
+ return NULL;
30
+ }
31
+
32
+ char *contents;
33
+ if (!(contents = malloc(file_len + 1))) {
34
+ fprintf(stderr, "Memory error!\n");
35
+ fclose(file);
36
+ return NULL;
37
+ }
38
+
39
+ fread(contents, file_len, 1, file);
40
+ fclose(file);
41
+
42
+ contents[file_len] = '\0';
43
+
44
+ if (file_len_out) {
45
+ *file_len_out = file_len + 1;
46
+ }
47
+
48
+ return contents;
49
+ }
50
+
51
+ char *file2str(const char *path)
52
+ {
53
+ return file2strl(path,NULL);
54
+ }
55
+
56
+ char * read_fixture(const char *filename)
57
+ {
58
+ const char *tex = cl_fixture(filename);
59
+ return file2str(tex);
60
+ }
@@ -0,0 +1,6 @@
1
+ #ifndef __HELPERS__
2
+ #define __HELPERS__
3
+
4
+ char * read_fixture(const char *filename);
5
+
6
+ #endif
@@ -0,0 +1,48 @@
1
+ #include "clar.h"
2
+ #include "clar_test.h"
3
+ #include <stdio.h>
4
+ #include <string.h>
5
+
6
+ static char *fixture;
7
+
8
+ void test_input_objects__initialize(void)
9
+ {
10
+ global_test_counter++;
11
+ }
12
+
13
+ void test_input_objects__cleanup(void)
14
+ {
15
+ if (fixture != NULL) {
16
+ free(fixture);
17
+ }
18
+ }
19
+
20
+ void test_input_objects__inline(void)
21
+ {
22
+ fixture = read_fixture("input_objects.graphql");
23
+
24
+ GraphQLTypes* types = NULL;
25
+ size_t types_len = 0;
26
+ uint8_t err;
27
+
28
+ err = gqlidl_parse_schema(fixture, &types, &types_len);
29
+
30
+ cl_assert_equal_i(err, 0);
31
+
32
+ cl_assert_equal_s(types[0].typename, "input_object");
33
+ cl_assert_equal_s("UpdateTopicsInput", types[0].input_object_type.name);
34
+ cl_assert_equal_s("Autogenerated input type of UpdateTopics", types[0].input_object_type.description);
35
+ cl_assert_equal_i(3, types[0].input_object_type.fields.length);
36
+ cl_assert_equal_s("clientMutationId", types[0].input_object_type.fields.data[0].name);
37
+ cl_assert_equal_s("A unique identifier for the client performing the mutation.", types[0].input_object_type.fields.data[0].description);
38
+ cl_assert_equal_s("String", types[0].input_object_type.fields.data[0].type_info.name);
39
+ cl_assert_equal_s("", types[0].input_object_type.fields.data[0].type_info.info);
40
+ cl_assert_equal_s("repositoryId", types[0].input_object_type.fields.data[1].name);
41
+ cl_assert_equal_s("The Node ID of the repository.", types[0].input_object_type.fields.data[1].description);
42
+ cl_assert_equal_s("ID", types[0].input_object_type.fields.data[1].type_info.name);
43
+ cl_assert_equal_s("!", types[0].input_object_type.fields.data[1].type_info.info);
44
+ cl_assert_equal_s("topicNames", types[0].input_object_type.fields.data[2].name);
45
+ cl_assert_equal_s("An array of topic names.", types[0].input_object_type.fields.data[2].description);
46
+ cl_assert_equal_s("String", types[0].input_object_type.fields.data[2].type_info.name);
47
+ cl_assert_equal_s("[!]!", types[0].input_object_type.fields.data[2].type_info.info);
48
+ }
@@ -0,0 +1,41 @@
1
+ #include "clar.h"
2
+ #include "clar_test.h"
3
+ #include <stdio.h>
4
+ #include <string.h>
5
+
6
+ static char *fixture;
7
+
8
+ void test_interfaces__initialize(void)
9
+ {
10
+ global_test_counter++;
11
+ }
12
+
13
+ void test_interfaces__cleanup(void)
14
+ {
15
+ if (fixture != NULL) {
16
+ free(fixture);
17
+ }
18
+ }
19
+
20
+ void test_interfaces__inline(void)
21
+ {
22
+ fixture = read_fixture("interfaces.graphql");
23
+
24
+ GraphQLTypes* types = NULL;
25
+ size_t types_len = 0;
26
+ uint8_t err;
27
+
28
+ err = gqlidl_parse_schema(fixture, &types, &types_len);
29
+
30
+ cl_assert_equal_i(err, 0);
31
+
32
+ cl_assert_equal_s(types[0].typename, "interface");
33
+ cl_assert_equal_s("Closable", types[0].interface_type.name);
34
+ cl_assert_equal_s("An object that can be closed", types[0].interface_type.description);
35
+ cl_assert_equal_i(1, types[0].interface_type.fields.length);
36
+ cl_assert_equal_s("closed", types[0].interface_type.fields.data[0].name);
37
+ cl_assert_equal_s("`true` if the object is closed (definition of closed may depend on type)", types[0].interface_type.fields.data[0].description);
38
+ cl_assert_equal_s("Boolean", types[0].interface_type.fields.data[0].type_info.name);
39
+ cl_assert_equal_s("!", types[0].interface_type.fields.data[0].type_info.info);
40
+
41
+ }
@@ -0,0 +1,35 @@
1
+ /*
2
+ * Copyright (c) Vicent Marti. All rights reserved.
3
+ *
4
+ * This file is part of clar, distributed under the ISC license.
5
+ * For full terms see the included COPYING file.
6
+ */
7
+
8
+ #include "clar_test.h"
9
+
10
+ /*
11
+ * Minimal main() for clar tests.
12
+ *
13
+ * Modify this with any application specific setup or teardown that you need.
14
+ * The only required line is the call to `clar_test(argc, argv)`, which will
15
+ * execute the test suite. If you want to check the return value of the test
16
+ * application, main() should return the same value returned by clar_test().
17
+ */
18
+
19
+ int global_test_counter = 0;
20
+
21
+ #ifdef _WIN32
22
+ int __cdecl main(int argc, char *argv[])
23
+ #else
24
+ int main(int argc, char *argv[])
25
+ #endif
26
+ {
27
+ global_test_counter = 0;
28
+
29
+ /* Run the test suite */
30
+ int ret = clar_test(argc, argv);
31
+
32
+ /* cl_assert_equal_i(3, global_test_counter); */
33
+
34
+ return ret;
35
+ }
@@ -0,0 +1,130 @@
1
+ #include "clar.h"
2
+ #include "clar_test.h"
3
+ #include <stdio.h>
4
+ #include <string.h>
5
+
6
+ static char *fixture;
7
+
8
+ void test_objects__initialize(void)
9
+ {
10
+ global_test_counter++;
11
+ }
12
+
13
+ void test_objects__cleanup(void)
14
+ {
15
+ if (fixture != NULL) {
16
+ free(fixture);
17
+ }
18
+ }
19
+
20
+ void test_objects__inline(void)
21
+ {
22
+ fixture = read_fixture("objects.graphql");
23
+
24
+ GraphQLTypes* types = NULL;
25
+ size_t types_len = 0;
26
+ uint8_t err;
27
+
28
+ err = gqlidl_parse_schema(fixture, &types, &types_len);
29
+
30
+ cl_assert_equal_i(err, 0);
31
+
32
+ cl_assert_equal_s(types[0].typename, "object");
33
+ cl_assert_equal_s(NULL, types[0].object_type.description);
34
+ cl_assert_equal_s("CodeOfConduct", types[0].object_type.name);
35
+
36
+ cl_assert_equal_s(types[1].typename, "object");
37
+ cl_assert_equal_s("The Code of Conduct for a repository", types[1].object_type.description);
38
+ cl_assert_equal_s("CodeOfConduct", types[1].object_type.name);
39
+
40
+ cl_assert_equal_s(types[2].typename, "object");
41
+ cl_assert_equal_s(NULL, types[2].object_type.description);
42
+ cl_assert_equal_s("PushAllowance", types[2].object_type.name);
43
+ cl_assert_equal_i(1, types[2].object_type.implements.length);
44
+ cl_assert_equal_s("Node", types[2].object_type.implements.data[0]);
45
+
46
+ cl_assert_equal_s(types[3].typename, "object");
47
+ cl_assert_equal_s(NULL, types[3].object_type.description);
48
+ cl_assert_equal_s("Release", types[3].object_type.name);
49
+ cl_assert_equal_i(2, types[3].object_type.implements.length);
50
+ cl_assert_equal_s("Node", types[3].object_type.implements.data[0]);
51
+ cl_assert_equal_s("UniformResourceLocatable", types[3].object_type.implements.data[1]);
52
+
53
+ cl_assert_equal_s(types[4].typename, "object");
54
+ cl_assert_equal_s("The Code of Conduct for a repository", types[4].object_type.description);
55
+ cl_assert_equal_s("CodeOfConduct", types[4].object_type.name);
56
+ cl_assert_equal_i(1, types[4].object_type.fields.length);
57
+ cl_assert_equal_s("body", types[4].object_type.fields.data[0].name);
58
+ cl_assert_equal_s(NULL, types[4].object_type.fields.data[0].description);
59
+ cl_assert_equal_i(0, types[4].object_type.fields.data[0].directives.length);
60
+
61
+ cl_assert_equal_s(types[5].typename, "object");
62
+ cl_assert_equal_s("The Code of Conduct for a repository", types[5].object_type.description);
63
+ cl_assert_equal_s("CodeOfConduct", types[5].object_type.name);
64
+ cl_assert_equal_i(1, types[5].object_type.fields.length);
65
+ cl_assert_equal_s("body", types[5].object_type.fields.data[0].name);
66
+ cl_assert_equal_s("The body of the CoC", types[5].object_type.fields.data[0].description);
67
+ cl_assert_equal_i(0, types[5].object_type.fields.data[0].directives.length);
68
+
69
+ cl_assert_equal_s(types[6].typename, "object");
70
+ cl_assert_equal_s("key", types[6].object_type.fields.data[0].name);
71
+ cl_assert_equal_s("String", types[6].object_type.fields.data[0].type_info.name);
72
+ cl_assert_equal_s("!", types[6].object_type.fields.data[0].type_info.info);
73
+
74
+ cl_assert_equal_s(types[7].typename, "object");
75
+ cl_assert_equal_s("edges", types[7].object_type.fields.data[0].name);
76
+ cl_assert_equal_s("CommitCommentEdge", types[7].object_type.fields.data[0].type_info.name);
77
+ cl_assert_equal_s("[]", types[7].object_type.fields.data[0].type_info.info);
78
+
79
+ cl_assert_equal_s(types[8].typename, "object");
80
+ cl_assert_equal_s("suggestedReviewers", types[8].object_type.fields.data[0].name);
81
+ cl_assert_equal_s("SuggestedReviewer", types[8].object_type.fields.data[0].type_info.name);
82
+ cl_assert_equal_s("[]!", types[8].object_type.fields.data[0].type_info.info);
83
+
84
+ cl_assert_equal_s(types[9].typename, "object");
85
+ cl_assert_equal_s("viewerCannotUpdateReasons", types[9].object_type.fields.data[0].name);
86
+ cl_assert_equal_s("CommentCannotUpdateReason", types[9].object_type.fields.data[0].type_info.name);
87
+ cl_assert_equal_s("[!]!", types[9].object_type.fields.data[0].type_info.info);
88
+
89
+ cl_assert_equal_s(types[10].typename, "object");
90
+ cl_assert_equal_s("followers", types[10].object_type.fields.data[0].name);
91
+ cl_assert_equal_s("FollowerConnection", types[10].object_type.fields.data[0].type_info.name);
92
+ cl_assert_equal_s("!", types[10].object_type.fields.data[0].type_info.info);
93
+ cl_assert_equal_i(2, types[10].object_type.fields.data[0].arguments.length);
94
+ cl_assert_equal_s("Returns the elements in the list that come after the specified global ID.", types[10].object_type.fields.data[0].arguments.data[0].description);
95
+ cl_assert_equal_s("after", types[10].object_type.fields.data[0].arguments.data[0].name);
96
+ cl_assert_equal_s("String", types[10].object_type.fields.data[0].arguments.data[0].type_info.name);
97
+ cl_assert_equal_s("", types[10].object_type.fields.data[0].arguments.data[0].type_info.info);
98
+ cl_assert_equal_s("Returns the first _n_ elements from the list.", types[10].object_type.fields.data[0].arguments.data[1].description);
99
+ cl_assert_equal_s("first", types[10].object_type.fields.data[0].arguments.data[1].name);
100
+ cl_assert_equal_s("Int", types[10].object_type.fields.data[0].arguments.data[1].type_info.name);
101
+ cl_assert_equal_s("!", types[10].object_type.fields.data[0].arguments.data[1].type_info.info);
102
+
103
+ cl_assert_equal_s(types[11].typename, "object");
104
+ cl_assert_equal_s("User", types[11].object_type.name);
105
+ cl_assert_equal_i(1, types[11].object_type.fields.data[0].directives.length);
106
+ cl_assert_equal_s("deprecated", types[11].object_type.fields.data[0].directives.data[0].name);
107
+ cl_assert_equal_i(0, types[11].object_type.fields.data[0].directives.data[0].arguments.length);
108
+
109
+ cl_assert_equal_s(types[12].typename, "object");
110
+ cl_assert_equal_s("Issue", types[12].object_type.name);
111
+ cl_assert_equal_i(0, types[12].object_type.fields.data[0].arguments.length);
112
+ cl_assert_equal_i(1, types[12].object_type.fields.data[0].directives.length);
113
+ cl_assert_equal_s("deprecated", types[12].object_type.fields.data[0].directives.data[0].name);
114
+ cl_assert_equal_i(1, types[12].object_type.fields.data[0].directives.data[0].arguments.length);
115
+ cl_assert_equal_s("reason", types[12].object_type.fields.data[0].directives.data[0].arguments.data[0].name);
116
+ cl_assert_equal_s("Exposed database IDs will eventually be removed in favor of global Relay IDs.", types[12].object_type.fields.data[0].directives.data[0].arguments.data[0].value);
117
+
118
+ cl_assert_equal_s(types[13].typename, "object");
119
+ cl_assert_equal_s("Team", types[13].object_type.name);
120
+ cl_assert_equal_i(1, types[13].object_type.implements.length);
121
+ cl_assert_equal_s("Node", types[13].object_type.implements.data[0]);
122
+
123
+ cl_assert_equal_i(1, types[13].object_type.fields.length);
124
+ cl_assert_equal_s("childTeams", types[13].object_type.fields.data[0].name);
125
+ cl_assert_equal_i(1, types[13].object_type.fields.data[0].arguments.length);
126
+ cl_assert_equal_s("immediateOnly", types[13].object_type.fields.data[0].arguments.data[0].name);
127
+ cl_assert_equal_s("Boolean", types[13].object_type.fields.data[0].arguments.data[0].type_info.name);
128
+ cl_assert_equal_s("", types[13].object_type.fields.data[0].arguments.data[0].type_info.info);
129
+ cl_assert_equal_s("true", types[13].object_type.fields.data[0].arguments.data[0].default_value);
130
+ }
@@ -0,0 +1,39 @@
1
+ #include "clar.h"
2
+ #include "clar_test.h"
3
+ #include <stdio.h>
4
+ #include <string.h>
5
+
6
+ static char *fixture;
7
+
8
+ void test_scalars__initialize(void)
9
+ {
10
+ global_test_counter++;
11
+ }
12
+
13
+ void test_scalars__cleanup(void)
14
+ {
15
+ if (fixture != NULL) {
16
+ free(fixture);
17
+ }
18
+ }
19
+
20
+ void test_scalars__inline(void)
21
+ {
22
+ fixture = read_fixture("scalars.graphql");
23
+
24
+ GraphQLTypes* types = NULL;
25
+ size_t types_len = 0;
26
+ uint8_t err;
27
+
28
+ err = gqlidl_parse_schema(fixture, &types, &types_len);
29
+
30
+ cl_assert_equal_i(err, 0);
31
+
32
+ cl_assert_equal_s(types[0].typename, "scalar");
33
+ cl_assert_equal_s(NULL, types[0].scalar_type.description);
34
+ cl_assert_equal_s("DateTime", types[0].scalar_type.name);
35
+
36
+ cl_assert_equal_s(types[1].typename, "scalar");
37
+ cl_assert_equal_s("An ISO-8601 encoded UTC date string.", types[1].scalar_type.description);
38
+ cl_assert_equal_s("DateTime", types[1].scalar_type.name);
39
+ }
@@ -0,0 +1,38 @@
1
+ #include "clar.h"
2
+ #include "clar_test.h"
3
+ #include <stdio.h>
4
+ #include <string.h>
5
+
6
+ static char *fixture;
7
+
8
+ void test_unions__initialize(void)
9
+ {
10
+ global_test_counter++;
11
+ }
12
+
13
+ void test_unions__cleanup(void)
14
+ {
15
+ if (fixture != NULL) {
16
+ free(fixture);
17
+ }
18
+ }
19
+
20
+ void test_unions__inline(void)
21
+ {
22
+ fixture = read_fixture("unions.graphql");
23
+
24
+ GraphQLTypes* types = NULL;
25
+ size_t types_len = 0;
26
+ uint8_t err;
27
+
28
+ err = gqlidl_parse_schema(fixture, &types, &types_len);
29
+
30
+ cl_assert_equal_i(err, 0);
31
+
32
+ cl_assert_equal_s(types[0].typename, "union");
33
+ cl_assert_equal_s("ReferencedSubject", types[0].union_type.name);
34
+ cl_assert_equal_s("Any referencable object", types[0].union_type.description);
35
+ cl_assert_equal_i(2, types[0].union_type.values.length);
36
+ cl_assert_equal_s("Issue", types[0].union_type.values.data[0]);
37
+ cl_assert_equal_s("PullRequest", types[0].union_type.values.data[1]);
38
+ }
@@ -0,0 +1,11 @@
1
+ #!/bin/sh
2
+
3
+ set -ex
4
+
5
+ cd graphql-idl-parser-ffi
6
+
7
+ cargo update
8
+ cargo build
9
+ gcc -O3 -DDEBUG -o example/example example/example.c -std=c11 -Wextra -Wall -pedantic -Werror -Wfatal-errors -Wstrict-aliasing -Iincludes -Ltarget/debug -lgraphqlidlparser
10
+
11
+ ./example/example
@@ -0,0 +1,23 @@
1
+ #!/bin/sh
2
+
3
+ set -e
4
+
5
+ rustup default nightly
6
+
7
+ echo "Formatting lib..."
8
+ sudo cargo fmt
9
+
10
+ echo "Formatting ffi..."
11
+ cd graphql-idl-parser-ffi
12
+ sudo cargo fmt
13
+ cd ..
14
+
15
+ echo "Formatting C..."
16
+ for file in `find graphql-idl-parser-ffi/example graphql-idl-parser-ffi/include -name '*.c' -o -name '*.h'` ; do
17
+ astyle --indent=spaces=2 --style=1tbs --keep-one-line-blocks -n $file
18
+ done
19
+
20
+ rustup default stable
21
+
22
+ git add .
23
+ git commit -m "Formatting"
@@ -0,0 +1,30 @@
1
+ #!/bin/sh
2
+
3
+ set -ex
4
+
5
+ test_dir=$(pwd)/test
6
+
7
+ cd graphql-idl-parser-ffi
8
+
9
+ lib_dir=$(pwd)/target/debug
10
+ includes_dir=$(pwd)/includes
11
+
12
+ cargo update
13
+ cargo build
14
+
15
+ cd test
16
+
17
+ python generate.py .
18
+
19
+ if [[ "$OSTYPE" == "darwin"* ]]; then
20
+ ld_extra="-Wl,-rpath,$lib_dir"
21
+ else
22
+ ld_extra="-Wl,-rpath=$lib_dir"
23
+ fi
24
+
25
+ #
26
+ gcc -I. -I$includes_dir -L$lib_dir $ld_extra -Wall -o gql-idl-parser-test clar.c main.c helpers.c scalars.c objects.c enums.c interfaces.c unions.c input_objects.c -lgraphqlidlparser -DCLAR_FIXTURE_PATH=\"$test_dir\"
27
+
28
+ ./gql-idl-parser-test
29
+
30
+ # valgrind --leak-check=full --dsymutil=yes --error-exitcode=1 ./gql-idl-parser-test >/dev/null