redsnow 0.3.7 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (302) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/Rakefile +4 -4
  4. data/ext/drafter/Makefile +54 -0
  5. data/ext/drafter/appveyor.yml +10 -0
  6. data/ext/drafter/bin/drafter +0 -0
  7. data/ext/{snowcrash → drafter}/build/Makefile +29 -14
  8. data/ext/{snowcrash/build/snowcrash.Makefile → drafter/build/drafter.Makefile} +1 -1
  9. data/ext/{snowcrash/build/snowcrash.target.mk → drafter/build/drafter.target.mk} +25 -23
  10. data/ext/{snowcrash/build → drafter/build/ext/snowcrash}/libmarkdownparser.target.mk +7 -7
  11. data/ext/drafter/build/ext/snowcrash/libsnowcrash.target.mk +152 -0
  12. data/ext/{snowcrash/build → drafter/build/ext/snowcrash}/libsundown.target.mk +13 -13
  13. data/ext/{snowcrash/build → drafter/build/ext/snowcrash}/perf-libsnowcrash.target.mk +14 -20
  14. data/ext/drafter/build/ext/snowcrash/snowcrash.Makefile +6 -0
  15. data/ext/{snowcrash → drafter}/build/gyp-mac-tool +0 -0
  16. data/ext/{snowcrash/build/libsnowcrash.target.mk → drafter/build/libdrafter.target.mk} +29 -36
  17. data/ext/drafter/build/libsos.target.mk +133 -0
  18. data/ext/drafter/build/out/Release/drafter +0 -0
  19. data/ext/drafter/build/out/Release/libdrafter.dylib +0 -0
  20. data/ext/drafter/build/out/Release/libmarkdownparser.a +0 -0
  21. data/ext/drafter/build/out/Release/libsnowcrash.a +0 -0
  22. data/ext/drafter/build/out/Release/libsos.a +0 -0
  23. data/ext/{snowcrash → drafter}/build/out/Release/libsundown.a +0 -0
  24. data/ext/{snowcrash → drafter}/build/out/Release/linker.lock +0 -0
  25. data/ext/drafter/build/out/Release/obj.target/drafter/src/config.o +0 -0
  26. data/ext/drafter/build/out/Release/obj.target/drafter/src/main.o +0 -0
  27. data/ext/drafter/build/out/Release/obj.target/drafter/src/reporting.o +0 -0
  28. data/ext/drafter/build/out/Release/obj.target/libdrafter/src/Serialize.o +0 -0
  29. data/ext/drafter/build/out/Release/obj.target/libdrafter/src/SerializeAST.o +0 -0
  30. data/ext/drafter/build/out/Release/obj.target/libdrafter/src/SerializeResult.o +0 -0
  31. data/ext/drafter/build/out/Release/obj.target/libdrafter/src/SerializeSourcemap.o +0 -0
  32. data/ext/drafter/build/out/Release/obj.target/libdrafter/src/cdrafter.o +0 -0
  33. data/ext/drafter/build/out/Release/obj.target/libdrafter/src/drafter.o +0 -0
  34. data/ext/drafter/build/out/Release/obj.target/libmarkdownparser/ext/snowcrash/ext/markdown-parser/src/ByteBuffer.o +0 -0
  35. data/ext/drafter/build/out/Release/obj.target/libmarkdownparser/ext/snowcrash/ext/markdown-parser/src/MarkdownNode.o +0 -0
  36. data/ext/drafter/build/out/Release/obj.target/libmarkdownparser/ext/snowcrash/ext/markdown-parser/src/MarkdownParser.o +0 -0
  37. data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/Blueprint.o +0 -0
  38. data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/BlueprintSourcemap.o +0 -0
  39. data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/HTTP.o +0 -0
  40. data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/HeadersParser.o +0 -0
  41. data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/MSON.o +0 -0
  42. data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/MSONOneOfParser.o +0 -0
  43. data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/MSONSourcemap.o +0 -0
  44. data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/MSONTypeSectionParser.o +0 -0
  45. data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/MSONValueMemberParser.o +0 -0
  46. data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/Section.o +0 -0
  47. data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/Signature.o +0 -0
  48. data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/UriTemplateParser.o +0 -0
  49. data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/posix/RegexMatch.o +0 -0
  50. data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/snowcrash.o +0 -0
  51. data/ext/drafter/build/out/Release/obj.target/libsos/ext/sos/src/sos.o +0 -0
  52. data/ext/drafter/build/out/Release/obj.target/libsundown/ext/snowcrash/ext/markdown-parser/ext/sundown/html/houdini_href_e.o +0 -0
  53. data/ext/drafter/build/out/Release/obj.target/libsundown/ext/snowcrash/ext/markdown-parser/ext/sundown/html/houdini_html_e.o +0 -0
  54. data/ext/{snowcrash/build/out/Release/obj.target/libsundown → drafter/build/out/Release/obj.target/libsundown/ext/snowcrash}/ext/markdown-parser/ext/sundown/html/html.o +0 -0
  55. data/ext/{snowcrash/build/out/Release/obj.target/libsundown → drafter/build/out/Release/obj.target/libsundown/ext/snowcrash}/ext/markdown-parser/ext/sundown/html/html_smartypants.o +0 -0
  56. data/ext/{snowcrash/build/out/Release/obj.target/libsundown → drafter/build/out/Release/obj.target/libsundown/ext/snowcrash}/ext/markdown-parser/ext/sundown/src/autolink.o +0 -0
  57. data/ext/{snowcrash/build/out/Release/obj.target/libsundown → drafter/build/out/Release/obj.target/libsundown/ext/snowcrash}/ext/markdown-parser/ext/sundown/src/buffer.o +0 -0
  58. data/ext/{snowcrash/build/out/Release/obj.target/libsundown → drafter/build/out/Release/obj.target/libsundown/ext/snowcrash}/ext/markdown-parser/ext/sundown/src/markdown.o +0 -0
  59. data/ext/{snowcrash/build/out/Release/obj.target/libsundown → drafter/build/out/Release/obj.target/libsundown/ext/snowcrash}/ext/markdown-parser/ext/sundown/src/src_map.o +0 -0
  60. data/ext/drafter/build/out/Release/obj.target/libsundown/ext/snowcrash/ext/markdown-parser/ext/sundown/src/stack.o +0 -0
  61. data/ext/drafter/circle.yml +12 -0
  62. data/ext/{snowcrash → drafter}/config.gypi +1 -1
  63. data/ext/{snowcrash → drafter}/config.mk +0 -0
  64. data/ext/{snowcrash → drafter}/configure +16 -5
  65. data/ext/drafter/drafter.gyp +118 -0
  66. data/ext/{snowcrash → drafter/ext/snowcrash}/Makefile +4 -12
  67. data/ext/{snowcrash → drafter/ext/snowcrash}/Vagrantfile +14 -4
  68. data/ext/drafter/ext/snowcrash/appveyor.yml +7 -0
  69. data/ext/{snowcrash → drafter/ext/snowcrash}/common.gypi +0 -0
  70. data/ext/drafter/ext/snowcrash/configure +197 -0
  71. data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/Makefile +0 -0
  72. data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/CONTRIBUTING.md +0 -0
  73. data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/Makefile +0 -0
  74. data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/Makefile.win +0 -0
  75. data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/examples/smartypants.c +0 -0
  76. data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/examples/sundown.c +0 -0
  77. data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/html/houdini.h +0 -0
  78. data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/html/houdini_href_e.c +0 -0
  79. data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/html/houdini_html_e.c +0 -0
  80. data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/html/html.c +0 -0
  81. data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/html/html.h +0 -0
  82. data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/html/html_smartypants.c +0 -0
  83. data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/html_block_names.txt +0 -0
  84. data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/src/autolink.c +0 -0
  85. data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/src/autolink.h +0 -0
  86. data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/src/buffer.c +0 -0
  87. data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/src/buffer.h +0 -0
  88. data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/src/html_blocks.h +0 -0
  89. data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/src/markdown.c +0 -0
  90. data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/src/markdown.h +0 -0
  91. data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/src/src_map.c +0 -0
  92. data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/src/src_map.h +0 -0
  93. data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/src/stack.c +0 -0
  94. data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/src/stack.h +0 -0
  95. data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/sundown.def +0 -0
  96. data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/msvc/markdown/markdown.vcproj +0 -0
  97. data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/msvc/msvc.sln +0 -0
  98. data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/msvc/sundown/sundown.vcproj +0 -0
  99. data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/src/ByteBuffer.cc +0 -0
  100. data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/src/ByteBuffer.h +0 -0
  101. data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/src/MarkdownNode.cc +0 -0
  102. data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/src/MarkdownNode.h +0 -0
  103. data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/src/MarkdownParser.cc +0 -0
  104. data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/src/MarkdownParser.h +10 -2
  105. data/ext/{snowcrash → drafter/ext/snowcrash}/provisioning.sh +0 -0
  106. data/ext/{snowcrash → drafter/ext/snowcrash}/snowcrash.gyp +41 -39
  107. data/ext/{snowcrash → drafter/ext/snowcrash}/snowcrash.xcworkspace/contents.xcworkspacedata +0 -0
  108. data/ext/{snowcrash → drafter/ext/snowcrash}/src/ActionParser.h +50 -6
  109. data/ext/{snowcrash → drafter/ext/snowcrash}/src/AssetParser.h +1 -12
  110. data/ext/drafter/ext/snowcrash/src/AttributesParser.h +121 -0
  111. data/ext/drafter/ext/snowcrash/src/Blueprint.cc +90 -0
  112. data/ext/{snowcrash → drafter/ext/snowcrash}/src/Blueprint.h +169 -33
  113. data/ext/{snowcrash → drafter/ext/snowcrash}/src/BlueprintParser.h +305 -48
  114. data/ext/drafter/ext/snowcrash/src/BlueprintSourcemap.cc +81 -0
  115. data/ext/{snowcrash → drafter/ext/snowcrash}/src/BlueprintSourcemap.h +130 -39
  116. data/ext/{snowcrash → drafter/ext/snowcrash}/src/BlueprintUtility.h +10 -4
  117. data/ext/{snowcrash → drafter/ext/snowcrash}/src/CodeBlockUtility.h +1 -1
  118. data/ext/drafter/ext/snowcrash/src/DataStructureGroupParser.h +154 -0
  119. data/ext/{snowcrash → drafter/ext/snowcrash}/src/HTTP.cc +0 -0
  120. data/ext/{snowcrash → drafter/ext/snowcrash}/src/HTTP.h +0 -0
  121. data/ext/drafter/ext/snowcrash/src/HeadersParser.cc +110 -0
  122. data/ext/{snowcrash → drafter/ext/snowcrash}/src/HeadersParser.h +123 -54
  123. data/ext/drafter/ext/snowcrash/src/MSON.cc +272 -0
  124. data/ext/drafter/ext/snowcrash/src/MSON.h +399 -0
  125. data/ext/drafter/ext/snowcrash/src/MSONMixinParser.h +95 -0
  126. data/ext/drafter/ext/snowcrash/src/MSONNamedTypeParser.h +108 -0
  127. data/ext/drafter/ext/snowcrash/src/MSONOneOfParser.cc +132 -0
  128. data/ext/drafter/ext/snowcrash/src/MSONOneOfParser.h +80 -0
  129. data/ext/drafter/ext/snowcrash/src/MSONParameterParser.h +232 -0
  130. data/ext/drafter/ext/snowcrash/src/MSONPropertyMemberParser.h +91 -0
  131. data/ext/drafter/ext/snowcrash/src/MSONSourcemap.cc +141 -0
  132. data/ext/drafter/ext/snowcrash/src/MSONSourcemap.h +181 -0
  133. data/ext/drafter/ext/snowcrash/src/MSONTypeSectionParser.cc +209 -0
  134. data/ext/drafter/ext/snowcrash/src/MSONTypeSectionParser.h +213 -0
  135. data/ext/drafter/ext/snowcrash/src/MSONUtility.h +423 -0
  136. data/ext/drafter/ext/snowcrash/src/MSONValueMemberParser.cc +179 -0
  137. data/ext/drafter/ext/snowcrash/src/MSONValueMemberParser.h +346 -0
  138. data/ext/drafter/ext/snowcrash/src/ModelTable.h +87 -0
  139. data/ext/{snowcrash → drafter/ext/snowcrash}/src/ParameterParser.h +120 -61
  140. data/ext/{snowcrash → drafter/ext/snowcrash}/src/ParametersParser.h +17 -18
  141. data/ext/{snowcrash → drafter/ext/snowcrash}/src/PayloadParser.h +36 -18
  142. data/ext/{snowcrash → drafter/ext/snowcrash}/src/Platform.h +0 -0
  143. data/ext/{snowcrash → drafter/ext/snowcrash}/src/RegexMatch.h +0 -0
  144. data/ext/drafter/ext/snowcrash/src/RelationParser.h +75 -0
  145. data/ext/{snowcrash → drafter/ext/snowcrash}/src/ResourceGroupParser.h +127 -33
  146. data/ext/{snowcrash → drafter/ext/snowcrash}/src/ResourceParser.h +126 -33
  147. data/ext/{snowcrash → drafter/ext/snowcrash}/src/Section.cc +6 -0
  148. data/ext/{snowcrash → drafter/ext/snowcrash}/src/Section.h +15 -2
  149. data/ext/{snowcrash → drafter/ext/snowcrash}/src/SectionParser.h +3 -1
  150. data/ext/{snowcrash → drafter/ext/snowcrash}/src/SectionParserData.h +15 -5
  151. data/ext/{snowcrash → drafter/ext/snowcrash}/src/SectionProcessor.h +24 -0
  152. data/ext/{snowcrash → drafter/ext/snowcrash}/src/Signature.cc +14 -0
  153. data/ext/drafter/ext/snowcrash/src/Signature.h +80 -0
  154. data/ext/drafter/ext/snowcrash/src/SignatureSectionProcessor.h +439 -0
  155. data/ext/{snowcrash → drafter/ext/snowcrash}/src/SourceAnnotation.h +3 -2
  156. data/ext/{snowcrash → drafter/ext/snowcrash}/src/StringUtility.h +103 -6
  157. data/ext/{snowcrash → drafter/ext/snowcrash}/src/UriTemplateParser.cc +0 -0
  158. data/ext/{snowcrash → drafter/ext/snowcrash}/src/UriTemplateParser.h +0 -0
  159. data/ext/{snowcrash → drafter/ext/snowcrash}/src/ValuesParser.h +1 -13
  160. data/ext/{snowcrash → drafter/ext/snowcrash}/src/posix/RegexMatch.cc +0 -0
  161. data/ext/{snowcrash → drafter/ext/snowcrash}/src/snowcrash.cc +0 -0
  162. data/ext/{snowcrash → drafter/ext/snowcrash}/src/snowcrash.h +0 -0
  163. data/ext/{snowcrash → drafter/ext/snowcrash}/src/win/RegexMatch.cc +0 -0
  164. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/AUTHORS +0 -0
  165. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/DEPS +0 -0
  166. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/OWNERS +0 -0
  167. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/PRESUBMIT.py +0 -0
  168. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/buildbot/buildbot_run.py +0 -0
  169. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/codereview.settings +0 -0
  170. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/data/win/large-pdb-shim.cc +0 -0
  171. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/gyp +0 -0
  172. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/gyp.bat +0 -0
  173. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/gyp_main.py +0 -0
  174. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/MSVSNew.py +0 -0
  175. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/MSVSProject.py +0 -0
  176. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/MSVSSettings.py +0 -0
  177. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/MSVSToolFile.py +0 -0
  178. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/MSVSUserFile.py +0 -0
  179. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/MSVSUtil.py +0 -0
  180. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/MSVSVersion.py +0 -0
  181. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/__init__.py +0 -0
  182. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/__init__.pyc +0 -0
  183. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/common.py +0 -0
  184. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/common.pyc +0 -0
  185. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/easy_xml.py +0 -0
  186. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/flock_tool.py +0 -0
  187. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/generator/__init__.py +0 -0
  188. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/generator/__init__.pyc +0 -0
  189. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/generator/android.py +0 -0
  190. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/generator/cmake.py +0 -0
  191. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/generator/dump_dependency_json.py +0 -0
  192. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/generator/eclipse.py +0 -0
  193. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/generator/gypd.py +0 -0
  194. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/generator/gypsh.py +0 -0
  195. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/generator/make.py +0 -0
  196. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/generator/make.pyc +0 -0
  197. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/generator/msvs.py +0 -0
  198. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/generator/ninja.py +0 -0
  199. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/generator/xcode.py +0 -0
  200. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/generator/xcode.pyc +0 -0
  201. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/input.py +0 -0
  202. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/input.pyc +0 -0
  203. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/mac_tool.py +0 -0
  204. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/msvs_emulation.py +0 -0
  205. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/ninja_syntax.py +0 -0
  206. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/ordered_dict.py +0 -0
  207. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/win_tool.py +0 -0
  208. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/xcode_emulation.py +0 -0
  209. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/xcode_emulation.pyc +0 -0
  210. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/xcodeproj_file.py +0 -0
  211. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/xcodeproj_file.pyc +0 -0
  212. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/xml_fix.py +0 -0
  213. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylintrc +0 -0
  214. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/samples/samples +0 -0
  215. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/samples/samples.bat +0 -0
  216. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/setup.py +0 -0
  217. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/tools/Xcode/Specifications/gyp.pbfilespec +0 -0
  218. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/tools/Xcode/Specifications/gyp.xclangspec +0 -0
  219. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/tools/emacs/gyp.el +0 -0
  220. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/tools/graphviz.py +0 -0
  221. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/tools/pretty_gyp.py +0 -0
  222. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/tools/pretty_sln.py +0 -0
  223. data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/tools/pretty_vcproj.py +0 -0
  224. data/ext/drafter/ext/snowcrash/vcbuild.bat +139 -0
  225. data/ext/drafter/ext/sos/Makefile +57 -0
  226. data/ext/drafter/ext/sos/src/sos.cc +200 -0
  227. data/ext/drafter/ext/sos/src/sos.h +179 -0
  228. data/ext/drafter/ext/sos/src/sosJSON.h +105 -0
  229. data/ext/drafter/ext/sos/src/sosYAML.h +104 -0
  230. data/ext/{snowcrash → drafter}/src/Serialize.cc +30 -15
  231. data/ext/drafter/src/Serialize.h +135 -0
  232. data/ext/drafter/src/SerializeAST.cc +775 -0
  233. data/ext/drafter/src/SerializeAST.h +19 -0
  234. data/ext/drafter/src/SerializeResult.cc +67 -0
  235. data/ext/drafter/src/SerializeResult.h +26 -0
  236. data/ext/drafter/src/SerializeSourcemap.cc +446 -0
  237. data/ext/drafter/src/SerializeSourcemap.h +19 -0
  238. data/ext/drafter/src/Version.h +38 -0
  239. data/ext/drafter/src/cdrafter.cc +44 -0
  240. data/ext/drafter/src/cdrafter.h +55 -0
  241. data/ext/drafter/src/config.cc +80 -0
  242. data/ext/drafter/src/config.h +35 -0
  243. data/ext/drafter/src/drafter.cc +22 -0
  244. data/ext/drafter/src/drafter.h +38 -0
  245. data/ext/drafter/src/main.cc +91 -0
  246. data/ext/drafter/src/reporting.cc +162 -0
  247. data/ext/drafter/src/reporting.h +28 -0
  248. data/ext/drafter/src/stream.h +146 -0
  249. data/ext/drafter/tools/homebrew/drafter.rb +12 -0
  250. data/ext/{snowcrash → drafter}/vcbuild.bat +3 -3
  251. data/lib/redsnow.rb +6 -11
  252. data/lib/redsnow/binding.rb +11 -201
  253. data/lib/redsnow/blueprint.rb +104 -169
  254. data/lib/redsnow/parseresult.rb +28 -42
  255. data/lib/redsnow/sourcemap.rb +92 -177
  256. data/lib/redsnow/version.rb +1 -1
  257. data/redsnow.gemspec +1 -1
  258. metadata +249 -197
  259. data/ext/snowcrash/bin/snowcrash +0 -0
  260. data/ext/snowcrash/build/out/Release/libmarkdownparser.a +0 -0
  261. data/ext/snowcrash/build/out/Release/libsnowcrash.dylib +0 -0
  262. data/ext/snowcrash/build/out/Release/obj.target/libmarkdownparser/ext/markdown-parser/src/ByteBuffer.o +0 -0
  263. data/ext/snowcrash/build/out/Release/obj.target/libmarkdownparser/ext/markdown-parser/src/MarkdownNode.o +0 -0
  264. data/ext/snowcrash/build/out/Release/obj.target/libmarkdownparser/ext/markdown-parser/src/MarkdownParser.o +0 -0
  265. data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/CBlueprint.o +0 -0
  266. data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/CBlueprintSourcemap.o +0 -0
  267. data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/CSourceAnnotation.o +0 -0
  268. data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/HTTP.o +0 -0
  269. data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/Section.o +0 -0
  270. data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/Serialize.o +0 -0
  271. data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/SerializeJSON.o +0 -0
  272. data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/SerializeYAML.o +0 -0
  273. data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/Signature.o +0 -0
  274. data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/UriTemplateParser.o +0 -0
  275. data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/csnowcrash.o +0 -0
  276. data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/posix/RegexMatch.o +0 -0
  277. data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/snowcrash.o +0 -0
  278. data/ext/snowcrash/build/out/Release/obj.target/libsundown/ext/markdown-parser/ext/sundown/html/houdini_href_e.o +0 -0
  279. data/ext/snowcrash/build/out/Release/obj.target/libsundown/ext/markdown-parser/ext/sundown/html/houdini_html_e.o +0 -0
  280. data/ext/snowcrash/build/out/Release/obj.target/libsundown/ext/markdown-parser/ext/sundown/src/stack.o +0 -0
  281. data/ext/snowcrash/build/out/Release/obj.target/snowcrash/src/snowcrash/snowcrash.o +0 -0
  282. data/ext/snowcrash/build/out/Release/snowcrash +0 -0
  283. data/ext/snowcrash/src/CBlueprint.cc +0 -628
  284. data/ext/snowcrash/src/CBlueprint.h +0 -366
  285. data/ext/snowcrash/src/CBlueprintSourcemap.cc +0 -630
  286. data/ext/snowcrash/src/CBlueprintSourcemap.h +0 -351
  287. data/ext/snowcrash/src/CSourceAnnotation.cc +0 -154
  288. data/ext/snowcrash/src/CSourceAnnotation.h +0 -106
  289. data/ext/snowcrash/src/Serialize.h +0 -71
  290. data/ext/snowcrash/src/SerializeJSON.cc +0 -1221
  291. data/ext/snowcrash/src/SerializeJSON.h +0 -24
  292. data/ext/snowcrash/src/SerializeYAML.cc +0 -702
  293. data/ext/snowcrash/src/SerializeYAML.h +0 -24
  294. data/ext/snowcrash/src/Signature.h +0 -32
  295. data/ext/snowcrash/src/SymbolTable.h +0 -94
  296. data/ext/snowcrash/src/Version.h +0 -39
  297. data/ext/snowcrash/src/csnowcrash.cc +0 -29
  298. data/ext/snowcrash/src/csnowcrash.h +0 -40
  299. data/ext/snowcrash/src/snowcrash/snowcrash.cc +0 -200
  300. data/ext/snowcrash/tools/gyp/pylib/gyp/common.pyc +0 -0
  301. data/ext/snowcrash/tools/gyp/pylib/gyp/generator/__init__.pyc +0 -0
  302. data/ext/snowcrash/tools/homebrew/snowcrash.rb +0 -12
