redsnow 0.3.7 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/Rakefile +4 -4
- data/ext/drafter/Makefile +54 -0
- data/ext/drafter/appveyor.yml +10 -0
- data/ext/drafter/bin/drafter +0 -0
- data/ext/{snowcrash → drafter}/build/Makefile +29 -14
- data/ext/{snowcrash/build/snowcrash.Makefile → drafter/build/drafter.Makefile} +1 -1
- data/ext/{snowcrash/build/snowcrash.target.mk → drafter/build/drafter.target.mk} +25 -23
- data/ext/{snowcrash/build → drafter/build/ext/snowcrash}/libmarkdownparser.target.mk +7 -7
- data/ext/drafter/build/ext/snowcrash/libsnowcrash.target.mk +152 -0
- data/ext/{snowcrash/build → drafter/build/ext/snowcrash}/libsundown.target.mk +13 -13
- data/ext/{snowcrash/build → drafter/build/ext/snowcrash}/perf-libsnowcrash.target.mk +14 -20
- data/ext/drafter/build/ext/snowcrash/snowcrash.Makefile +6 -0
- data/ext/{snowcrash → drafter}/build/gyp-mac-tool +0 -0
- data/ext/{snowcrash/build/libsnowcrash.target.mk → drafter/build/libdrafter.target.mk} +29 -36
- data/ext/drafter/build/libsos.target.mk +133 -0
- data/ext/drafter/build/out/Release/drafter +0 -0
- data/ext/drafter/build/out/Release/libdrafter.dylib +0 -0
- data/ext/drafter/build/out/Release/libmarkdownparser.a +0 -0
- data/ext/drafter/build/out/Release/libsnowcrash.a +0 -0
- data/ext/drafter/build/out/Release/libsos.a +0 -0
- data/ext/{snowcrash → drafter}/build/out/Release/libsundown.a +0 -0
- data/ext/{snowcrash → drafter}/build/out/Release/linker.lock +0 -0
- data/ext/drafter/build/out/Release/obj.target/drafter/src/config.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/drafter/src/main.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/drafter/src/reporting.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libdrafter/src/Serialize.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libdrafter/src/SerializeAST.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libdrafter/src/SerializeResult.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libdrafter/src/SerializeSourcemap.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libdrafter/src/cdrafter.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libdrafter/src/drafter.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libmarkdownparser/ext/snowcrash/ext/markdown-parser/src/ByteBuffer.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libmarkdownparser/ext/snowcrash/ext/markdown-parser/src/MarkdownNode.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libmarkdownparser/ext/snowcrash/ext/markdown-parser/src/MarkdownParser.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/Blueprint.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/BlueprintSourcemap.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/HTTP.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/HeadersParser.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/MSON.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/MSONOneOfParser.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/MSONSourcemap.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/MSONTypeSectionParser.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/MSONValueMemberParser.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/Section.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/Signature.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/UriTemplateParser.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/posix/RegexMatch.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/snowcrash.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libsos/ext/sos/src/sos.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libsundown/ext/snowcrash/ext/markdown-parser/ext/sundown/html/houdini_href_e.o +0 -0
- data/ext/drafter/build/out/Release/obj.target/libsundown/ext/snowcrash/ext/markdown-parser/ext/sundown/html/houdini_html_e.o +0 -0
- 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
- 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
- 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
- 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
- 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
- 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
- data/ext/drafter/build/out/Release/obj.target/libsundown/ext/snowcrash/ext/markdown-parser/ext/sundown/src/stack.o +0 -0
- data/ext/drafter/circle.yml +12 -0
- data/ext/{snowcrash → drafter}/config.gypi +1 -1
- data/ext/{snowcrash → drafter}/config.mk +0 -0
- data/ext/{snowcrash → drafter}/configure +16 -5
- data/ext/drafter/drafter.gyp +118 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/Makefile +4 -12
- data/ext/{snowcrash → drafter/ext/snowcrash}/Vagrantfile +14 -4
- data/ext/drafter/ext/snowcrash/appveyor.yml +7 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/common.gypi +0 -0
- data/ext/drafter/ext/snowcrash/configure +197 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/Makefile +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/CONTRIBUTING.md +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/Makefile +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/Makefile.win +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/examples/smartypants.c +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/examples/sundown.c +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/html/houdini.h +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/html/houdini_href_e.c +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/html/houdini_html_e.c +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/html/html.c +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/html/html.h +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/html/html_smartypants.c +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/html_block_names.txt +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/src/autolink.c +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/src/autolink.h +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/src/buffer.c +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/src/buffer.h +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/src/html_blocks.h +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/src/markdown.c +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/src/markdown.h +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/src/src_map.c +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/src/src_map.h +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/src/stack.c +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/src/stack.h +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/ext/sundown/sundown.def +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/msvc/markdown/markdown.vcproj +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/msvc/msvc.sln +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/msvc/sundown/sundown.vcproj +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/src/ByteBuffer.cc +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/src/ByteBuffer.h +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/src/MarkdownNode.cc +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/src/MarkdownNode.h +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/src/MarkdownParser.cc +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/ext/markdown-parser/src/MarkdownParser.h +10 -2
- data/ext/{snowcrash → drafter/ext/snowcrash}/provisioning.sh +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/snowcrash.gyp +41 -39
- data/ext/{snowcrash → drafter/ext/snowcrash}/snowcrash.xcworkspace/contents.xcworkspacedata +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/ActionParser.h +50 -6
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/AssetParser.h +1 -12
- data/ext/drafter/ext/snowcrash/src/AttributesParser.h +121 -0
- data/ext/drafter/ext/snowcrash/src/Blueprint.cc +90 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/Blueprint.h +169 -33
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/BlueprintParser.h +305 -48
- data/ext/drafter/ext/snowcrash/src/BlueprintSourcemap.cc +81 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/BlueprintSourcemap.h +130 -39
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/BlueprintUtility.h +10 -4
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/CodeBlockUtility.h +1 -1
- data/ext/drafter/ext/snowcrash/src/DataStructureGroupParser.h +154 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/HTTP.cc +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/HTTP.h +0 -0
- data/ext/drafter/ext/snowcrash/src/HeadersParser.cc +110 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/HeadersParser.h +123 -54
- data/ext/drafter/ext/snowcrash/src/MSON.cc +272 -0
- data/ext/drafter/ext/snowcrash/src/MSON.h +399 -0
- data/ext/drafter/ext/snowcrash/src/MSONMixinParser.h +95 -0
- data/ext/drafter/ext/snowcrash/src/MSONNamedTypeParser.h +108 -0
- data/ext/drafter/ext/snowcrash/src/MSONOneOfParser.cc +132 -0
- data/ext/drafter/ext/snowcrash/src/MSONOneOfParser.h +80 -0
- data/ext/drafter/ext/snowcrash/src/MSONParameterParser.h +232 -0
- data/ext/drafter/ext/snowcrash/src/MSONPropertyMemberParser.h +91 -0
- data/ext/drafter/ext/snowcrash/src/MSONSourcemap.cc +141 -0
- data/ext/drafter/ext/snowcrash/src/MSONSourcemap.h +181 -0
- data/ext/drafter/ext/snowcrash/src/MSONTypeSectionParser.cc +209 -0
- data/ext/drafter/ext/snowcrash/src/MSONTypeSectionParser.h +213 -0
- data/ext/drafter/ext/snowcrash/src/MSONUtility.h +423 -0
- data/ext/drafter/ext/snowcrash/src/MSONValueMemberParser.cc +179 -0
- data/ext/drafter/ext/snowcrash/src/MSONValueMemberParser.h +346 -0
- data/ext/drafter/ext/snowcrash/src/ModelTable.h +87 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/ParameterParser.h +120 -61
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/ParametersParser.h +17 -18
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/PayloadParser.h +36 -18
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/Platform.h +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/RegexMatch.h +0 -0
- data/ext/drafter/ext/snowcrash/src/RelationParser.h +75 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/ResourceGroupParser.h +127 -33
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/ResourceParser.h +126 -33
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/Section.cc +6 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/Section.h +15 -2
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/SectionParser.h +3 -1
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/SectionParserData.h +15 -5
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/SectionProcessor.h +24 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/Signature.cc +14 -0
- data/ext/drafter/ext/snowcrash/src/Signature.h +80 -0
- data/ext/drafter/ext/snowcrash/src/SignatureSectionProcessor.h +439 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/SourceAnnotation.h +3 -2
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/StringUtility.h +103 -6
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/UriTemplateParser.cc +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/UriTemplateParser.h +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/ValuesParser.h +1 -13
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/posix/RegexMatch.cc +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/snowcrash.cc +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/snowcrash.h +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/src/win/RegexMatch.cc +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/AUTHORS +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/DEPS +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/OWNERS +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/PRESUBMIT.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/buildbot/buildbot_run.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/codereview.settings +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/data/win/large-pdb-shim.cc +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/gyp +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/gyp.bat +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/gyp_main.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/MSVSNew.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/MSVSProject.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/MSVSSettings.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/MSVSToolFile.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/MSVSUserFile.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/MSVSUtil.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/MSVSVersion.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/__init__.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/__init__.pyc +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/common.py +0 -0
- data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/common.pyc +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/easy_xml.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/flock_tool.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/generator/__init__.py +0 -0
- data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/generator/__init__.pyc +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/generator/android.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/generator/cmake.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/generator/dump_dependency_json.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/generator/eclipse.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/generator/gypd.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/generator/gypsh.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/generator/make.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/generator/make.pyc +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/generator/msvs.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/generator/ninja.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/generator/xcode.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/generator/xcode.pyc +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/input.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/input.pyc +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/mac_tool.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/msvs_emulation.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/ninja_syntax.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/ordered_dict.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/win_tool.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/xcode_emulation.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/xcode_emulation.pyc +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/xcodeproj_file.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/xcodeproj_file.pyc +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylib/gyp/xml_fix.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/pylintrc +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/samples/samples +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/samples/samples.bat +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/setup.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/tools/Xcode/Specifications/gyp.pbfilespec +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/tools/Xcode/Specifications/gyp.xclangspec +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/tools/emacs/gyp.el +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/tools/graphviz.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/tools/pretty_gyp.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/tools/pretty_sln.py +0 -0
- data/ext/{snowcrash → drafter/ext/snowcrash}/tools/gyp/tools/pretty_vcproj.py +0 -0
- data/ext/drafter/ext/snowcrash/vcbuild.bat +139 -0
- data/ext/drafter/ext/sos/Makefile +57 -0
- data/ext/drafter/ext/sos/src/sos.cc +200 -0
- data/ext/drafter/ext/sos/src/sos.h +179 -0
- data/ext/drafter/ext/sos/src/sosJSON.h +105 -0
- data/ext/drafter/ext/sos/src/sosYAML.h +104 -0
- data/ext/{snowcrash → drafter}/src/Serialize.cc +30 -15
- data/ext/drafter/src/Serialize.h +135 -0
- data/ext/drafter/src/SerializeAST.cc +775 -0
- data/ext/drafter/src/SerializeAST.h +19 -0
- data/ext/drafter/src/SerializeResult.cc +67 -0
- data/ext/drafter/src/SerializeResult.h +26 -0
- data/ext/drafter/src/SerializeSourcemap.cc +446 -0
- data/ext/drafter/src/SerializeSourcemap.h +19 -0
- data/ext/drafter/src/Version.h +38 -0
- data/ext/drafter/src/cdrafter.cc +44 -0
- data/ext/drafter/src/cdrafter.h +55 -0
- data/ext/drafter/src/config.cc +80 -0
- data/ext/drafter/src/config.h +35 -0
- data/ext/drafter/src/drafter.cc +22 -0
- data/ext/drafter/src/drafter.h +38 -0
- data/ext/drafter/src/main.cc +91 -0
- data/ext/drafter/src/reporting.cc +162 -0
- data/ext/drafter/src/reporting.h +28 -0
- data/ext/drafter/src/stream.h +146 -0
- data/ext/drafter/tools/homebrew/drafter.rb +12 -0
- data/ext/{snowcrash → drafter}/vcbuild.bat +3 -3
- data/lib/redsnow.rb +6 -11
- data/lib/redsnow/binding.rb +11 -201
- data/lib/redsnow/blueprint.rb +104 -169
- data/lib/redsnow/parseresult.rb +28 -42
- data/lib/redsnow/sourcemap.rb +92 -177
- data/lib/redsnow/version.rb +1 -1
- data/redsnow.gemspec +1 -1
- metadata +249 -197
- data/ext/snowcrash/bin/snowcrash +0 -0
- data/ext/snowcrash/build/out/Release/libmarkdownparser.a +0 -0
- data/ext/snowcrash/build/out/Release/libsnowcrash.dylib +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libmarkdownparser/ext/markdown-parser/src/ByteBuffer.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libmarkdownparser/ext/markdown-parser/src/MarkdownNode.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libmarkdownparser/ext/markdown-parser/src/MarkdownParser.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/CBlueprint.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/CBlueprintSourcemap.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/CSourceAnnotation.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/HTTP.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/Section.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/Serialize.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/SerializeJSON.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/SerializeYAML.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/Signature.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/UriTemplateParser.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/csnowcrash.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/posix/RegexMatch.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/snowcrash.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsundown/ext/markdown-parser/ext/sundown/html/houdini_href_e.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsundown/ext/markdown-parser/ext/sundown/html/houdini_html_e.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsundown/ext/markdown-parser/ext/sundown/src/stack.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/snowcrash/src/snowcrash/snowcrash.o +0 -0
- data/ext/snowcrash/build/out/Release/snowcrash +0 -0
- data/ext/snowcrash/src/CBlueprint.cc +0 -628
- data/ext/snowcrash/src/CBlueprint.h +0 -366
- data/ext/snowcrash/src/CBlueprintSourcemap.cc +0 -630
- data/ext/snowcrash/src/CBlueprintSourcemap.h +0 -351
- data/ext/snowcrash/src/CSourceAnnotation.cc +0 -154
- data/ext/snowcrash/src/CSourceAnnotation.h +0 -106
- data/ext/snowcrash/src/Serialize.h +0 -71
- data/ext/snowcrash/src/SerializeJSON.cc +0 -1221
- data/ext/snowcrash/src/SerializeJSON.h +0 -24
- data/ext/snowcrash/src/SerializeYAML.cc +0 -702
- data/ext/snowcrash/src/SerializeYAML.h +0 -24
- data/ext/snowcrash/src/Signature.h +0 -32
- data/ext/snowcrash/src/SymbolTable.h +0 -94
- data/ext/snowcrash/src/Version.h +0 -39
- data/ext/snowcrash/src/csnowcrash.cc +0 -29
- data/ext/snowcrash/src/csnowcrash.h +0 -40
- data/ext/snowcrash/src/snowcrash/snowcrash.cc +0 -200
- data/ext/snowcrash/tools/gyp/pylib/gyp/common.pyc +0 -0
- data/ext/snowcrash/tools/gyp/pylib/gyp/generator/__init__.pyc +0 -0
- data/ext/snowcrash/tools/homebrew/snowcrash.rb +0 -12
data/lib/redsnow/blueprint.rb
CHANGED
@@ -14,7 +14,7 @@ module RedSnow
|
|
14
14
|
#
|
15
15
|
# @attr id [String] identifier of the reference
|
16
16
|
#
|
17
|
-
# @
|
17
|
+
# @abstract
|
18
18
|
class ReferenceNode < BlueprintNode
|
19
19
|
attr_accessor :id
|
20
20
|
|
@@ -23,7 +23,7 @@ module RedSnow
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
# Blueprint AST node with name
|
26
|
+
# Blueprint AST node with name && description associated
|
27
27
|
#
|
28
28
|
# @attr name [String] name of the node
|
29
29
|
# @attr description [String] description of the node
|
@@ -40,10 +40,10 @@ module RedSnow
|
|
40
40
|
def ensure_description_newlines(buffer)
|
41
41
|
return if description.empty?
|
42
42
|
|
43
|
-
if description[-1, 1] !=
|
44
|
-
buffer <<
|
45
|
-
elsif description.length > 1 && description[-2, 1] !=
|
46
|
-
buffer <<
|
43
|
+
if description[-1, 1] != '\n'
|
44
|
+
buffer << '\n\n'
|
45
|
+
elsif description.length > 1 && description[-2, 1] != '\n'
|
46
|
+
buffer << '\n'
|
47
47
|
end
|
48
48
|
end
|
49
49
|
end
|
@@ -87,19 +87,13 @@ module RedSnow
|
|
87
87
|
# Metadata collection Blueprint AST node
|
88
88
|
# represents 'metadata section'
|
89
89
|
class Metadata < KeyValueCollection
|
90
|
-
#
|
91
|
-
|
92
|
-
|
93
|
-
sc_metadata_collection_size = RedSnow::Binding.sc_metadata_collection_size(sc_metadata_collection_handle)
|
94
|
-
@collection = []
|
95
|
-
|
96
|
-
return if sc_metadata_collection_size == 0
|
90
|
+
# @param metadata [json]
|
91
|
+
def initialize(metadata)
|
92
|
+
return if metadata.nil?
|
97
93
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
sc_metadata_handle = RedSnow::Binding.sc_metadata_handle(sc_metadata_collection_handle, index)
|
102
|
-
@collection << Hash[name: RedSnow::Binding.sc_metadata_key(sc_metadata_handle), value: RedSnow::Binding.sc_metadata_value(sc_metadata_handle)]
|
94
|
+
@collection = []
|
95
|
+
metadata.each do |item|
|
96
|
+
@collection << Hash[name: item['name'], value: item.fetch('value', nil)]
|
103
97
|
end
|
104
98
|
end
|
105
99
|
end
|
@@ -116,18 +110,14 @@ module RedSnow
|
|
116
110
|
(content_type_header.nil?) ? nil : content_type_header[CONTENT_TYPE_HEADER_KEY]
|
117
111
|
end
|
118
112
|
|
119
|
-
# @param
|
120
|
-
def initialize(
|
121
|
-
sc_header_collection_size = RedSnow::Binding.sc_header_collection_size(sc_header_collection_handle_payload)
|
113
|
+
# @param headers [json]
|
114
|
+
def initialize(headers)
|
122
115
|
@collection = []
|
123
116
|
|
124
|
-
return if
|
117
|
+
return if headers.nil?
|
125
118
|
|
126
|
-
|
127
|
-
|
128
|
-
(0..headers_size).each do |index|
|
129
|
-
sc_header_handle = RedSnow::Binding.sc_header_handle(sc_header_collection_handle_payload, index)
|
130
|
-
@collection << Hash[name: RedSnow::Binding.sc_header_key(sc_header_handle), value: RedSnow::Binding.sc_header_value(sc_header_handle)]
|
119
|
+
headers.each do |item|
|
120
|
+
@collection << Hash[name: item['name'], value: item['value']]
|
131
121
|
end
|
132
122
|
end
|
133
123
|
end
|
@@ -149,27 +139,27 @@ module RedSnow
|
|
149
139
|
attr_accessor :example_value
|
150
140
|
attr_accessor :values
|
151
141
|
|
152
|
-
# @param
|
153
|
-
def initialize(
|
154
|
-
@name =
|
155
|
-
@description =
|
156
|
-
@type =
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
return if sc_value_collection_size == 0
|
142
|
+
# @param parameter [json]
|
143
|
+
def initialize(parameter)
|
144
|
+
@name = parameter.fetch('name', '')
|
145
|
+
@description = parameter.fetch('description', '')
|
146
|
+
@type = parameter.fetch('type', '')
|
147
|
+
|
148
|
+
case parameter['required']
|
149
|
+
when true
|
150
|
+
@use = :required
|
151
|
+
when false
|
152
|
+
@use = :optional
|
153
|
+
else
|
154
|
+
@use = :undefined
|
155
|
+
end
|
167
156
|
|
168
|
-
|
157
|
+
@default_value = parameter.fetch('default', nil)
|
158
|
+
@example_value = parameter.fetch('example', nil)
|
169
159
|
|
170
|
-
|
171
|
-
|
172
|
-
@values <<
|
160
|
+
@values = []
|
161
|
+
parameter.key?('values') && parameter['values'].each do |value|
|
162
|
+
@values << value['value']
|
173
163
|
end
|
174
164
|
end
|
175
165
|
end
|
@@ -181,18 +171,14 @@ module RedSnow
|
|
181
171
|
class Parameters < BlueprintNode
|
182
172
|
attr_accessor :collection
|
183
173
|
|
184
|
-
# @param
|
185
|
-
def initialize(
|
186
|
-
sc_parameter_collection_size = RedSnow::Binding.sc_parameter_collection_size(sc_parameter_collection_handle)
|
174
|
+
# @param parameters [json]
|
175
|
+
def initialize(parameters)
|
187
176
|
@collection = []
|
188
177
|
|
189
|
-
return if
|
190
|
-
|
191
|
-
parameters_size = sc_parameter_collection_size - 1
|
178
|
+
return if parameters.nil?
|
192
179
|
|
193
|
-
|
194
|
-
|
195
|
-
@collection << Parameter.new(sc_parameter_handle)
|
180
|
+
parameters.each do |item|
|
181
|
+
@collection << Parameter.new(item)
|
196
182
|
end
|
197
183
|
end
|
198
184
|
end
|
@@ -212,22 +198,18 @@ module RedSnow
|
|
212
198
|
attr_accessor :schema
|
213
199
|
attr_accessor :reference
|
214
200
|
|
215
|
-
# @param
|
216
|
-
def initialize(
|
217
|
-
@name =
|
218
|
-
@description =
|
219
|
-
@body =
|
220
|
-
@schema =
|
201
|
+
# @param payload [json]
|
202
|
+
def initialize(payload)
|
203
|
+
@name = payload.fetch('name', '')
|
204
|
+
@description = payload.fetch('description', '')
|
205
|
+
@body = payload.fetch('body', '')
|
206
|
+
@schema = payload.fetch('schema', '')
|
221
207
|
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
unless sc_reference_id.empty?
|
226
|
-
@reference = ReferenceNode.new(sc_reference_id)
|
208
|
+
if payload.key?('reference') && payload['reference'].key?('id')
|
209
|
+
@reference = ReferenceNode.new(payload['reference']['id'])
|
227
210
|
end
|
228
211
|
|
229
|
-
|
230
|
-
@headers = Headers.new(sc_header_collection_handle_payload)
|
212
|
+
@headers = Headers.new(payload.fetch('headers', nil))
|
231
213
|
end
|
232
214
|
end
|
233
215
|
|
@@ -239,42 +221,24 @@ module RedSnow
|
|
239
221
|
attr_accessor :requests
|
240
222
|
attr_accessor :responses
|
241
223
|
|
242
|
-
# @param
|
243
|
-
def initialize(
|
244
|
-
@name
|
245
|
-
@description =
|
224
|
+
# @param example [json]
|
225
|
+
def initialize(example)
|
226
|
+
@name = example.fetch('name', '')
|
227
|
+
@description = example.fetch('description', '')
|
246
228
|
|
247
|
-
# BP Resource Actions Examples Requests
|
248
229
|
@requests = []
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
requests_size = sc_payload_collection_size_requests - 1
|
254
|
-
|
255
|
-
(0..requests_size).each do |index|
|
256
|
-
sc_payload_handle = RedSnow::Binding.sc_payload_handle(sc_payload_collection_handle_requests, index)
|
257
|
-
@requests << Payload.new(sc_payload_handle).tap do |payload|
|
258
|
-
example_instance = self
|
259
|
-
payload.define_singleton_method(:example) { example_instance }
|
260
|
-
end
|
230
|
+
example.key?('requests') && example['requests'].each do |request|
|
231
|
+
@requests << Payload.new(request).tap do |inst|
|
232
|
+
example_instance = self
|
233
|
+
inst.define_singleton_method(:example) { example_instance }
|
261
234
|
end
|
262
235
|
end
|
263
236
|
|
264
|
-
# BP Resource Actions Examples Responses
|
265
237
|
@responses = []
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
return if sc_payload_collection_size_responses == 0
|
270
|
-
|
271
|
-
responses_size = sc_payload_collection_size_responses - 1
|
272
|
-
|
273
|
-
(0..responses_size).each do |index|
|
274
|
-
sc_payload_handle = RedSnow::Binding.sc_payload_handle(sc_payload_collection_handle_responses, index)
|
275
|
-
@responses << Payload.new(sc_payload_handle).tap do |payload|
|
238
|
+
example.key?('responses') && example['responses'].each do |response|
|
239
|
+
@responses << Payload.new(response).tap do |inst|
|
276
240
|
example_instance = self
|
277
|
-
|
241
|
+
inst.define_singleton_method(:example) { example_instance }
|
278
242
|
end
|
279
243
|
end
|
280
244
|
end
|
@@ -286,33 +250,34 @@ module RedSnow
|
|
286
250
|
# @attr method [String] HTTP request method or nil
|
287
251
|
# @attr parameters [Parameters] action-specific URI parameters or nil
|
288
252
|
# @attr examples [Array<TransactionExample>] action transaction examples
|
253
|
+
# @attr relation [String] action relation attribute
|
254
|
+
# @attr uri_template [String] action uri template attribute
|
289
255
|
class Action < NamedBlueprintNode
|
290
256
|
attr_accessor :method
|
291
257
|
attr_accessor :parameters
|
292
258
|
attr_accessor :examples
|
259
|
+
attr_accessor :relation
|
260
|
+
attr_accessor :uri_template
|
293
261
|
|
294
|
-
# @param
|
295
|
-
def initialize(
|
296
|
-
@name =
|
297
|
-
@description =
|
298
|
-
|
299
|
-
@method = RedSnow::Binding.sc_action_httpmethod(sc_action_handle)
|
300
|
-
|
301
|
-
@parameters = Parameters.new(RedSnow::Binding.sc_parameter_collection_handle_action(sc_action_handle))
|
262
|
+
# @param action [json]
|
263
|
+
def initialize(action)
|
264
|
+
@name = action.fetch('name', '')
|
265
|
+
@description = action.fetch('description', '')
|
302
266
|
|
303
|
-
@
|
304
|
-
sc_transaction_example_collection_handle = RedSnow::Binding.sc_transaction_example_collection_handle(sc_action_handle)
|
305
|
-
sc_transaction_example_collection_size = RedSnow::Binding.sc_transaction_example_collection_size(sc_transaction_example_collection_handle)
|
267
|
+
@method = action.fetch('method', '')
|
306
268
|
|
307
|
-
|
269
|
+
@parameters = Parameters.new(action.fetch('parameters', nil))
|
308
270
|
|
309
|
-
|
271
|
+
if action.key?('attributes')
|
272
|
+
@relation = action['attributes'].fetch('relation', '')
|
273
|
+
@uri_template = action['attributes'].fetch('uriTemplate', '')
|
274
|
+
end
|
310
275
|
|
311
|
-
|
312
|
-
|
313
|
-
@examples << TransactionExample.new(
|
276
|
+
@examples = []
|
277
|
+
action.key?('examples') && action['examples'].each do |example|
|
278
|
+
@examples << TransactionExample.new(example).tap do |inst|
|
314
279
|
action_instance = self
|
315
|
-
|
280
|
+
inst.define_singleton_method(:action) { action_instance }
|
316
281
|
end
|
317
282
|
end
|
318
283
|
end
|
@@ -331,30 +296,21 @@ module RedSnow
|
|
331
296
|
attr_accessor :parameters
|
332
297
|
attr_accessor :actions
|
333
298
|
|
334
|
-
# @param
|
335
|
-
def initialize(
|
336
|
-
@name =
|
337
|
-
@description =
|
338
|
-
@uri_template =
|
299
|
+
# @param resource [json]
|
300
|
+
def initialize(resource)
|
301
|
+
@name = resource.fetch('name', '')
|
302
|
+
@description = resource.fetch('description', '')
|
303
|
+
@uri_template = resource.fetch('uriTemplate', '')
|
339
304
|
|
340
|
-
|
341
|
-
@model = Payload.new(sc_payload_handle_resource)
|
305
|
+
@model = Payload.new(resource.fetch('model', nil))
|
342
306
|
|
343
|
-
@parameters = Parameters.new(
|
307
|
+
@parameters = Parameters.new(resource.fetch('parameters', nil))
|
344
308
|
|
345
309
|
@actions = []
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
return if sc_action_collection_size == 0
|
350
|
-
|
351
|
-
action_size = sc_action_collection_size - 1
|
352
|
-
|
353
|
-
(0..action_size).each do |index|
|
354
|
-
sc_action_handle = RedSnow::Binding.sc_action_handle(sc_action_collection_handle, index)
|
355
|
-
@actions << Action.new(sc_action_handle).tap do |action|
|
310
|
+
resource.key?('actions') && resource['actions'].each do |action|
|
311
|
+
@actions << Action.new(action).tap do |inst|
|
356
312
|
resource_instance = self
|
357
|
-
|
313
|
+
inst.define_singleton_method(:resource) { resource_instance }
|
358
314
|
end
|
359
315
|
end
|
360
316
|
end
|
@@ -367,24 +323,16 @@ module RedSnow
|
|
367
323
|
class ResourceGroup < NamedBlueprintNode
|
368
324
|
attr_accessor :resources
|
369
325
|
|
370
|
-
# @param
|
371
|
-
def initialize(
|
372
|
-
@name =
|
373
|
-
@description =
|
326
|
+
# @param resource_group [json]
|
327
|
+
def initialize(resource_group)
|
328
|
+
@name = resource_group.fetch('name', '')
|
329
|
+
@description = resource_group.fetch('description', '')
|
374
330
|
|
375
331
|
@resources = []
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
return if sc_resource_collection_size == 0
|
380
|
-
|
381
|
-
resource_size = sc_resource_collection_size - 1
|
382
|
-
|
383
|
-
(0..resource_size).each do |index|
|
384
|
-
sc_resource_handle = RedSnow::Binding.sc_resource_handle(sc_resource_collection_handle, index)
|
385
|
-
@resources << Resource.new(sc_resource_handle).tap do |resource|
|
332
|
+
resource_group.key?('resources') && resource_group['resources'].each do |resource|
|
333
|
+
@resources << Resource.new(resource).tap do |inst|
|
386
334
|
resource_group_instance = self
|
387
|
-
|
335
|
+
inst.define_singleton_method(:resource_group) { resource_group_instance }
|
388
336
|
end
|
389
337
|
end
|
390
338
|
end
|
@@ -403,30 +351,17 @@ module RedSnow
|
|
403
351
|
VERSION_KEY = :_version
|
404
352
|
|
405
353
|
# Supported version of Api Blueprint
|
406
|
-
SUPPORTED_VERSIONS = ['
|
354
|
+
SUPPORTED_VERSIONS = ['3.0']
|
407
355
|
|
408
|
-
# @param
|
409
|
-
def initialize(
|
410
|
-
|
411
|
-
@
|
412
|
-
@
|
356
|
+
# @param ast [json]
|
357
|
+
def initialize(ast)
|
358
|
+
@name = ast.fetch('name', '')
|
359
|
+
@description = ast.fetch('description', '')
|
360
|
+
@metadata = Metadata.new(ast.fetch('metadata', nil))
|
413
361
|
|
414
|
-
# BP metadata
|
415
|
-
sc_metadata_collection_handle = RedSnow::Binding.sc_metadata_collection_handle(handle)
|
416
|
-
@metadata = Metadata.new(sc_metadata_collection_handle)
|
417
|
-
|
418
|
-
# BP Resource Groups
|
419
|
-
sc_resource_group_collection_handle = RedSnow::Binding.sc_resource_group_collection_handle(handle)
|
420
|
-
sc_resource_group_collection_size = RedSnow::Binding.sc_resource_group_collection_size(sc_resource_group_collection_handle)
|
421
362
|
@resource_groups = []
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
group_size = sc_resource_group_collection_size - 1
|
426
|
-
|
427
|
-
(0..group_size).each do |index|
|
428
|
-
sc_resource_group_handle = RedSnow::Binding.sc_resource_group_handle(sc_resource_group_collection_handle, index)
|
429
|
-
@resource_groups << ResourceGroup.new(sc_resource_group_handle)
|
363
|
+
ast.key?('resourceGroups') && ast['resourceGroups'].each do |resource_group|
|
364
|
+
@resource_groups << ResourceGroup.new(resource_group)
|
430
365
|
end
|
431
366
|
end
|
432
367
|
end
|
data/lib/redsnow/parseresult.rb
CHANGED
@@ -1,8 +1,10 @@
|
|
1
|
+
require 'json'
|
2
|
+
|
1
3
|
module RedSnow
|
2
4
|
# Parse Result
|
3
5
|
# @see https://github.com/apiaryio/api-blueprint-ast/blob/master/Parse%20Result.md
|
4
6
|
# @param ast [Blueprint]
|
5
|
-
# @param error [Hash] Description of a parsing error as occurred during parsing. If this field is present
|
7
|
+
# @param error [Hash] Description of a parsing error as occurred during parsing. If this field is present && code different from 0 then the content of ast field should be ignored.
|
6
8
|
# @param warnings [Array<Hash>] Ordered array of parser warnings as occurred during the parsing.
|
7
9
|
# @param sourcemap [BlueprintSourcemap]
|
8
10
|
class ParseResult
|
@@ -17,51 +19,36 @@ module RedSnow
|
|
17
19
|
# Supported version of Api Blueprint
|
18
20
|
SUPPORTED_VERSIONS = ['2.1']
|
19
21
|
|
20
|
-
# @param
|
21
|
-
def initialize(
|
22
|
-
|
23
|
-
@sourcemap = RedSnow::Sourcemap::Blueprint.new(sourcemap_handle)
|
22
|
+
# @param parse_result [ string or nil ]
|
23
|
+
def initialize(parse_result)
|
24
|
+
parse_result = JSON.parse(parse_result)
|
24
25
|
|
25
|
-
|
26
|
-
|
26
|
+
@ast = Blueprint.new(parse_result['ast'])
|
27
|
+
@sourcemap = RedSnow::Sourcemap::Blueprint.new(parse_result['sourcemap'])
|
27
28
|
|
28
29
|
@warnings = []
|
29
|
-
|
30
|
-
|
31
|
-
sc_warning_handler = RedSnow::Binding.sc_warning_handler(warnings, index)
|
32
|
-
|
33
|
-
warning = {}
|
34
|
-
warning[:message] = RedSnow::Binding.sc_warning_message(sc_warning_handler)
|
35
|
-
warning[:code] = RedSnow::Binding.sc_warning_code(sc_warning_handler)
|
36
|
-
warning[:ok] = RedSnow::Binding.sc_warning_ok(sc_warning_handler)
|
37
|
-
|
38
|
-
sc_location_handler = RedSnow::Binding.sc_location_handler(sc_warning_handler)
|
39
|
-
sc_location_size = RedSnow::Binding.sc_location_size(sc_location_handler)
|
40
|
-
warning[:location] = []
|
41
|
-
|
42
|
-
if sc_location_size > 0
|
43
|
-
(0..(sc_location_size - 1)).each do |index_size|
|
44
|
-
warning[:location] << Location.new(sc_location_handler, index_size)
|
45
|
-
end
|
46
|
-
end
|
47
|
-
@warnings << warning
|
30
|
+
parse_result.key?('warnings') && parse_result['warnings'].each do |warning|
|
31
|
+
@warnings << source_annotation(warning)
|
48
32
|
end
|
49
33
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
@error[:ok] = RedSnow::Binding.sc_error_ok(error_handler)
|
34
|
+
@error = source_annotation(parse_result['error'])
|
35
|
+
end
|
36
|
+
|
37
|
+
protected
|
55
38
|
|
56
|
-
|
57
|
-
|
58
|
-
@error[:location] = []
|
39
|
+
def source_annotation(json)
|
40
|
+
annotation = {}
|
59
41
|
|
60
|
-
|
42
|
+
annotation[:message] = json['message']
|
43
|
+
annotation[:code] = json['code']
|
44
|
+
annotation[:ok] = json.fetch('code', 0)
|
61
45
|
|
62
|
-
|
63
|
-
|
46
|
+
annotation[:location] = []
|
47
|
+
json.key?('location') && json['location'].each do |location|
|
48
|
+
annotation[:location] << Location.new(location)
|
64
49
|
end
|
50
|
+
|
51
|
+
annotation
|
65
52
|
end
|
66
53
|
end
|
67
54
|
|
@@ -72,11 +59,10 @@ module RedSnow
|
|
72
59
|
attr_accessor :index
|
73
60
|
attr_accessor :length
|
74
61
|
|
75
|
-
# @param
|
76
|
-
|
77
|
-
|
78
|
-
@
|
79
|
-
@index = RedSnow::Binding.sc_location_location(location_hander, index)
|
62
|
+
# @param location [json]
|
63
|
+
def initialize(location)
|
64
|
+
@length = location['length']
|
65
|
+
@index = location['index']
|
80
66
|
end
|
81
67
|
end
|
82
68
|
|