@@ -1,24 +0,0 @@
1
- //
2
- // SerializeJSON.h
3
- // snowcrash
4
- //
5
- // Created by Zdenek Nemec on 4/27/13.
6
- // Copyright (c) 2013 Apiary Inc. All rights reserved.
7
- //
8
-
9
- #ifndef SNOWCRASH_SERIALIZE_JSON_H
10
- #define SNOWCRASH_SERIALIZE_JSON_H
11
-
12
- #include <ostream>
13
- #include "BlueprintSourcemap.h"
14
-
15
- namespace snowcrash {
16
-
17
- // Naive JSON serialization to ostream
18
- void SerializeJSON(const snowcrash::Blueprint& blueprint, std::ostream &os);
19
-
20
- // Naive Sourcmap JSON serialization to ostream
21
- void SerializeSourceMapJSON(const snowcrash::SourceMap<snowcrash::Blueprint>& blueprint, std::ostream &os);
22
- }
23
-
24
- #endif
@@ -1,702 +0,0 @@
1
- //
2
- // SerializeYAML.cc
3
- // snowcrash
4
- //
5
- // Created by Zdenek Nemec on 5/3/13.
6
- // Copyright (c) 2013 Apiary Inc. All rights reserved.
7
- //
8
-
9
- #include "Serialize.h"
10
- #include "SerializeYAML.h"
11
-
12
- using namespace snowcrash;
13
-
14
- static std::string ReservedCharacters = "#-[]:|>!*&%@`,{}?\'";
15
-
16
- /** Normalizes string value for use in YAML and checks whether quotation is need */
17
- static std::string NormalizeStringValue(const std::string& value, bool& needsQuotation)
18
- {
19
- std::string normalizedValue = value;
20
-
21
- if (normalizedValue.find("\"") != std::string::npos)
22
- normalizedValue = EscapeDoubleQuotes(normalizedValue);
23
-
24
- if (value.find("\n") != std::string::npos)
25
- normalizedValue = EscapeNewlines(normalizedValue);
26
-
27
- needsQuotation = (normalizedValue != value);
28
-
29
- if (!needsQuotation) {
30
- for (std::string::const_iterator it = value.begin() ; it < value.end() ; ++it){
31
- needsQuotation = ReservedCharacters.find(*it) != std::string::npos;
32
- if (needsQuotation)
33
- break;
34
- }
35
- }
36
-
37
- return normalizedValue;
38
- }
39
-
40
-
41
- /** Insert array item mark */
42
- static void ArrayItemLeadIn(size_t level, std::ostream &os, bool withTrailingSpace = true)
43
- {
44
- if (level < 1)
45
- return;
46
-
47
- for (size_t i = 0; i < level - 1; ++i)
48
- os << " ";
49
-
50
- os << "-";
51
-
52
- if (withTrailingSpace) {
53
- os << " ";
54
- }
55
- }
56
-
57
- /** Serialize key value pair */
58
- static void serialize(const std::string& key, const std::string& value, size_t level, std::ostream &os, bool implicitQuotation = true)
59
- {
60
- if (key.empty())
61
- return;
62
-
63
- for (size_t i = 0; i < level; ++i)
64
- os << " ";
65
-
66
- if (!value.empty()) {
67
-
68
- os << key << ": ";
69
-
70
- bool needsQuotation = false;
71
- std::string normalizedValue = NormalizeStringValue(value, needsQuotation);
72
-
73
- if (implicitQuotation) {
74
- // Always use quotation
75
- os << "\"" << normalizedValue << "\"";
76
- }
77
- else {
78
- if (needsQuotation)
79
- os << "\"" << normalizedValue << "\"";
80
- else
81
- os << value;
82
- }
83
-
84
- os << std::endl;
85
- }
86
- else
87
- os << key << ":\n";
88
- }
89
-
90
- /** Serialize source map without key into output stream */
91
- static void serialize(const SourceMapBase& set, size_t level, std::ostream &os)
92
- {
93
- if (!set.sourceMap.empty()) {
94
- size_t i = 0;
95
- os << std::endl;
96
-
97
- for (mdp::RangeSet<mdp::BytesRange>::const_iterator it = set.sourceMap.begin(); it != set.sourceMap.end(); ++i, ++it) {
98
-
99
- ArrayItemLeadIn(level, os, false);
100
- os << "\n";
101
- ArrayItemLeadIn(level + 1, os);
102
- os << it->location << "\n";
103
- ArrayItemLeadIn(level + 1, os);
104
- os << it->length << "\n";
105
- }
106
- } else {
107
- os << " []\n";
108
- }
109
- }
110
-
111
- /** Serialize a key and source map value into output stream. */
112
- static void serialize(const std::string& key, const SourceMapBase& value, size_t level, std::ostream &os, bool keyLevelIsZero = false)
113
- {
114
- if (key.empty())
115
- return;
116
-
117
- if (!keyLevelIsZero) {
118
- for (size_t i = 0; i < level; ++i)
119
- os << " ";
120
- }
121
-
122
- os << key << ":";
123
- serialize(value, level + 1, os);
124
- }
125
-
126
- /** Serializes source map collection */
127
- static void serializeSourceMapCollection(const Collection<SourceMap<KeyValuePair> >::type& collection, size_t level, std::ostream &os)
128
- {
129
- for (Collection<SourceMap<KeyValuePair> >::const_iterator it = collection.begin();
130
- it != collection.end();
131
- ++it) {
132
-
133
- // Array item
134
- ArrayItemLeadIn(level + 1, os, false);
135
-
136
- // Source Map
137
- serialize(*it, level + 2, os);
138
- }
139
- }
140
-
141
- /** Serializes key value collection */
142
- static void serializeKeyValueCollection(const Collection<KeyValuePair>::type& collection, size_t level, std::ostream &os)
143
- {
144
- for (Collection<KeyValuePair>::const_iterator it = collection.begin();
145
- it != collection.end();
146
- ++it) {
147
-
148
- // Array item
149
- ArrayItemLeadIn(level + 1, os);
150
-
151
- // Name
152
- serialize(SerializeKey::Name, it->first, 0, os);
153
-
154
- // Value
155
- serialize(SerializeKey::Value, it->second, level + 1, os);
156
- }
157
- }
158
-
159
- /** Serialize Metadata */
160
- static void serialize(const Collection<Metadata>::type& metadata, std::ostream &os)
161
- {
162
- serialize(SerializeKey::Metadata, std::string(), 0, os);
163
-
164
- if (metadata.empty())
165
- return;
166
-
167
- serializeKeyValueCollection(metadata, 0, os);
168
- }
169
-
170
- /** Serialize Metadata source map */
171
- static void serialize(const Collection<SourceMap<Metadata> >::type& metadata, std::ostream &os)
172
- {
173
- serialize(SerializeKey::Metadata, std::string(), 0, os);
174
-
175
- if (metadata.empty())
176
- return;
177
-
178
- serializeSourceMapCollection(metadata, 0, os);
179
- }
180
-
181
-
182
- /** Serialize Headers */
183
- static void serialize(const Headers& headers, size_t level, std::ostream &os)
184
- {
185
- serializeKeyValueCollection(headers, level, os);
186
- }
187
-
188
- /** Serialize Headers source map */
189
- static void serialize(const Collection<SourceMap<Header> >::type& headers, size_t level, std::ostream &os)
190
- {
191
- serializeSourceMapCollection(headers, level, os);
192
- }
193
-
194
- /** Serialize Parameters */
195
- static void serialize(const Parameters& parameters, size_t level, std::ostream &os)
196
- {
197
- for (Collection<Parameter>::const_iterator it = parameters.begin(); it != parameters.end(); ++it) {
198
-
199
- // Array item
200
- ArrayItemLeadIn(level + 1, os);
201
-
202
- // Key / name
203
- serialize(SerializeKey::Name, it->name, 0, os);
204
-
205
- // Description
206
- serialize(SerializeKey::Description, it->description, level + 1, os);
207
-
208
- // Type
209
- serialize(SerializeKey::Type, it->type, level + 1, os);
210
-
211
- // Required
212
- serialize(SerializeKey::Required, (it->use == OptionalParameterUse) ? "false" : "true", level + 1, os, false);
213
-
214
- // Default
215
- serialize(SerializeKey::Default, it->defaultValue, level + 1, os);
216
-
217
- // Example
218
- serialize(SerializeKey::Example, it->exampleValue, level + 1, os);
219
-
220
- // Values
221
- serialize(SerializeKey::Values, std::string(), level + 1, os);
222
-
223
- for (Collection<Value>::const_iterator val_it = it->values.begin();
224
- val_it != it->values.end();
225
- ++val_it) {
226
-
227
- ArrayItemLeadIn(level + 2, os);
228
-
229
- serialize(SerializeKey::Value, *val_it, 0, os);
230
- }
231
- }
232
- }
233
-
234
- /** Serialize Parameters source map */
235
- static void serialize(const Collection<SourceMap<Parameter> >::type& parameters, size_t level, std::ostream &os)
236
- {
237
- for (Collection<SourceMap<Parameter> >::const_iterator it = parameters.begin();
238
- it != parameters.end();
239
- ++it) {
240
-
241
- // Array item
242
- ArrayItemLeadIn(level + 1, os);
243
-
244
- // Key / name
245
- serialize(SerializeKey::Name, it->name, level + 1, os, true);
246
-
247
- // Description
248
- serialize(SerializeKey::Description, it->description, level + 1, os);
249
-
250
- // Type
251
- serialize(SerializeKey::Type, it->type, level + 1, os);
252
-
253
- // Required
254
- serialize(SerializeKey::Required, it->use, level + 1, os);
255
-
256
- // Default
257
- serialize(SerializeKey::Default, it->defaultValue, level + 1, os);
258
-
259
- // Example
260
- serialize(SerializeKey::Example, it->exampleValue, level + 1, os);
261
-
262
- // Values
263
- serialize(SerializeKey::Values, std::string(), level + 1, os);
264
-
265
- for (Collection<SourceMap<Value> >::const_iterator val_it = it->values.collection.begin();
266
- val_it != it->values.collection.end();
267
- ++val_it) {
268
-
269
- // Array item
270
- ArrayItemLeadIn(level + 2, os);
271
-
272
- // Source Map
273
- serialize(*val_it, level + 3, os);
274
- }
275
- }
276
- }
277
-
278
- /** Serialize Reference */
279
- static void serialize(const Reference& reference, size_t level, std::ostream &os)
280
- {
281
- if (reference.id.empty()) {
282
- return;
283
- }
284
-
285
- serialize(SerializeKey::Reference, "", level - 1, os);
286
-
287
- // ID
288
- serialize(SerializeKey::Id, reference.id, level, os);
289
- }
290
-
291
- /** Serialize Reference source map */
292
- static void serialize(const SourceMap<Reference>& reference, size_t level, std::ostream &os)
293
- {
294
- if (reference.sourceMap.empty()) {
295
- return;
296
- }
297
-
298
- serialize(SerializeKey::Reference, reference, level - 1, os);
299
- }
300
-
301
- /** Serialize Payload */
302
- static void serialize(const Payload& payload, size_t level, bool array, std::ostream &os)
303
- {
304
- for (size_t i = 0; i < level - 1; i++) {
305
- os << " ";
306
- }
307
-
308
- if (array)
309
- os << "- ";
310
- else
311
- os << " ";
312
-
313
- // Name
314
- serialize(SerializeKey::Name, payload.name, 0, os);
315
-
316
- // Reference
317
- serialize(payload.reference, level + 1, os);
318
-
319
- // Description
320
- serialize(SerializeKey::Description, payload.description, level, os);
321
-
322
- // Headers
323
- serialize(SerializeKey::Headers, std::string(), level, os);
324
-
325
- if (!payload.headers.empty()) {
326
- serialize(payload.headers, level, os);
327
- }
328
-
329
- // Body
330
- serialize(SerializeKey::Body, payload.body, level, os);
331
-
332
- // Schema
333
- serialize(SerializeKey::Schema, payload.schema, level, os);
334
- }
335
-
336
- /** Serialize Payload source map */
337
- static void serialize(const SourceMap<Payload>& payload, size_t level, bool array, std::ostream &os)
338
- {
339
- for (size_t i = 0; i < level - 1; i++) {
340
- os << " ";
341
- }
342
-
343
- if (array)
344
- os << "- ";
345
- else
346
- os << " ";
347
-
348
- // Name
349
- serialize(SerializeKey::Name, payload.name, level, os, true);
350
-
351
- // Reference
352
- serialize(payload.reference, level + 1, os);
353
-
354
- // Description
355
- serialize(SerializeKey::Description, payload.description, level, os);
356
-
357
- // Headers
358
- serialize(SerializeKey::Headers, std::string(), level, os);
359
-
360
- if (!payload.headers.collection.empty()) {
361
- serialize(payload.headers.collection, level, os);
362
- }
363
-
364
- // Body
365
- serialize(SerializeKey::Body, payload.body, level, os);
366
-
367
- // Schema
368
- serialize(SerializeKey::Schema, payload.schema, level, os);
369
- }
370
-
371
- /** Serialize Transaction Example */
372
- static void serialize(const TransactionExample& example, std::ostream &os)
373
- {
374
- os << " - "; // indent 4
375
-
376
- // Name
377
- serialize(SerializeKey::Name, example.name, 0, os);
378
-
379
- // Description
380
- serialize(SerializeKey::Description, example.description, 4, os);
381
-
382
- // Requests
383
- serialize(SerializeKey::Requests, std::string(), 4, os);
384
-
385
- if (!example.requests.empty()) {
386
- for (Collection<Request>::const_iterator it = example.requests.begin();
387
- it != example.requests.end();
388
- ++it) {
389
-
390
- serialize(*it, 5, true, os);
391
- }
392
- }
393
-
394
- // Responses
395
- serialize(SerializeKey::Responses, std::string(), 4, os);
396
-
397
- if (!example.responses.empty()) {
398
- for (Collection<Response>::const_iterator it = example.responses.begin();
399
- it != example.responses.end();
400
- ++it) {
401
-
402
- serialize(*it, 5, true, os);
403
- }
404
- }
405
- }
406
-
407
- /** Serialize Transaction Example source map */
408
- static void serialize(const SourceMap<TransactionExample>& example, std::ostream &os)
409
- {
410
- os << " - "; // indent 4
411
-
412
- // Name
413
- serialize(SerializeKey::Name, example.name, 4, os, true);
414
-
415
- // Description
416
- serialize(SerializeKey::Description, example.description, 4, os);
417
-
418
- // Requests
419
- serialize(SerializeKey::Requests, std::string(), 4, os);
420
-
421
- if (!example.requests.collection.empty()) {
422
- for (Collection<SourceMap<Request> >::const_iterator it = example.requests.collection.begin();
423
- it != example.requests.collection.end();
424
- ++it) {
425
-
426
- serialize(*it, 5, true, os);
427
- }
428
- }
429
-
430
- // Responses
431
- serialize(SerializeKey::Responses, std::string(), 4, os);
432
-
433
- if (!example.responses.collection.empty()) {
434
- for (Collection<SourceMap<Response> >::const_iterator it = example.responses.collection.begin();
435
- it != example.responses.collection.end();
436
- ++it) {
437
-
438
- serialize(*it, 5, true, os);
439
- }
440
- }
441
- }
442
-
443
- /** Serialize Action */
444
- static void serialize(const Action& action, std::ostream &os)
445
- {
446
- os << " - "; // indent 3
447
-
448
- // Name
449
- serialize(SerializeKey::Name, action.name, 0, os);
450
-
451
- // Description
452
- serialize(SerializeKey::Description, action.description, 3, os);
453
-
454
- // HTTP method
455
- serialize(SerializeKey::Method, action.method, 3, os);
456
-
457
- // Parameters
458
- serialize(SerializeKey::Parameters, std::string(), 3, os);
459
-
460
- if (!action.parameters.empty())
461
- serialize(action.parameters, 3, os);
462
-
463
- // Examples
464
- serialize(SerializeKey::Examples, std::string(), 3, os);
465
-
466
- if (!action.examples.empty()) {
467
- for (Collection<TransactionExample>::const_iterator it = action.examples.begin();
468
- it != action.examples.end();
469
- ++it) {
470
-
471
- serialize(*it, os);
472
- }
473
- }
474
- }
475
-
476
- /** Serialize Action source map */
477
- static void serialize(const SourceMap<Action>& action, std::ostream &os)
478
- {
479
- os << " - "; // indent 3
480
-
481
- // Name
482
- serialize(SerializeKey::Name, action.name, 3, os, true);
483
-
484
- // Description
485
- serialize(SerializeKey::Description, action.description, 3, os);
486
-
487
- // HTTP method
488
- serialize(SerializeKey::Method, action.method, 3, os);
489
-
490
- // Parameters
491
- serialize(SerializeKey::Parameters, std::string(), 3, os);
492
-
493
- if (!action.parameters.collection.empty())
494
- serialize(action.parameters.collection, 3, os);
495
-
496
- // Examples
497
- serialize(SerializeKey::Examples, std::string(), 3, os);
498
-
499
- if (!action.examples.collection.empty()) {
500
- for (Collection<SourceMap<TransactionExample> >::const_iterator it = action.examples.collection.begin();
501
- it != action.examples.collection.end();
502
- ++it) {
503
-
504
- serialize(*it, os);
505
- }
506
- }
507
- }
508
-
509
- /** Serialize Resource */
510
- static void serialize(const Resource& resource, std::ostream &os)
511
- {
512
- os << " - "; // indent 2
513
-
514
- // Name
515
- serialize(SerializeKey::Name, resource.name, 0, os);
516
-
517
- // Description
518
- serialize(SerializeKey::Description, resource.description, 2, os);
519
-
520
- // URI Template
521
- serialize(SerializeKey::URITemplate, resource.uriTemplate, 2, os);
522
-
523
- // Model
524
- serialize(SerializeKey::Model, std::string(), 2, os);
525
-
526
- if (!resource.model.name.empty())
527
- serialize(resource.model, 3, false, os);
528
-
529
- // Parameters
530
- serialize(SerializeKey::Parameters, std::string(), 2, os);
531
-
532
- if (!resource.parameters.empty())
533
- serialize(resource.parameters, 2, os);
534
-
535
- // Actions
536
- serialize(SerializeKey::Actions, std::string(), 2, os);
537
-
538
- if (resource.actions.empty())
539
- return;
540
-
541
- for (Collection<Action>::const_iterator it = resource.actions.begin();
542
- it != resource.actions.end();
543
- ++it) {
544
-
545
- serialize(*it, os);
546
- }
547
- }
548
-
549
- /** Serialize Resource source map */
550
- static void serialize(const SourceMap<Resource>& resource, std::ostream &os)
551
- {
552
- os << " - "; // indent 2
553
-
554
- // Name
555
- serialize(SerializeKey::Name, resource.name, 2, os, true);
556
-
557
- // Description
558
- serialize(SerializeKey::Description, resource.description, 2, os);
559
-
560
- // URI Template
561
- serialize(SerializeKey::URITemplate, resource.uriTemplate, 2, os);
562
-
563
- // Model
564
- serialize(SerializeKey::Model, std::string(), 2, os);
565
-
566
- if (!resource.model.name.sourceMap.empty())
567
- serialize(resource.model, 3, false, os);
568
-
569
- // Parameters
570
- serialize(SerializeKey::Parameters, std::string(), 2, os);
571
-
572
- if (!resource.parameters.collection.empty())
573
- serialize(resource.parameters.collection, 2, os);
574
-
575
- // Actions
576
- serialize(SerializeKey::Actions, std::string(), 2, os);
577
-
578
- if (resource.actions.collection.empty())
579
- return;
580
-
581
- for (Collection<SourceMap<Action> >::const_iterator it = resource.actions.collection.begin();
582
- it != resource.actions.collection.end();
583
- ++it) {
584
-
585
- serialize(*it, os);
586
- }
587
- }
588
-
589
- /** Serialize Resource Group */
590
- static void serialize(const ResourceGroup& group, std::ostream &os)
591
- {
592
- os << "- "; // indent 1
593
-
594
- // Name
595
- serialize(SerializeKey::Name, group.name, 0, os);
596
-
597
- // Description
598
- serialize(SerializeKey::Description, group.description, 1, os);
599
-
600
- // Resources
601
- serialize(SerializeKey::Resources, std::string(), 1, os);
602
-
603
- if (group.resources.empty())
604
- return;
605
-
606
- for (Collection<Resource>::const_iterator it = group.resources.begin();
607
- it != group.resources.end();
608
- ++it) {
609
-
610
- serialize(*it, os);
611
- }
612
- }
613
-
614
- /** Serialize Resource Group source map */
615
- static void serialize(const SourceMap<ResourceGroup>& group, std::ostream &os)
616
- {
617
- os << "- "; // indent 1
618
-
619
- // Name
620
- serialize(SerializeKey::Name, group.name, 1, os, true);
621
-
622
- // Description
623
- serialize(SerializeKey::Description, group.description, 1, os);
624
-
625
- // Resources
626
- serialize(SerializeKey::Resources, std::string(), 1, os);
627
-
628
- if (group.resources.collection.empty())
629
- return;
630
-
631
- for (Collection<SourceMap<Resource> >::const_iterator it = group.resources.collection.begin();
632
- it != group.resources.collection.end();
633
- ++it) {
634
-
635
- serialize(*it, os);
636
- }
637
- }
638
-
639
- /** Serialize Blueprint */
640
- static void serialize(const Blueprint& blueprint, std::ostream &os)
641
- {
642
- // AST Version
643
- serialize(SerializeKey::ASTVersion, AST_SERIALIZATION_VERSION, 0, os, false);
644
-
645
- // Metadata
646
- serialize(blueprint.metadata, os);
647
-
648
- // API Name
649
- serialize(SerializeKey::Name, blueprint.name, 0, os);
650
-
651
- // API Description
652
- serialize(SerializeKey::Description, blueprint.description, 0, os);
653
-
654
- // Resource Groups
655
- serialize(SerializeKey::ResourceGroups, std::string(), 0, os);
656
-
657
- if (blueprint.resourceGroups.empty())
658
- return;
659
-
660
- for (Collection<ResourceGroup>::type::const_iterator it = blueprint.resourceGroups.begin();
661
- it != blueprint.resourceGroups.end();
662
- ++it) {
663
-
664
- serialize(*it, os);
665
- }
666
- }
667
-
668
- /** Serialize Blueprint source map */
669
- static void serialize(const SourceMap<Blueprint>& blueprint, std::ostream &os)
670
- {
671
- // Metadata
672
- serialize(blueprint.metadata.collection, os);
673
-
674
- // API Name
675
- serialize(SerializeKey::Name, blueprint.name, 0, os);
676
-
677
- // API Description
678
- serialize(SerializeKey::Description, blueprint.description, 0, os);
679
-
680
- // Resource Groups
681
- serialize(SerializeKey::ResourceGroups, std::string(), 0, os);
682
-
683
- if (blueprint.resourceGroups.collection.empty())
684
- return;
685
-
686
- for (Collection<SourceMap<ResourceGroup> >::type::const_iterator it = blueprint.resourceGroups.collection.begin();
687
- it != blueprint.resourceGroups.collection.end();
688
- ++it) {
689
-
690
- serialize(*it, os);
691
- }
692
- }
693
-
694
- void snowcrash::SerializeYAML(const snowcrash::Blueprint& blueprint, std::ostream &os)
695
- {
696
- serialize(blueprint, os);
697
- }
698
-
699
- void snowcrash::SerializeSourceMapYAML(const snowcrash::SourceMap<snowcrash::Blueprint>& blueprint, std::ostream &os)
700
- {
701
- serialize(blueprint, os);
702
- }