From d30b09fe2c1f6534dbb5192fd3b55d5d6d0b6870 Mon Sep 17 00:00:00 2001 From: Yessiest Date: Wed, 13 Sep 2023 02:23:23 +0400 Subject: [PATCH] Module restructuring, minor bugfixes, first template engine (incomplete), template engine example --- .yardoc/checksums | 35 +- .yardoc/object_types | Bin 5797 -> 7649 bytes .yardoc/objects/root.dat | Bin 108369 -> 137827 bytes .yardopts | 1 + README.md | 2 +- doc/Hyde.html | 20 +- doc/Hyde/CONNECTHandler.html | 2 +- doc/Hyde/DELETEHandler.html | 2 +- doc/Hyde/DSL.html | 11 +- doc/Hyde/DSL/CommonMethods.html | 337 +++++++ doc/Hyde/DSL/PathConstructors.html | 209 ++--- doc/Hyde/DSL/PathMethods.html | 65 +- doc/Hyde/DSL/ProbeConstructors.html | 207 +++++ doc/Hyde/DSL/ProbeMethods.html | 353 ++++---- doc/Hyde/DSL/TemplateMethods.html | 105 +++ doc/Hyde/GETHandler.html | 10 +- doc/Hyde/HEADHandler.html | 2 +- doc/Hyde/Handler.html | 30 +- doc/Hyde/Handlers.html | 127 +++ doc/Hyde/Handlers/CONNECT.html | 220 +++++ doc/Hyde/Handlers/DELETE.html | 220 +++++ doc/Hyde/Handlers/GET.html | 360 ++++++++ doc/Hyde/Handlers/HEAD.html | 220 +++++ doc/Hyde/Handlers/Handler.html | 597 ++++++++++++ doc/Hyde/Handlers/OPTIONS.html | 220 +++++ doc/Hyde/Handlers/PATCH.html | 220 +++++ doc/Hyde/Handlers/POST.html | 220 +++++ doc/Hyde/Handlers/PUT.html | 220 +++++ doc/Hyde/Handlers/Serve.html | 469 ++++++++++ doc/Hyde/Handlers/TRACE.html | 220 +++++ doc/Hyde/Node.html | 48 +- doc/Hyde/OPTIONSHandler.html | 2 +- doc/Hyde/PATCHHandler.html | 2 +- doc/Hyde/POSTHandler.html | 2 +- doc/Hyde/PUTHandler.html | 2 +- doc/Hyde/Path.html | 176 ++-- doc/Hyde/PathContext.html | 242 +++++ doc/Hyde/Pattern.html | 57 +- doc/Hyde/PatternMatching.html | 13 +- doc/Hyde/PatternMatching/Glob.html | 155 ++-- doc/Hyde/PatternMatching/ReMatch.html | 68 +- doc/Hyde/Probe.html | 64 +- doc/Hyde/ProbeContext.html | 249 +++++ doc/Hyde/ProcessorContext.html | 227 +++++ doc/Hyde/Request.html | 317 ++++--- doc/Hyde/Response.html | 87 +- doc/Hyde/ServeHandler.html | 20 +- doc/Hyde/Server.html | 47 +- doc/Hyde/ServerContext.html | 162 ++++ doc/Hyde/TRACEHandler.html | 2 +- doc/Hyde/Template.html | 763 ++++++++++++++++ doc/Hyde/TemplateContext.html | 249 +++++ doc/Hyde/Templates.html | 127 +++ doc/Hyde/Templates/ERB.html | 311 +++++++ doc/Hyde/Util.html | 414 ++++++++- doc/Hyde/Util/FormPart.html | 857 ++++++++++++++++++ doc/Hyde/Util/Lookup.html | 44 +- doc/Hyde/Util/MultipartParser.html | 487 ++++++++++ doc/Hyde/Util/ParserCommon.html | 120 +++ doc/Hyde/Util/Query.html | 175 +++- doc/_index.html | 171 +++- doc/class_list.html | 2 +- doc/file.README.html | 6 +- doc/index.html | 6 +- doc/method_list.html | 420 +++++++-- doc/top-level-namespace.html | 2 +- examples/extension_testing/extension.ru | 14 + .../extension_testing/external_methods.rb | 12 + examples/extension_testing/lib | 1 + examples/extension_testing/readme.txt | 1 + examples/form/readme.txt | 1 + examples/templates/footer.rhtml | 4 + examples/templates/helloworld.ru | 16 + examples/templates/index.rhtml | 14 + examples/templates/lib | 1 + examples/templates/readme.txt | 1 + lib/hyde.rb | 2 +- lib/hyde/dsl/constructors_path.rb | 78 ++ lib/hyde/dsl/constructors_probe.rb | 14 + .../{common_methods.rb => methods_common.rb} | 0 .../dsl/{path_methods.rb => methods_path.rb} | 0 .../{probe_methods.rb => methods_probe.rb} | 6 + lib/hyde/dsl/methods_template.rb | 9 + lib/hyde/dsl/path_constructors.rb | 80 -- lib/hyde/path.rb | 30 +- lib/hyde/probe.rb | 33 +- lib/hyde/probe/handler.rb | 92 +- lib/hyde/probe/http_method.rb | 126 +-- lib/hyde/probe/serve_handler.rb | 42 +- lib/hyde/server.rb | 5 +- lib/hyde/template.rb | 82 +- lib/hyde/template/erb.rb | 25 + 92 files changed, 10070 insertions(+), 1419 deletions(-) create mode 100644 .yardopts create mode 100644 doc/Hyde/DSL/CommonMethods.html create mode 100644 doc/Hyde/DSL/ProbeConstructors.html create mode 100644 doc/Hyde/DSL/TemplateMethods.html create mode 100644 doc/Hyde/Handlers.html create mode 100644 doc/Hyde/Handlers/CONNECT.html create mode 100644 doc/Hyde/Handlers/DELETE.html create mode 100644 doc/Hyde/Handlers/GET.html create mode 100644 doc/Hyde/Handlers/HEAD.html create mode 100644 doc/Hyde/Handlers/Handler.html create mode 100644 doc/Hyde/Handlers/OPTIONS.html create mode 100644 doc/Hyde/Handlers/PATCH.html create mode 100644 doc/Hyde/Handlers/POST.html create mode 100644 doc/Hyde/Handlers/PUT.html create mode 100644 doc/Hyde/Handlers/Serve.html create mode 100644 doc/Hyde/Handlers/TRACE.html create mode 100644 doc/Hyde/PathContext.html create mode 100644 doc/Hyde/ProbeContext.html create mode 100644 doc/Hyde/ProcessorContext.html create mode 100644 doc/Hyde/ServerContext.html create mode 100644 doc/Hyde/Template.html create mode 100644 doc/Hyde/TemplateContext.html create mode 100644 doc/Hyde/Templates.html create mode 100644 doc/Hyde/Templates/ERB.html create mode 100644 doc/Hyde/Util/FormPart.html create mode 100644 doc/Hyde/Util/MultipartParser.html create mode 100644 doc/Hyde/Util/ParserCommon.html create mode 100644 examples/extension_testing/extension.ru create mode 100644 examples/extension_testing/external_methods.rb create mode 120000 examples/extension_testing/lib create mode 100644 examples/extension_testing/readme.txt create mode 100644 examples/form/readme.txt create mode 100644 examples/templates/footer.rhtml create mode 100644 examples/templates/helloworld.ru create mode 100644 examples/templates/index.rhtml create mode 120000 examples/templates/lib create mode 100644 examples/templates/readme.txt create mode 100644 lib/hyde/dsl/constructors_path.rb create mode 100644 lib/hyde/dsl/constructors_probe.rb rename lib/hyde/dsl/{common_methods.rb => methods_common.rb} (100%) rename lib/hyde/dsl/{path_methods.rb => methods_path.rb} (100%) rename lib/hyde/dsl/{probe_methods.rb => methods_probe.rb} (92%) create mode 100644 lib/hyde/dsl/methods_template.rb delete mode 100644 lib/hyde/dsl/path_constructors.rb create mode 100644 lib/hyde/template/erb.rb diff --git a/.yardoc/checksums b/.yardoc/checksums index 5ce3526..59aa550 100644 --- a/.yardoc/checksums +++ b/.yardoc/checksums @@ -1,21 +1,28 @@ -lib/hyde.rb 775368f05e89c7396fdf9a9c1f55e3537f8fba98 +lib/hyde.rb 632d043ed6e7484bca963c37e1629e1d88c89b69 lib/hyde/node.rb 93d92492390abb2b55649c6d027fa3a2cb8f2014 -lib/hyde/path.rb 280170523467824ac6ce310500fc88439808d59e -lib/hyde/probe.rb 994a5527bb30c713c1c70e56195ea6967ae39241 -lib/hyde/server.rb 3286219acc8606b432d12545e9ba3a57dd227473 -lib/hyde/request.rb 9baea24ae9975e3a26571878ed7e9da99889584f +lib/hyde/path.rb 42c04e42ea879ad73f639f2086b3ab5ca40489dc +lib/hyde/probe.rb 673b55e9aa8c8286a770bd23ae00bff1ac2047fe +lib/hyde/server.rb 6f15f6c8e67783086bfe70ad03c7ca9b8269c69d +lib/hyde/request.rb 792427908273455eb694e13d3517cdae43af3454 lib/hyde/response.rb 0f0c107c7db883b308b81cbf5c0c4b7d5c90e7ba -lib/hyde/util/html.rb 3767a1632026ba555ae5517b59728b2e916b61de -lib/hyde/util/query.rb ffa6f9b6631277d7061f63dd36e4cb431a8169f5 +lib/hyde/template.rb f3ac5033c5cdb9218b1865b5c9662ba50b813a70 +lib/hyde/util/html.rb bb83ec3ad162b8702ae054428f33c7d8a041d816 +lib/hyde/util/query.rb 212e9bd776eac429c2b2a821586ccce97f996df9 +lib/hyde/util/header.rb ce82b5351a857860b105f25d68ca66c0193359ce lib/hyde/util/lookup.rb 5b8e28a8471bb786f4e0a0d616885d238c806661 -lib/hyde/probe/binding.rb 1a83cfea5e7b620d075798c920dd4af3335871c7 -lib/hyde/probe/handler.rb 4d45e895a3bfee8e5234be3862c7e201772731b1 -lib/hyde/dsl/path_methods.rb 0369e370c594f0bd5c987c67791175eeaa8f9c21 +lib/hyde/template/erb.rb 4d1c85dd55b55030bba1ba4f9c27ea39fd0c1e47 +lib/hyde/util/sorting.rb af30f01ce32880f7e3e2b0ad6c2324c2fded9431 +lib/hyde/probe/handler.rb 9b3eb4ce702c40920c04ed0cb3b93984683de447 +lib/hyde/util/multipart.rb 37abad9fbe044855d02d36185be645f07cb417c0 +lib/hyde/dsl/methods_path.rb 0369e370c594f0bd5c987c67791175eeaa8f9c21 lib/hyde/pattern_matching.rb fe86f6529a2d22c128d9d3a74217862e9fa59c15 -lib/hyde/dsl/probe_methods.rb a9dd3ddbdf89875d79d5ca3e56fd3a261546dd25 -lib/hyde/probe/http_method.rb f5f6874998e4a581cd3673a06f3536c8a14e67c8 -lib/hyde/probe/serve_handler.rb 1690e7dd3f0abe9180a61d474bb89c0a765fc381 -lib/hyde/dsl/path_constructors.rb 97895412fc27eeb7f3fa379a85972c97a24d97bf +lib/hyde/dsl/methods_probe.rb c18bb7f712f14e4d08416f77969eb0af07a4f3a7 +lib/hyde/probe/http_method.rb 26ba5c9dabff5508dbd6efcba1711d6417cf957b +lib/hyde/dsl/methods_common.rb ea06161f4324127fbbacd51918eadc4e059e4fcf +lib/hyde/probe/serve_handler.rb 6c1d2a7b949700468342ced4c23c7fe60df4d3f0 +lib/hyde/dsl/methods_template.rb c77827f2a4133142b7f9f9dfe0bb49efb3b23d44 +lib/hyde/dsl/constructors_path.rb d9fafcfae4d6aab9bd85a7de955eb74f8d4d5937 lib/hyde/pattern_matching/glob.rb 16595083bc8d6f7b98f4adda502a05bd411bc1ca lib/hyde/pattern_matching/util.rb 188dc7d5d9a9a6538a01943a83eb132c385dc092 +lib/hyde/dsl/constructors_probe.rb 6295d25bfa4e896b122590e79e57a03111ed2f09 lib/hyde/pattern_matching/rematch.rb 54a4f94791e68d85c38034d954e4c3174e01511b diff --git a/.yardoc/object_types b/.yardoc/object_types index e2ba358f37762c1c4dbd82cf95a8a8dca9749d85..43429dab59e711a7cffc96a008cd50b71500356f 100644 GIT binary patch literal 7649 zcma)BX>a625CsVZSj4r!a$lL{hKSEzArz9?&4_F=B(q2;LYBwwOiX6n#>cXO-^72U z+V#5KhsVpeiQnt0>N>kS&%N-^t?0!{%I0F{-ZRll8=19hadCUL`{L0}CU&Bo>HXR6 z8|rry9VJD!7FE4-?|J(8CVyOrO}S1Qfv>Of*GEmhX4;4ShbWpSRV}Imx!K5q;a3c%@b?&`?~SO6he?xO<;98@eqb-G{#MI9pYAkdrEzlBz~LX&8Nnr7-FsaNoJ89*au(!CD3Pskl*~7mIm( zzSv(pI%k>KzD|HBdN5r?(ZlKD==6{o*nZELpPoOBax~pPbfpA(=8rrf6W(2~=Wu#F zT})jucYV^q>B-6Tz!Md)PUj1X#knhM*O#?8+duI11)TZ*;^4@Y^Q8%kox9}8wOmHg z;`Ha~N$2e7R=Q5=`r__v7qxUEsSvx8Lvg5(i@KInNLB>z7zHXj`+R^Dl@BcCZ4i;9 zJrnsy;+If}T;hyzq`uBV7-6|c=`-(u)OGx3h zE2uD zUJM72r&Wmg8$8&nqsnnq^@ysNEs&~|E%K;B7(sIM^0+b>40er**n*-G7)7{x!CeJx z!Me=ff_2Hl7@P@L=}ykozzh_6z&H~fTajp7b<^SE*?(uduu>JvBrozNPuBV0NVvB+ z9Xd?Sx*u2t(uzNeO;X}J;@Ev($sz6^B1Kl9m^yCBb;%1Hok}==Mn^ZM@K?mH`Msn$QGaXO%#;xT<6+swUSb3tLsy7RpH^5hnv{?-K>~cA5dL-Kb0z1@)*_#AR=? z;URGFQ6`=^f$KiUS&qy?=bu}>G;pjoTye%h@}9G0?Wk_0<66`+x8Fc091k>2*6vvh z9XeR{87G>CJ3kIM2#KO;OPQe^!(0vIMcJZCaQxCp+16Jv9fcZr5xX(4ENv9A)o8`@ zC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0bhWah|c9})5h7cN$N|n8tl||Kq*LB zg49jXAhAMS!4KpISn?5o#F8&y2VCcln_ObCyPh+1W_-@fkByJFPn5+AwL+pgFo~o} z+Pzxga`0BwmTz_6zI+BZg*+Sx=Y=%95Vlq`3~aRhr>eSb*`{UhOB-=ow#bksai0_S z31zso4%Qo`9DR>>1TYgnNBi@G7^IU~*hwD4uVm|%s_yiOJ1BaN>$5(%$-(J_;FE43 zwGIB2&vy#5P8BWN@~w8)Izr=dnZy0)B{J|kC4(egS}VH5>p8YZHd!~kI83GJVV`(7 z$ryvfs|r-)%t(=s1bW7Ql#FOv1df%Q)N%UuUhq8CXU?4*9)&iVTGEaz=!NPc#wVn7ZZ?gyZ`_I diff --git a/.yardoc/objects/root.dat b/.yardoc/objects/root.dat index eb76e340d94678db80463be923657d6bea5bd7d3..0fdf97bfe025fdd789c43df1cfdafbc3a453ec64 100644 GIT binary patch literal 137827 zcmeFa3vgUndLA}_W;w)z&mo61oY$SkkZf>(2FM|2XS>N^b4ZZHE?)~^c6S!UVjI8( z&`Y2j>Td8M4o9!DBB?5NB&|!9Ek#;KPU1u*$+9acSLtC_s*<=At87}No4!;$o>DlfdA-_f&F`ugUr#A@ zqrS4ep*|;PQw<^nFc{gUaRcWnH=MK_vi$#SFMsWqb352F| zBllcg8S&zD}hQhK>wdS!R%)hnf-dZ_do{+}!FE{%Y)6cRKVfD&yD4b#uj$BB_g9<&|@`5BN8UeCPu?)!@htjFegX6pLX#o4LF%NOUS9*^Fs<#-^+ zrgNWta;+WrLHfLabnm5Gx8I+czItsg1FX+7SeNTt4;$6B^_C%11IyUw2!O|806YQ! z9x(tsB*3wK8z7#vZwQc=OsB!=$`81i0BA&-juLO5VLci70Xi5i+DfrjGM z1A@bSQ4fqnpD&);OGJHW{+YUwKywgQ#UlPY2w?+3vq)lZIycDU;xR&?g%4WOxu>X` z(q3nXm@-L2h}h}ekU)mZyjVU{FHH`XPT_SUY;8Ac)KKa4bneAUPz&z|20}r7H6XA^ z%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y;=_9B3IE zO)`Jg%E#hPEc(5WHp@dEiJ%vJg39X>*7J->zVuZoFZeLzA#a#e15kLF>i4%U?eOp$ z`~)+}&HC1)t{rWEas3<*fAy#`lk}LuW*M)89jNeSjt`mDWfu(e9=tl0gGcaSQv|@9W_22r-sH|uO!knA zW@Y75*qkKuYg$!K6;r3WwzDtk3OiFvzafrfLTZCW)%esQiyH&Y3vt9`n<}H))1i>?%}1kcv9agkNjYBY zmmPJO^Mq493vwQ>+R%QNV$MHK6;WE4Gl7_51`(MKE6&3C85?Y;b4m?-?GSk|2V@%( zNPN#?qPp?$6#~EbP}vE$%JMY)JzCX7biTjQ8}`{-ZK}a*&hH-bqD?hXO|#q+Li$n& zOmo!rkdH%Pn&vPopV(CP!^ca0=2h7bw}xS2?W%8>Skc3OAr`VUmtFp?b7mNHfL)!y z$itThPhIK;AhIV6TONYdoLqYF$9*2s5CYb8VNV#i$*!&_?Qy|FdhGIVoMOUoy&*X5 z)*gQf6ol)+-`Qw(>tVoMAwUroLn=CKSC_E1Jz_;Z6VhVD5Ot^QA)klDt#xaDL={@M z=s|u6$rXVkv?h&lviPABx_tZ@)y@=BpxZ^{f%w~}EQ5$!2M9ZxLI#rO32RIx*(OZS z^^mvJA-Gra;EyGFSDx-CrPV2Zp6J2!NSWr=<>5-nijfNtqf`964}TQp!5{C*^dD2Q z=rglo(K(liTDF<5VGpTQM=L*c!>yAyIQr~tK6-hK%tCkgh`q@o4`B&u#L52UAXZ(A zMb78dToh@og~g?jeBCaKJe1WO#{2h@zk&^MJZZrYco+sC_?s5FNCDrMMr^th7P(ZZ zzMDo8bU$-Qf!v%<>@nHsrk;Hl@({%oELML3If!C`RW4>VU*O~Z>*aXd< msOz@MgGJSrr+TS-tVo0dB;XH5+UMb~!0-p`0d!waSpOFvseWGo diff --git a/.yardopts b/.yardopts new file mode 100644 index 0000000..191a6de --- /dev/null +++ b/.yardopts @@ -0,0 +1 @@ +--markup=markdown --markup-provider=redcarpet diff --git a/README.md b/README.md index 0a82c81..d17b1f5 100644 --- a/README.md +++ b/README.md @@ -100,7 +100,7 @@ app = Hyde::Server.new do end get "answer" do header "content-type", "application/json" - '{"answer":42, "desc":"something important!"}' + '\\{"answer":42, "desc":"something important!"\\}' end end end diff --git a/doc/Hyde.html b/doc/Hyde.html index 21d25e5..80854e5 100644 --- a/doc/Hyde.html +++ b/doc/Hyde.html @@ -79,7 +79,7 @@
Defined in:
lib/hyde.rb,
- lib/hyde/node.rb,
lib/hyde/path.rb,
lib/hyde/probe.rb,
lib/hyde/server.rb,
lib/hyde/request.rb,
lib/hyde/response.rb,
lib/hyde/util/html.rb,
lib/hyde/util/query.rb,
lib/hyde/util/lookup.rb,
lib/hyde/probe/binding.rb,
lib/hyde/probe/handler.rb,
lib/hyde/dsl/path_methods.rb,
lib/hyde/pattern_matching.rb,
lib/hyde/dsl/probe_methods.rb,
lib/hyde/probe/http_method.rb,
lib/hyde/probe/serve_handler.rb,
lib/hyde/dsl/path_constructors.rb,
lib/hyde/pattern_matching/glob.rb,
lib/hyde/pattern_matching/util.rb,
lib/hyde/pattern_matching/rematch.rb
+ lib/hyde/node.rb,
lib/hyde/path.rb,
lib/hyde/probe.rb,
lib/hyde/server.rb,
lib/hyde/request.rb,
lib/hyde/response.rb,
lib/hyde/template.rb,
lib/hyde/util/html.rb,
lib/hyde/util/query.rb,
lib/hyde/util/header.rb,
lib/hyde/util/lookup.rb,
lib/hyde/template/erb.rb,
lib/hyde/util/sorting.rb,
lib/hyde/probe/handler.rb,
lib/hyde/util/multipart.rb,
lib/hyde/dsl/methods_path.rb,
lib/hyde/pattern_matching.rb,
lib/hyde/dsl/methods_probe.rb,
lib/hyde/probe/http_method.rb,
lib/hyde/dsl/methods_common.rb,
lib/hyde/probe/serve_handler.rb,
lib/hyde/dsl/methods_template.rb,
lib/hyde/dsl/constructors_path.rb,
lib/hyde/pattern_matching/glob.rb,
lib/hyde/pattern_matching/util.rb,
lib/hyde/dsl/constructors_probe.rb,
lib/hyde/pattern_matching/rematch.rb
@@ -87,8 +87,7 @@

Overview

- -

Hyde is a hideously simple ruby web framework

+

Hyde is a hideously simple ruby web framework

@@ -100,11 +99,11 @@

- Modules: DSL, PatternMatching, Util + Modules: DSL, Handlers, PatternMatching, Templates, Util - Classes: CONNECTHandler, DELETEHandler, GETHandler, HEADHandler, Handler, Node, OPTIONSHandler, PATCHHandler, POSTHandler, PUTHandler, Path, PathBinding, Pattern, Probe, ProbeBinding, Request, Response, ServeHandler, Server, ServerBinding, TRACEHandler + Classes: Node, Path, PathContext, Pattern, Probe, ProbeContext, ProcessorContext, Request, Response, Server, ServerContext, Template, TemplateContext

@@ -120,8 +119,7 @@
VERSION =
- -

Hyde version

+

Hyde version

@@ -136,8 +134,7 @@
VLINE =
- -

Hyde branding and version

+

Hyde branding and version

@@ -152,8 +149,7 @@
diff --git a/doc/Hyde/DELETEHandler.html b/doc/Hyde/DELETEHandler.html index 98b97d2..3dc250b 100644 --- a/doc/Hyde/DELETEHandler.html +++ b/doc/Hyde/DELETEHandler.html @@ -211,7 +211,7 @@ diff --git a/doc/Hyde/DSL.html b/doc/Hyde/DSL.html index 1279e94..c54c1a2 100644 --- a/doc/Hyde/DSL.html +++ b/doc/Hyde/DSL.html @@ -78,8 +78,8 @@
Defined in:
-
lib/hyde/dsl/path_methods.rb,
- lib/hyde/dsl/probe_methods.rb,
lib/hyde/dsl/path_constructors.rb
+
lib/hyde/dsl/methods_path.rb,
+ lib/hyde/dsl/methods_probe.rb,
lib/hyde/dsl/methods_common.rb,
lib/hyde/dsl/methods_template.rb,
lib/hyde/dsl/constructors_path.rb,
lib/hyde/dsl/constructors_probe.rb
@@ -87,8 +87,7 @@

Overview

- -

Shared DSL methods

+

Shared DSL methods

@@ -100,7 +99,7 @@

- Modules: PathConstructors, PathMethods, ProbeMethods + Modules: CommonMethods, PathConstructors, PathMethods, ProbeConstructors, ProbeMethods, TemplateMethods @@ -118,7 +117,7 @@

diff --git a/doc/Hyde/DSL/CommonMethods.html b/doc/Hyde/DSL/CommonMethods.html new file mode 100644 index 0000000..cce4dc4 --- /dev/null +++ b/doc/Hyde/DSL/CommonMethods.html @@ -0,0 +1,337 @@ + + + + + + + Module: Hyde::DSL::CommonMethods + + — Documentation by YARD 0.9.34 + + + + + + + + + + + + + + + + + + + +
+ + +

Module: Hyde::DSL::CommonMethods + + + +

+
+ + + + + + + + + +
+
Included in:
+
ProbeContext, ProcessorContext, TemplateContext
+
+ + + +
+
Defined in:
+
lib/hyde/dsl/methods_common.rb
+
+ +
+ +

Overview

+
+

Methods shared by probes, preprocessors and filters.

+ + +
+
+
+ + +
+ + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #bounceObject + + + + + +

+
+

Bounce request to the next handler

+ + +
+
+
+ +

Raises:

+
    + +
  • + + + (UncaughtThrowError) + + + + — +

    throws :break to get out of the callback

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+23
+24
+25
+
+
# File 'lib/hyde/dsl/methods_common.rb', line 23
+
+def bounce
+  throw :break
+end
+
+
+ +
+

+ + #die(errorcode, backtrace: nil) ⇒ Object + + + + + +

+
+

Stop execution and generate a boilerplate response with the given code

+ + +
+
+
+

Parameters:

+
    + +
  • + + errorcode + + + (Integer) + + + +
  • + +
  • + + backtrace + + + (Array(String), nil) + + + (defaults to: nil) + + +
  • + +
+ +

Raises:

+
    + +
  • + + + (UncaughtThrowError) + + + + — +

    throws :finish to return back to Server

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+11
+12
+13
+14
+15
+16
+17
+18
+19
+
+
# File 'lib/hyde/dsl/methods_common.rb', line 11
+
+def die(errorcode, backtrace: nil)
+  throw :finish, [errorcode].append(
+    *(@origin.properties["handle.#{errorcode}"] or
+      @origin.properties["handle.default"]).call(
+        errorcode,
+        backtrace: backtrace
+      )
+  )
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/doc/Hyde/DSL/PathConstructors.html b/doc/Hyde/DSL/PathConstructors.html index 83472b8..8d8d9a0 100644 --- a/doc/Hyde/DSL/PathConstructors.html +++ b/doc/Hyde/DSL/PathConstructors.html @@ -76,22 +76,21 @@
Included in:
-
PathBinding
+
PathContext
Defined in:
-
lib/hyde/dsl/path_constructors.rb
+
lib/hyde/dsl/constructors_path.rb

Overview

- -

Path (and subclasses) DSL constructors

+

Path (and subclasses) DSL constructors

@@ -131,8 +130,7 @@ -
-

Create a new CONNECTHandler object.

+

Create a new Handlers::CONNECTHandler object.

@@ -155,8 +153,7 @@ -
-

Create a new Hyde::DELETEHandler object.

+

Create a new Handlers::DELETEHandler object.

@@ -179,8 +176,7 @@ -
-

Create a new GETHandler object.

+

Create a new Handlers::GETHandler object.

@@ -203,8 +199,7 @@ -
-

Create a new HEADHandler object.

+

Create a new Handlers::HEADHandler object.

@@ -227,8 +222,7 @@ -
-

Create a new OPTIONSHandler object.

+

Create a new Handlers::OPTIONSHandler object.

@@ -251,8 +245,7 @@ -
-

Create a new PATCHHandler object.

+

Create a new Handlers::PATCHHandler object.

@@ -275,8 +268,7 @@ -
-

Create a new Path object.

+

Create a new Path object.

@@ -299,8 +291,7 @@ -
-

create a new POSTHandler object.

+

create a new Handlers::POSTHandler object.

@@ -323,8 +314,7 @@ -
-

Create a new Probe object.

+

Create a new Handlers::Probe object.

@@ -347,8 +337,7 @@ -
-

Create a new PUTHandler object.

+

Create a new Handlers::PUTHandler object.

@@ -371,8 +360,7 @@ -
-

Append a Node child object to the list of children.

+

Append a Node child object to the list of children.

@@ -395,8 +383,7 @@ -
-

Create a new GETHandler that serves static files.

+

Create a new Handlers::GETHandler that serves static files.

@@ -419,8 +406,7 @@ -
-

Create a new TRACEHandler object.

+

Create a new Handlers::TRACEHandler object.

@@ -446,8 +432,7 @@
- -

Create a new CONNECTHandler object

+

Create a new Handlers::CONNECTHandler object

@@ -461,15 +446,15 @@
 
 
-55
-56
-57
+53 +54 +55 -
# File 'lib/hyde/dsl/path_constructors.rb', line 55
+      
# File 'lib/hyde/dsl/constructors_path.rb', line 53
 
 def connect(path, &setup)
-  register(Hyde::CONNECTHandler.new(path, parent: @origin, &setup))
+  register(Hyde::Handlers::CONNECT.new(path, parent: @origin, &setup))
 end
@@ -487,8 +472,7 @@
- -

Create a new Hyde::DELETEHandler object

+

Create a new Handlers::DELETEHandler object

@@ -502,15 +486,15 @@
 
 
-50
-51
-52
+48 +49 +50
-
# File 'lib/hyde/dsl/path_constructors.rb', line 50
+      
# File 'lib/hyde/dsl/constructors_path.rb', line 48
 
 def delete(path, &setup)
-  register(Hyde::DELETEHandler.new(path, parent: @origin, &setup))
+  register(Hyde::Handlers::DELETE.new(path, parent: @origin, &setup))
 end
@@ -528,8 +512,7 @@
- -

Create a new GETHandler object

+

Create a new Handlers::GETHandler object

@@ -543,15 +526,15 @@
 
 
-30
-31
-32
+28 +29 +30
-
# File 'lib/hyde/dsl/path_constructors.rb', line 30
+      
# File 'lib/hyde/dsl/constructors_path.rb', line 28
 
 def get(path, &setup)
-  register(Hyde::GETHandler.new(path, parent: @origin, &setup))
+  register(Hyde::Handlers::GET.new(path, parent: @origin, &setup))
 end
@@ -569,8 +552,7 @@
- -

Create a new HEADHandler object

+

Create a new Handlers::HEADHandler object

@@ -584,15 +566,15 @@
 
 
-45
-46
-47
+43 +44 +45
-
# File 'lib/hyde/dsl/path_constructors.rb', line 45
+      
# File 'lib/hyde/dsl/constructors_path.rb', line 43
 
 def head(path, &setup)
-  register(Hyde::HEADHandler.new(path, parent: @origin, &setup))
+  register(Hyde::Handlers::HEAD.new(path, parent: @origin, &setup))
 end
@@ -610,8 +592,7 @@
- -

Create a new OPTIONSHandler object

+

Create a new Handlers::OPTIONSHandler object

@@ -625,15 +606,15 @@
 
 
-70
-71
-72
+68 +69 +70
-
# File 'lib/hyde/dsl/path_constructors.rb', line 70
+      
# File 'lib/hyde/dsl/constructors_path.rb', line 68
 
 def options(path, &setup)
-  register(Hyde::OPTIONSHandler.new(path, parent: @origin, &setup))
+  register(Hyde::Handlers::OPTIONS.new(path, parent: @origin, &setup))
 end
@@ -651,8 +632,7 @@
- -

Create a new PATCHHandler object

+

Create a new Handlers::PATCHHandler object

@@ -666,15 +646,15 @@
 
 
-65
-66
-67
+63 +64 +65
-
# File 'lib/hyde/dsl/path_constructors.rb', line 65
+      
# File 'lib/hyde/dsl/constructors_path.rb', line 63
 
 def patch(path, &setup)
-  register(Hyde::PATCHHandler.new(path, parent: @origin, &setup))
+  register(Hyde::Handlers::PATCH.new(path, parent: @origin, &setup))
 end
@@ -692,8 +672,7 @@
- -

Create a new Path object

+

Create a new Path object

@@ -709,17 +688,13 @@ 18 19 -20 -21 -22
+20 -
# File 'lib/hyde/dsl/path_constructors.rb', line 18
+      
# File 'lib/hyde/dsl/constructors_path.rb', line 18
 
 def path(path, &setup)
-  # i don't know WHAT is wrong with this thing. it just is wrong.
-  # @sg-ignore
-  register(Hyde::Path.new(path, parent: @origin, &setup))
+  register(Hyde::Path.new(path, parent: @origin, &setup))
 end
@@ -737,8 +712,7 @@
- -

create a new POSTHandler object

+

create a new Handlers::POSTHandler object

@@ -752,15 +726,15 @@
 
 
-35
-36
-37
+33 +34 +35
-
# File 'lib/hyde/dsl/path_constructors.rb', line 35
+      
# File 'lib/hyde/dsl/constructors_path.rb', line 33
 
 def post(path, &setup)
-  register(Hyde::POSTHandler.new(path, parent: @origin, &setup))
+  register(Hyde::Handlers::POST.new(path, parent: @origin, &setup))
 end
@@ -778,8 +752,7 @@
- -

Create a new Probe object

+

Create a new Handlers::Probe object

@@ -793,15 +766,15 @@
 
 
-25
-26
-27
+23 +24 +25
-
# File 'lib/hyde/dsl/path_constructors.rb', line 25
+      
# File 'lib/hyde/dsl/constructors_path.rb', line 23
 
 def probe(path, &_setup)
-  register(Hyde::Probe.new(path, parent: @origin))
+  register(Hyde::Handlers::Probe.new(path, parent: @origin))
 end
@@ -819,8 +792,7 @@
- -

Create a new PUTHandler object

+

Create a new Handlers::PUTHandler object

@@ -834,15 +806,15 @@
 
 
-40
-41
-42
+38 +39 +40
-
# File 'lib/hyde/dsl/path_constructors.rb', line 40
+      
# File 'lib/hyde/dsl/constructors_path.rb', line 38
 
 def put(path, &setup)
-  register(Hyde::PUTHandler.new(path, parent: @origin, &setup))
+  register(Hyde::Handlers::PUT.new(path, parent: @origin, &setup))
 end
@@ -860,8 +832,7 @@
- -

Append a Node child object to the list of children

+

Append a Node child object to the list of children

@@ -884,7 +855,7 @@ 15
-
# File 'lib/hyde/dsl/path_constructors.rb', line 9
+      
# File 'lib/hyde/dsl/constructors_path.rb', line 9
 
 def register(obj)
   unless obj.is_a? Hyde::Node
@@ -909,8 +880,7 @@
   
 
- -

Create a new GETHandler that serves static files

+

Create a new Handlers::GETHandler that serves static files

@@ -924,15 +894,15 @@
 
 
-75
-76
-77
+73 +74 +75
-
# File 'lib/hyde/dsl/path_constructors.rb', line 75
+      
# File 'lib/hyde/dsl/constructors_path.rb', line 73
 
 def serve(path)
-  register(Hyde::ServeHandler.new(path, parent: @origin))
+  register(Hyde::Handlers::Serve.new(path, parent: @origin))
 end
@@ -950,8 +920,7 @@
- -

Create a new TRACEHandler object

+

Create a new Handlers::TRACEHandler object

@@ -965,15 +934,15 @@
 
 
-60
-61
-62
+58 +59 +60
-
# File 'lib/hyde/dsl/path_constructors.rb', line 60
+      
# File 'lib/hyde/dsl/constructors_path.rb', line 58
 
 def trace(path, &setup)
-  register(Hyde::TRACEHandler.new(path, parent: @origin, &setup))
+  register(Hyde::Handlers::TRACE.new(path, parent: @origin, &setup))
 end
@@ -985,7 +954,7 @@
diff --git a/doc/Hyde/DSL/PathMethods.html b/doc/Hyde/DSL/PathMethods.html index 2aba23c..f644575 100644 --- a/doc/Hyde/DSL/PathMethods.html +++ b/doc/Hyde/DSL/PathMethods.html @@ -76,22 +76,21 @@
Included in:
-
PathBinding
+
PathContext
Defined in:
-
lib/hyde/dsl/path_methods.rb
+
lib/hyde/dsl/methods_path.rb

Overview

- -

Common path methods

+

Common path methods

@@ -131,8 +130,7 @@ -
-

Add a filter to the path.

+

Add a filter to the path.

@@ -155,8 +153,7 @@ -
-

Set path index.

+

Set path index.

@@ -179,8 +176,7 @@ -
-

Add a postprocessor to the path.

+

Add a postprocessor to the path.

@@ -203,8 +199,7 @@ -
-

Add a preprocessor to the path.

+

Add a preprocessor to the path.

@@ -227,8 +222,7 @@ -
-

Set root path (without appending matched part).

+

Set root path (without appending matched part).

@@ -251,8 +245,7 @@ -
-

Set root path (appends matched part of the path).

+

Set root path (appends matched part of the path).

@@ -278,8 +271,8 @@
- -

Add a filter to the path. Blocks path access if a filter returns false.

+

Add a filter to the path. +Blocks path access if a filter returns false.

@@ -329,7 +322,7 @@ 58 -
# File 'lib/hyde/dsl/path_methods.rb', line 55
+      
# File 'lib/hyde/dsl/methods_path.rb', line 55
 
 def filter(&block)
   @origin.filter(&block)
@@ -351,8 +344,7 @@
   
 
- -

Set path index

+

Set path index

@@ -393,7 +385,7 @@ 19
-
# File 'lib/hyde/dsl/path_methods.rb', line 10
+      
# File 'lib/hyde/dsl/methods_path.rb', line 10
 
 def index(index)
   case index
@@ -421,8 +413,7 @@
   
 
- -

Add a postprocessor to the path.

+

Add a postprocessor to the path.

@@ -483,7 +474,7 @@ 49
-
# File 'lib/hyde/dsl/path_methods.rb', line 46
+      
# File 'lib/hyde/dsl/methods_path.rb', line 46
 
 def postprocess(&block)
   @origin.postprocess(&block)
@@ -505,8 +496,8 @@
   
 
- -

Add a preprocessor to the path. Does not modify path execution.

+

Add a preprocessor to the path. +Does not modify path execution.

@@ -556,7 +547,7 @@ 40
-
# File 'lib/hyde/dsl/path_methods.rb', line 37
+      
# File 'lib/hyde/dsl/methods_path.rb', line 37
 
 def preprocess(&block)
   @origin.preprocess(&block)
@@ -578,8 +569,7 @@
   
 
- -

Set root path (without appending matched part).

+

Set root path (without appending matched part).

@@ -598,8 +588,7 @@ — -
-

ath [String

+

ath [String

@@ -618,7 +607,7 @@ 31
-
# File 'lib/hyde/dsl/path_methods.rb', line 29
+      
# File 'lib/hyde/dsl/methods_path.rb', line 29
 
 def remap(path)
   @origin.remap = path
@@ -639,8 +628,7 @@
   
 
- -

Set root path (appends matched part of the path).

+

Set root path (appends matched part of the path).

@@ -659,8 +647,7 @@ — -
-

ath [String

+

ath [String

@@ -679,7 +666,7 @@ 25
-
# File 'lib/hyde/dsl/path_methods.rb', line 23
+      
# File 'lib/hyde/dsl/methods_path.rb', line 23
 
 def root(path)
   @origin.root = path
@@ -694,7 +681,7 @@
 
diff --git a/doc/Hyde/DSL/ProbeConstructors.html b/doc/Hyde/DSL/ProbeConstructors.html new file mode 100644 index 0000000..62bd930 --- /dev/null +++ b/doc/Hyde/DSL/ProbeConstructors.html @@ -0,0 +1,207 @@ + + + + + + + Module: Hyde::DSL::ProbeConstructors + + — Documentation by YARD 0.9.34 + + + + + + + + + + + + + + + + + + + +
+ + +

Module: Hyde::DSL::ProbeConstructors + + + +

+
+ + + + + + + + + +
+
Included in:
+
ProbeContext, TemplateContext
+
+ + + +
+
Defined in:
+
lib/hyde/dsl/constructors_probe.rb
+
+ +
+ +

Overview

+
+

Probe (and subclasses) DSL construct

+ + +
+
+
+ + +
+ + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #erb(input, toplevel: nil, locals: nil) ⇒ Object + + + + + +

+
+

Create a new erb template

+ + +
+
+
+ + +

See Also:

+
    + +
  • Template#new
  • + +
+ +
+ + + + +
+
+
+
+9
+10
+11
+
+
# File 'lib/hyde/dsl/constructors_probe.rb', line 9
+
+def erb(input, toplevel: nil, locals: nil)
+  Hyde::Templates::ERB.new(input, toplevel: toplevel, locals: locals)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/doc/Hyde/DSL/ProbeMethods.html b/doc/Hyde/DSL/ProbeMethods.html index 7d90e6c..319f1c7 100644 --- a/doc/Hyde/DSL/ProbeMethods.html +++ b/doc/Hyde/DSL/ProbeMethods.html @@ -76,22 +76,21 @@
Included in:
-
ProbeBinding
+
ProbeContext, TemplateContext
Defined in:
-
lib/hyde/dsl/probe_methods.rb
+
lib/hyde/dsl/methods_probe.rb

Overview

- -

Common methods for Probe objects

+

Common methods for Probe objects

@@ -117,7 +116,7 @@
  • - #bounce ⇒ Object + #file(path, mode = "r", *all, &block) ⇒ Object @@ -131,8 +130,7 @@ -
    -

    Bounce request to the next handler.

    +

    Open a file relative to current filepath.

  • @@ -141,7 +139,7 @@
  • - #die(errorcode, backtrace: nil) ⇒ Object + #form ⇒ Hash{String=>(String,Hyde::Util::FormPart)} @@ -155,8 +153,30 @@ -
    -

    Stop execution and generate a boilerplate response with the given code.

    +

    Returns formdata.

    +
    + +
  • + + +
  • + + + #form? ⇒ Boolean + + + + + + + + + + + + + +

    Checks if current request has multipart/form-data associated with it.

  • @@ -179,8 +199,7 @@ -
    -

    Set response header (generate response if one doesn’t exist yet).

    +

    Set response header (generate response if one doesn't exist yet).

    @@ -203,8 +222,7 @@ -
    -

    Delete a header value from the headers hash If no value is provided, deletes all key entries.

    +

    Delete a header value from the headers hash If no value is provided, deletes all key entries.

    @@ -227,8 +245,7 @@ -
    -

    Get the current request.

    +

    Get the current request.

    @@ -253,8 +270,7 @@ -
    -

    Set response status (generate response if one doesn’t exist yet).

    +

    Set response status (generate response if one doesn't exist yet).

    @@ -270,9 +286,9 @@
    -

    +

    - #bounceObject + #file(path, mode = "r", *all, &block) ⇒ Object @@ -280,32 +296,20 @@

    - -

    Bounce request to the next handler

    +

    Open a file relative to current filepath

    -

    Raises:

    -
      - -
    • - - - (UncaughtThrowError) - - - - — -
      -

      throws :break to get out of the callback

      -
      - -
    • - -
    + +

    See Also:

    +
      + +
    • File#open
    • + +
    @@ -313,15 +317,15 @@
     
     
    -31
    -32
    -33
    +88 +89 +90 @@ -329,9 +333,9 @@
    -

    +

    - #die(errorcode, backtrace: nil) ⇒ Object + #formHash{String=>(String,Hyde::Util::FormPart)} @@ -339,57 +343,23 @@

    - -

    Stop execution and generate a boilerplate response with the given code

    +

    Returns formdata

    -

    Parameters:

    -
      -
    • - - errorcode - - - (Integer) - - - -
    • - -
    • - - backtrace - - - (Array(String), nil) - - - (defaults to: nil) - - -
    • - -
    - -

    Raises:

    -
      +

      Returns:

      +
      • - (UncaughtThrowError) + (Hash{String=>(String,Hyde::Util::FormPart)}) - — -
        -

        throws :finish to return back to Server

        -
        -
      @@ -400,27 +370,86 @@
       
       
      -19
      -20
      -21
      -22
      -23
      -24
      -25
      -26
      -27
      +79 +80 +81 +82 +83 +84
    + +
    -
    # File 'lib/hyde/dsl/probe_methods.rb', line 31
    +      
    # File 'lib/hyde/dsl/methods_probe.rb', line 88
     
    -def bounce
    -  throw :break
    +def file(path, mode = "r", *all, &block)
    +  File.open("#{request.filepath}/#{path}", mode, *all, &block)
     end
    -
    # File 'lib/hyde/dsl/probe_methods.rb', line 19
    +      
    # File 'lib/hyde/dsl/methods_probe.rb', line 79
     
    -def die(errorcode, backtrace: nil)
    -  throw :finish, [errorcode].append(
    -    *(@origin.properties["handle.#{errorcode}"] or
    -      @origin.properties["handle.default"]).call(
    -        errorcode,
    -        backtrace: backtrace
    -      )
    -  )
    +def form
    +  _, opts = Hyde::Util.parse_value(request.headers["content-type"])
    +  Hyde::Util::MultipartParser.new(
    +    request.input, opts["boundary"]
    +  ).to_h
    +end
    +
    +
    + +
    +

    + + #form?Boolean + + + + + +

    +
    +

    Checks if current request has multipart/form-data associated with it

    + + +
    +
    +
    + +

    Returns:

    +
      + +
    • + + + (Boolean) + + + +
    • + +
    + +
    + + + @@ -438,8 +467,7 @@
    - -

    Set response header (generate response if one doesn’t exist yet)

    +

    Set response header (generate response if one doesn't exist yet)

    @@ -458,8 +486,7 @@ — -
    -

    header name

    +

    header name

    @@ -474,8 +501,7 @@ — -
    -

    header value

    +

    header value

    @@ -489,24 +515,24 @@
     
     
    -47
    -48
    -49
    -50
    -51
    -52
    -53
    -54
    -55
    -56
    -57
    -58
    -59
    -60
    -61
    +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43
    @@ -757,7 +778,7 @@ diff --git a/doc/Hyde/DSL/TemplateMethods.html b/doc/Hyde/DSL/TemplateMethods.html new file mode 100644 index 0000000..fef857f --- /dev/null +++ b/doc/Hyde/DSL/TemplateMethods.html @@ -0,0 +1,105 @@ + + + + + + + Module: Hyde::DSL::TemplateMethods + + — Documentation by YARD 0.9.34 + + + + + + + + + + + + + + + + + + + +
    + + +

    Module: Hyde::DSL::TemplateMethods + + + +

    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    lib/hyde/dsl/methods_template.rb
    +
    + +
    + + + + + + + + + + +
    + + + +
    + + \ No newline at end of file diff --git a/doc/Hyde/GETHandler.html b/doc/Hyde/GETHandler.html index 96dca45..9f60e36 100644 --- a/doc/Hyde/GETHandler.html +++ b/doc/Hyde/GETHandler.html @@ -328,16 +328,16 @@
     
     
    +24
    +25
     26
     27
     28
     29
    -30
    -31
    -32
    +30 @@ -394,12 +394,12 @@
     
     
    +19
     20
    -21
    -22
    +21 @@ -483,8 +478,7 @@
    - -

    Returns the value of attribute children.

    +

    Returns the value of attribute children.

    @@ -498,12 +492,12 @@
     
     
    -86
    -87
    -88
    +98 +99 +100
    + +
    +
    +
    +
    +67
    +68
    +69
    +70
    +71
    +72
    +73
    +74
    +75
    +
    +
    # File 'lib/hyde/dsl/methods_probe.rb', line 67
    +
    +def form?
    +  value, opts = Hyde::Util.parse_value(request.headers["content-type"])
    +  if value == "multipart/form-data" and
    +     opts["boundary"]
    +    true
    +  else
    +    false
    +  end
     end
    -
    # File 'lib/hyde/dsl/probe_methods.rb', line 47
    +      
    # File 'lib/hyde/dsl/methods_probe.rb', line 29
     
     def header(key, value)
       return status(value) if key.downcase == "status"
    @@ -539,8 +565,8 @@
       
     
    - -

    Delete a header value from the headers hash If no value is provided, deletes all key entries

    +

    Delete a header value from the headers hash +If no value is provided, deletes all key entries

    @@ -559,8 +585,7 @@ — -
    -

    header name

    +

    header name

    @@ -577,8 +602,7 @@ — -
    -

    header value

    +

    header value

    @@ -592,24 +616,24 @@
     
     
    -67
    -68
    -69
    -70
    -71
    -72
    -73
    -74
    -75
    -76
    -77
    -78
    -79
    -80
    -81
    +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63
    -
    # File 'lib/hyde/dsl/probe_methods.rb', line 67
    +      
    # File 'lib/hyde/dsl/methods_probe.rb', line 49
     
     def remove_header(key, value = nil)
       return unless @origin.response
    @@ -642,8 +666,7 @@
       
     
    - -

    Get the current request

    +

    Get the current request

    @@ -670,12 +693,12 @@
     
     
    -11
    -12
    -13
    +13 +14 +15
    -
    # File 'lib/hyde/dsl/probe_methods.rb', line 11
    +      
    # File 'lib/hyde/dsl/methods_probe.rb', line 13
     
     def request
       @origin.request
    @@ -700,8 +723,7 @@
       
     
    - -

    Set response status (generate response if one doesn’t exist yet)

    +

    Set response status (generate response if one doesn't exist yet)

    @@ -720,8 +742,7 @@ — -
    -

    http status code

    +

    http status code

    @@ -735,17 +756,17 @@
     
     
    -37
    -38
    -39
    -40
    +19 +20 +21 +22
    -
    # File 'lib/hyde/dsl/probe_methods.rb', line 37
    +      
    # File 'lib/hyde/dsl/methods_probe.rb', line 19
     
     def status(status)
    -  @response = (@response or Hyde::Response.new)
    -  @response.status = status
    +  @origin.response = (@origin.response or Hyde::Response.new)
    +  @origin.response.status = status
     end
    -
    # File 'lib/hyde/probe/http_method.rb', line 26
    +      
    # File 'lib/hyde/probe/http_method.rb', line 24
     
     def process(request)
       unless request.request_method.casecmp(self.class::METHOD).zero?
    @@ -356,7 +356,7 @@
     
     
           
    diff --git a/doc/Hyde/HEADHandler.html b/doc/Hyde/HEADHandler.html
    index 23d6000..555ed79 100644
    --- a/doc/Hyde/HEADHandler.html
    +++ b/doc/Hyde/HEADHandler.html
    @@ -211,7 +211,7 @@
     
     
           
    diff --git a/doc/Hyde/Handler.html b/doc/Hyde/Handler.html
    index 97826db..2cc8daf 100644
    --- a/doc/Hyde/Handler.html
    +++ b/doc/Hyde/Handler.html
    @@ -340,20 +340,20 @@
           
     
     
    +11
     12
     13
     14
     15
    -16
    -17
    +16
    -
    # File 'lib/hyde/probe/handler.rb', line 12
    +      
    # File 'lib/hyde/probe/handler.rb', line 11
     
     def initialize(path, parent:, &exec)
       super(path, parent: parent)
       @callback = exec
    -  @binding = Hyde::ProbeBinding.new(self)
    +  @context = Hyde::ProbeContext.new(self)
       @response = nil
     end
    -
    # File 'lib/hyde/probe/handler.rb', line 20
    +      
    # File 'lib/hyde/probe/handler.rb', line 19
     
     def request
       @request
    @@ -437,12 +437,12 @@
           
     
     
    +18
     19
    -20
    -21
    +20
    -
    # File 'lib/hyde/probe/handler.rb', line 19
    +      
    # File 'lib/hyde/probe/handler.rb', line 18
     
     def response
       @response
    @@ -549,6 +549,7 @@
           
     
     
    +35
     36
     37
     38
    @@ -565,11 +566,10 @@
     49
     50
     51
    -52
    -53
    +52
    -
    # File 'lib/hyde/probe/handler.rb', line 36
    +      
    # File 'lib/hyde/probe/handler.rb', line 35
     
     def process(request)
       @response = nil
    @@ -577,7 +577,7 @@
     
       @request = request
       response = catch(:break) do
    -    @binding.instance_exec(*request.splat,
    +    @context.instance_exec(*request.splat,
                                **request.param,
                                &@callback)
       end
    @@ -599,7 +599,7 @@
     
     
           
    diff --git a/doc/Hyde/Handlers.html b/doc/Hyde/Handlers.html
    new file mode 100644
    index 0000000..f89abca
    --- /dev/null
    +++ b/doc/Hyde/Handlers.html
    @@ -0,0 +1,127 @@
    +
    +
    +  
    +    
    +
    +
    +  Module: Hyde::Handlers
    +  
    +    — Documentation by YARD 0.9.34
    +  
    +
    +
    +  
    +
    +  
    +
    +
    +
    +
    +  
    +
    +  
    +
    +
    +  
    +  
    +    
    +
    +    
    + + +

    Module: Hyde::Handlers + + + +

    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    lib/hyde/probe.rb,
    + lib/hyde/probe/handler.rb,
    lib/hyde/probe/http_method.rb,
    lib/hyde/probe/serve_handler.rb
    +
    +
    + +
    + +

    Overview

    +
    +

    All subclasses of Hyde::Probe that respond to requests

    + + +
    +
    +
    + + +

    Defined Under Namespace

    +

    + + + + + Classes: CONNECT, DELETE, GET, HEAD, Handler, OPTIONS, PATCH, POST, PUT, Serve, TRACE + + +

    + + + + + + + + + +
    + + + +
    + + \ No newline at end of file diff --git a/doc/Hyde/Handlers/CONNECT.html b/doc/Hyde/Handlers/CONNECT.html new file mode 100644 index 0000000..c18fe90 --- /dev/null +++ b/doc/Hyde/Handlers/CONNECT.html @@ -0,0 +1,220 @@ + + + + + + + Class: Hyde::Handlers::CONNECT + + — Documentation by YARD 0.9.34 + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Hyde::Handlers::CONNECT + + + +

    +
    + +
    +
    Inherits:
    +
    + GET + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    lib/hyde/probe/http_method.rb
    +
    + +
    + +

    Overview

    +
    +

    Probe that executes callback on a CONNECT

    + + +
    +
    +
    + + +
    + +

    + Constant Summary + collapse +

    + +
    + +
    METHOD = + +
    +
    "CONNECT"
    + +
    + + + + + + + +

    Instance Attribute Summary

    + +

    Attributes inherited from Handler

    +

    #request, #response

    + + + +

    Attributes inherited from Probe

    +

    #properties

    + + + +

    Attributes inherited from Node

    +

    #remap, #root

    + + + + + + + + + +

    Method Summary

    + +

    Methods inherited from GET

    +

    #process

    + + + + + + + + + +

    Methods inherited from Handler

    +

    #initialize, #process

    + + + + + + + + + +

    Methods inherited from Probe

    +

    #initialize, #process

    + + + + + + + + + +

    Methods inherited from Node

    +

    #go, #initialize, #process, #reject

    +
    +

    Constructor Details

    + +

    This class inherits a constructor from Hyde::Handlers::Handler

    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/doc/Hyde/Handlers/DELETE.html b/doc/Hyde/Handlers/DELETE.html new file mode 100644 index 0000000..244f96b --- /dev/null +++ b/doc/Hyde/Handlers/DELETE.html @@ -0,0 +1,220 @@ + + + + + + + Class: Hyde::Handlers::DELETE + + — Documentation by YARD 0.9.34 + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Hyde::Handlers::DELETE + + + +

    +
    + +
    +
    Inherits:
    +
    + GET + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    lib/hyde/probe/http_method.rb
    +
    + +
    + +

    Overview

    +
    +

    Probe that executes callback on a DELETE

    + + +
    +
    +
    + + +
    + +

    + Constant Summary + collapse +

    + +
    + +
    METHOD = + +
    +
    "DELETE"
    + +
    + + + + + + + +

    Instance Attribute Summary

    + +

    Attributes inherited from Handler

    +

    #request, #response

    + + + +

    Attributes inherited from Probe

    +

    #properties

    + + + +

    Attributes inherited from Node

    +

    #remap, #root

    + + + + + + + + + +

    Method Summary

    + +

    Methods inherited from GET

    +

    #process

    + + + + + + + + + +

    Methods inherited from Handler

    +

    #initialize, #process

    + + + + + + + + + +

    Methods inherited from Probe

    +

    #initialize, #process

    + + + + + + + + + +

    Methods inherited from Node

    +

    #go, #initialize, #process, #reject

    +
    +

    Constructor Details

    + +

    This class inherits a constructor from Hyde::Handlers::Handler

    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/doc/Hyde/Handlers/GET.html b/doc/Hyde/Handlers/GET.html new file mode 100644 index 0000000..2ee0d1e --- /dev/null +++ b/doc/Hyde/Handlers/GET.html @@ -0,0 +1,360 @@ + + + + + + + Class: Hyde::Handlers::GET + + — Documentation by YARD 0.9.34 + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Hyde::Handlers::GET + + + +

    +
    + +
    +
    Inherits:
    +
    + Handler + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    lib/hyde/probe/http_method.rb
    +
    + +
    + +

    Overview

    +
    +

    Probe that executes callback on a GET

    + + +
    +
    +
    + + +
    +

    Direct Known Subclasses

    +

    CONNECT, DELETE, HEAD, OPTIONS, PATCH, POST, PUT, TRACE

    +
    + + +

    + Constant Summary + collapse +

    + +
    + +
    METHOD = + +
    +
    "GET"
    + +
    + + + + + + + +

    Instance Attribute Summary

    + +

    Attributes inherited from Handler

    +

    #request, #response

    + + + +

    Attributes inherited from Probe

    +

    #properties

    + + + +

    Attributes inherited from Node

    +

    #remap, #root

    + + + +

    + Instance Method Summary + collapse +

    + + + + + + + + + + + + + +

    Methods inherited from Handler

    +

    #initialize

    + + + + + + + + + +

    Methods inherited from Probe

    +

    #initialize

    + + + + + + + + + +

    Methods inherited from Node

    +

    #go, #initialize, #reject

    +
    +

    Constructor Details

    + +

    This class inherits a constructor from Hyde::Handlers::Handler

    + +
    + + +
    +

    Instance Method Details

    + + +
    +

    + + #process(request) ⇒ Boolean + + + + + +

    +
    +

    Method callback on successful request navigation. +Runs block supplied with object initialization. +Request's #splat and #param are passed to block.

    + +

    Callback's returned should be one of viable responses:

    + +
      +
    • Response object
    • +
    • An array that matches Rack return form
    • +
    • An array that matches old (Rack 2.x) return form
    • +
    • A string (returned as HTML with code 200)
    • +
    • false (bounces the request to next handler)
    • +
    + + +
    +
    +
    +

    Parameters:

    + + +

    Returns:

    +
      + +
    • + + + (Boolean) + + + + — +

      true if further navigation is possible

      +
      + +
    • + +
    +

    Raises:

    +
      + +
    • + + + (UncaughtThrowError) + + + + — +

      may raise if die() is called.

      +
      + +
    • + +
    + +
    + + + + +
    +
    +
    +
    +25
    +26
    +27
    +28
    +29
    +30
    +31
    +
    +
    # File 'lib/hyde/probe/http_method.rb', line 25
    +
    +def process(request)
    +  unless request.request_method.casecmp(self.class::METHOD).zero?
    +    return false
    +  end
    +
    +  super(request)
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/doc/Hyde/Handlers/HEAD.html b/doc/Hyde/Handlers/HEAD.html new file mode 100644 index 0000000..4f5bd68 --- /dev/null +++ b/doc/Hyde/Handlers/HEAD.html @@ -0,0 +1,220 @@ + + + + + + + Class: Hyde::Handlers::HEAD + + — Documentation by YARD 0.9.34 + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Hyde::Handlers::HEAD + + + +

    +
    + +
    +
    Inherits:
    +
    + GET + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    lib/hyde/probe/http_method.rb
    +
    + +
    + +

    Overview

    +
    +

    Probe that executes callback on a HEAD

    + + +
    +
    +
    + + +
    + +

    + Constant Summary + collapse +

    + +
    + +
    METHOD = + +
    +
    "HEAD"
    + +
    + + + + + + + +

    Instance Attribute Summary

    + +

    Attributes inherited from Handler

    +

    #request, #response

    + + + +

    Attributes inherited from Probe

    +

    #properties

    + + + +

    Attributes inherited from Node

    +

    #remap, #root

    + + + + + + + + + +

    Method Summary

    + +

    Methods inherited from GET

    +

    #process

    + + + + + + + + + +

    Methods inherited from Handler

    +

    #initialize, #process

    + + + + + + + + + +

    Methods inherited from Probe

    +

    #initialize, #process

    + + + + + + + + + +

    Methods inherited from Node

    +

    #go, #initialize, #process, #reject

    +
    +

    Constructor Details

    + +

    This class inherits a constructor from Hyde::Handlers::Handler

    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/doc/Hyde/Handlers/Handler.html b/doc/Hyde/Handlers/Handler.html new file mode 100644 index 0000000..2273f8b --- /dev/null +++ b/doc/Hyde/Handlers/Handler.html @@ -0,0 +1,597 @@ + + + + + + + Class: Hyde::Handlers::Handler + + — Documentation by YARD 0.9.34 + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Hyde::Handlers::Handler + + + +

    +
    + +
    +
    Inherits:
    +
    + Probe + +
      +
    • Object
    • + + + + + + + +
    + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    lib/hyde/probe/handler.rb
    +
    + +
    + +

    Overview

    +
    +

    Probe that executes a callback on request

    + + +
    +
    +
    + + +
    +

    Direct Known Subclasses

    +

    GET

    +
    + + + + +

    Instance Attribute Summary collapse

    +
      + +
    • + + + #request ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

      Returns the value of attribute request.

      +
      + +
    • + + +
    • + + + #response ⇒ Object + + + + + + + + + + + + + + + + +

      Returns the value of attribute response.

      +
      + +
    • + + +
    + + + + + +

    Attributes inherited from Probe

    +

    #properties

    + + + +

    Attributes inherited from Node

    +

    #remap, #root

    + + + +

    + Instance Method Summary + collapse +

    + + + + + + + + + + + + + + + + + + + +

    Methods inherited from Node

    +

    #go, #reject

    +
    +

    Constructor Details

    + +
    +

    + + #initialize(path, parent:, &exec) ⇒ Handler + + + + + +

    +
    +

    Returns a new instance of Handler.

    + + +
    +
    +
    +

    Parameters:

    +
      + +
    • + + path + + + (Object) + + + +
    • + +
    • + + parent + + + (Hyde::Node) + + + +
    • + +
    • + + exec + + + (#call) + + + +
    • + +
    + + +
    + + + + +
    +
    +
    +
    +12
    +13
    +14
    +15
    +16
    +17
    +
    +
    # File 'lib/hyde/probe/handler.rb', line 12
    +
    +def initialize(path, parent:, &exec)
    +  super(path, parent: parent)
    +  @callback = exec
    +  @context = Hyde::ProbeContext.new(self)
    +  @response = nil
    +end
    +
    +
    + +
    + +
    +

    Instance Attribute Details

    + + + +
    +

    + + #requestObject (readonly) + + + + + +

    +
    +

    Returns the value of attribute request.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +20
    +21
    +22
    +
    +
    # File 'lib/hyde/probe/handler.rb', line 20
    +
    +def request
    +  @request
    +end
    +
    +
    + + + +
    +

    + + #responseObject + + + + + +

    +
    +

    Returns the value of attribute response.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +19
    +20
    +21
    +
    +
    # File 'lib/hyde/probe/handler.rb', line 19
    +
    +def response
    +  @response
    +end
    +
    +
    + +
    + + +
    +

    Instance Method Details

    + + +
    +

    + + #process(request) ⇒ Boolean + + + + + +

    +
    +

    Method callback on successful request navigation. +Runs block supplied with object initialization. +Request's #splat and #param are passed to block.

    + +

    Callback's returned should be one of viable responses:

    + +
      +
    • Response object
    • +
    • An array that matches Rack return form
    • +
    • An array that matches old (Rack 2.x) return form
    • +
    • A string (returned as HTML with code 200)
    • +
    • false (bounces the request to next handler)
    • +
    + + +
    +
    +
    +

    Parameters:

    + + +

    Returns:

    +
      + +
    • + + + (Boolean) + + + + — +

      true if further navigation is possible

      +
      + +
    • + +
    +

    Raises:

    +
      + +
    • + + + (UncaughtThrowError) + + + + — +

      may raise if die() is called.

      +
      + +
    • + +
    + +
    + + + + +
    +
    +
    +
    +36
    +37
    +38
    +39
    +40
    +41
    +42
    +43
    +44
    +45
    +46
    +47
    +48
    +49
    +50
    +51
    +52
    +53
    +
    +
    # File 'lib/hyde/probe/handler.rb', line 36
    +
    +def process(request)
    +  @response = nil
    +  return reject(request) unless request.path.match?(/^\/?$/)
    + 
    +  @request = request
    +  response = catch(:break) do
    +    @context.instance_exec(*request.splat,
    +                           **request.param,
    +                           &@callback)
    +  end
    +  return false unless response
    + 
    +  if @response and [String, File, IO].include? response.class
    +    @response.body = response
    +    throw :finish, @response
    +  end
    +  throw :finish, response
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/doc/Hyde/Handlers/OPTIONS.html b/doc/Hyde/Handlers/OPTIONS.html new file mode 100644 index 0000000..1557b39 --- /dev/null +++ b/doc/Hyde/Handlers/OPTIONS.html @@ -0,0 +1,220 @@ + + + + + + + Class: Hyde::Handlers::OPTIONS + + — Documentation by YARD 0.9.34 + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Hyde::Handlers::OPTIONS + + + +

    +
    + +
    +
    Inherits:
    +
    + GET + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    lib/hyde/probe/http_method.rb
    +
    + +
    + +

    Overview

    +
    +

    Probe that executes callback on a OPTIONS

    + + +
    +
    +
    + + +
    + +

    + Constant Summary + collapse +

    + +
    + +
    METHOD = + +
    +
    "OPTIONS"
    + +
    + + + + + + + +

    Instance Attribute Summary

    + +

    Attributes inherited from Handler

    +

    #request, #response

    + + + +

    Attributes inherited from Probe

    +

    #properties

    + + + +

    Attributes inherited from Node

    +

    #remap, #root

    + + + + + + + + + +

    Method Summary

    + +

    Methods inherited from GET

    +

    #process

    + + + + + + + + + +

    Methods inherited from Handler

    +

    #initialize, #process

    + + + + + + + + + +

    Methods inherited from Probe

    +

    #initialize, #process

    + + + + + + + + + +

    Methods inherited from Node

    +

    #go, #initialize, #process, #reject

    +
    +

    Constructor Details

    + +

    This class inherits a constructor from Hyde::Handlers::Handler

    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/doc/Hyde/Handlers/PATCH.html b/doc/Hyde/Handlers/PATCH.html new file mode 100644 index 0000000..12c153f --- /dev/null +++ b/doc/Hyde/Handlers/PATCH.html @@ -0,0 +1,220 @@ + + + + + + + Class: Hyde::Handlers::PATCH + + — Documentation by YARD 0.9.34 + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Hyde::Handlers::PATCH + + + +

    +
    + +
    +
    Inherits:
    +
    + GET + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    lib/hyde/probe/http_method.rb
    +
    + +
    + +

    Overview

    +
    +

    Probe that executes callback on a PATCH

    + + +
    +
    +
    + + +
    + +

    + Constant Summary + collapse +

    + +
    + +
    METHOD = + +
    +
    "PATCH"
    + +
    + + + + + + + +

    Instance Attribute Summary

    + +

    Attributes inherited from Handler

    +

    #request, #response

    + + + +

    Attributes inherited from Probe

    +

    #properties

    + + + +

    Attributes inherited from Node

    +

    #remap, #root

    + + + + + + + + + +

    Method Summary

    + +

    Methods inherited from GET

    +

    #process

    + + + + + + + + + +

    Methods inherited from Handler

    +

    #initialize, #process

    + + + + + + + + + +

    Methods inherited from Probe

    +

    #initialize, #process

    + + + + + + + + + +

    Methods inherited from Node

    +

    #go, #initialize, #process, #reject

    +
    +

    Constructor Details

    + +

    This class inherits a constructor from Hyde::Handlers::Handler

    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/doc/Hyde/Handlers/POST.html b/doc/Hyde/Handlers/POST.html new file mode 100644 index 0000000..8c23108 --- /dev/null +++ b/doc/Hyde/Handlers/POST.html @@ -0,0 +1,220 @@ + + + + + + + Class: Hyde::Handlers::POST + + — Documentation by YARD 0.9.34 + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Hyde::Handlers::POST + + + +

    +
    + +
    +
    Inherits:
    +
    + GET + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    lib/hyde/probe/http_method.rb
    +
    + +
    + +

    Overview

    +
    +

    Probe that executes callback on a POST

    + + +
    +
    +
    + + +
    + +

    + Constant Summary + collapse +

    + +
    + +
    METHOD = + +
    +
    "POST"
    + +
    + + + + + + + +

    Instance Attribute Summary

    + +

    Attributes inherited from Handler

    +

    #request, #response

    + + + +

    Attributes inherited from Probe

    +

    #properties

    + + + +

    Attributes inherited from Node

    +

    #remap, #root

    + + + + + + + + + +

    Method Summary

    + +

    Methods inherited from GET

    +

    #process

    + + + + + + + + + +

    Methods inherited from Handler

    +

    #initialize, #process

    + + + + + + + + + +

    Methods inherited from Probe

    +

    #initialize, #process

    + + + + + + + + + +

    Methods inherited from Node

    +

    #go, #initialize, #process, #reject

    +
    +

    Constructor Details

    + +

    This class inherits a constructor from Hyde::Handlers::Handler

    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/doc/Hyde/Handlers/PUT.html b/doc/Hyde/Handlers/PUT.html new file mode 100644 index 0000000..ef40433 --- /dev/null +++ b/doc/Hyde/Handlers/PUT.html @@ -0,0 +1,220 @@ + + + + + + + Class: Hyde::Handlers::PUT + + — Documentation by YARD 0.9.34 + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Hyde::Handlers::PUT + + + +

    +
    + +
    +
    Inherits:
    +
    + GET + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    lib/hyde/probe/http_method.rb
    +
    + +
    + +

    Overview

    +
    +

    Probe that executes callback on a PUT

    + + +
    +
    +
    + + +
    + +

    + Constant Summary + collapse +

    + +
    + +
    METHOD = + +
    +
    "PUT"
    + +
    + + + + + + + +

    Instance Attribute Summary

    + +

    Attributes inherited from Handler

    +

    #request, #response

    + + + +

    Attributes inherited from Probe

    +

    #properties

    + + + +

    Attributes inherited from Node

    +

    #remap, #root

    + + + + + + + + + +

    Method Summary

    + +

    Methods inherited from GET

    +

    #process

    + + + + + + + + + +

    Methods inherited from Handler

    +

    #initialize, #process

    + + + + + + + + + +

    Methods inherited from Probe

    +

    #initialize, #process

    + + + + + + + + + +

    Methods inherited from Node

    +

    #go, #initialize, #process, #reject

    +
    +

    Constructor Details

    + +

    This class inherits a constructor from Hyde::Handlers::Handler

    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/doc/Hyde/Handlers/Serve.html b/doc/Hyde/Handlers/Serve.html new file mode 100644 index 0000000..799e46e --- /dev/null +++ b/doc/Hyde/Handlers/Serve.html @@ -0,0 +1,469 @@ + + + + + + + Class: Hyde::Handlers::Serve + + — Documentation by YARD 0.9.34 + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Hyde::Handlers::Serve + + + +

    +
    + +
    +
    Inherits:
    +
    + Probe + +
      +
    • Object
    • + + + + + + + +
    + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    lib/hyde/probe/serve_handler.rb
    +
    + +
    + +

    Overview

    +
    +

    Probe that sends files from a location

    + + +
    +
    +
    + + +
    + + + +

    Instance Attribute Summary collapse

    +
      + +
    • + + + #response ⇒ Object + + + + + + + + + + + + + + + + +

      Returns the value of attribute response.

      +
      + +
    • + + +
    + + + + + +

    Attributes inherited from Probe

    +

    #properties

    + + + +

    Attributes inherited from Node

    +

    #remap, #root

    + + + +

    + Instance Method Summary + collapse +

    + + + + + + + + + + + + + + + + + + + +

    Methods inherited from Node

    +

    #go, #reject

    +
    +

    Constructor Details

    + +
    +

    + + #initialize(path, parent:) ⇒ Serve + + + + + +

    +
    +

    Returns a new instance of Serve.

    + + +
    +
    +
    +

    Parameters:

    +
      + +
    • + + path + + + (Object) + + + +
    • + +
    • + + parent + + + (Hyde::Node) + + + +
    • + +
    • + + exec + + + (#call) + + + +
    • + +
    + + +
    + + + + +
    +
    +
    +
    +12
    +13
    +14
    +
    +
    # File 'lib/hyde/probe/serve_handler.rb', line 12
    +
    +def initialize(path, parent:)
    +  super(path, parent: parent)
    +end
    +
    +
    + +
    + +
    +

    Instance Attribute Details

    + + + +
    +

    + + #responseObject + + + + + +

    +
    +

    Returns the value of attribute response.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +16
    +17
    +18
    +
    +
    # File 'lib/hyde/probe/serve_handler.rb', line 16
    +
    +def response
    +  @response
    +end
    +
    +
    + +
    + + +
    +

    Instance Method Details

    + + +
    +

    + + #process(request) ⇒ Boolean + + + + + +

    +
    +

    Method callback on successful request navigation. +Tries to serve files matched by handler

    + + +
    +
    +
    +

    Parameters:

    + + +

    Returns:

    +
      + +
    • + + + (Boolean) + + + + — +

      true if file was found

      +
      + +
    • + +
    + +
    + + + + +
    +
    +
    +
    +22
    +23
    +24
    +25
    +26
    +27
    +28
    +29
    +
    +
    # File 'lib/hyde/probe/serve_handler.rb', line 22
    +
    +def process(request)
    +  path = File.expand_path(request.filepath)
    +  return unless path.start_with? @properties["path"]
    +
    +  File.open(path.delete_suffix("/"))
    +rescue StandardError
    +  false
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/doc/Hyde/Handlers/TRACE.html b/doc/Hyde/Handlers/TRACE.html new file mode 100644 index 0000000..c8ac125 --- /dev/null +++ b/doc/Hyde/Handlers/TRACE.html @@ -0,0 +1,220 @@ + + + + + + + Class: Hyde::Handlers::TRACE + + — Documentation by YARD 0.9.34 + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Hyde::Handlers::TRACE + + + +

    +
    + +
    +
    Inherits:
    +
    + GET + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    lib/hyde/probe/http_method.rb
    +
    + +
    + +

    Overview

    +
    +

    Probe that executes callback on a TRACE

    + + +
    +
    +
    + + +
    + +

    + Constant Summary + collapse +

    + +
    + +
    METHOD = + +
    +
    "TRACE"
    + +
    + + + + + + + +

    Instance Attribute Summary

    + +

    Attributes inherited from Handler

    +

    #request, #response

    + + + +

    Attributes inherited from Probe

    +

    #properties

    + + + +

    Attributes inherited from Node

    +

    #remap, #root

    + + + + + + + + + +

    Method Summary

    + +

    Methods inherited from GET

    +

    #process

    + + + + + + + + + +

    Methods inherited from Handler

    +

    #initialize, #process

    + + + + + + + + + +

    Methods inherited from Probe

    +

    #initialize, #process

    + + + + + + + + + +

    Methods inherited from Node

    +

    #go, #initialize, #process, #reject

    +
    +

    Constructor Details

    + +

    This class inherits a constructor from Hyde::Handlers::Handler

    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/doc/Hyde/Node.html b/doc/Hyde/Node.html index 80a0c21..72f1392 100644 --- a/doc/Hyde/Node.html +++ b/doc/Hyde/Node.html @@ -105,8 +105,10 @@ This class is abstract.
    +

    Abstract class that reacts to request navigation. +Does nothing by default, behaviour should be overriden through

    -

    Abstract class that reacts to request navigation. Does nothing by default, behaviour should be overriden through #reject and #process

    +

    reject and #process

    @@ -145,8 +147,7 @@ -
    -

    Returns the value of attribute remap.

    +

    Returns the value of attribute remap.

    @@ -172,8 +173,7 @@ -
    -

    Returns the value of attribute root.

    +

    Returns the value of attribute root.

    @@ -209,8 +209,7 @@ -
    -

    Try to navigate the path.

    +

    Try to navigate the path.

    @@ -235,8 +234,7 @@ -
    -

    A new instance of Node.

    +

    A new instance of Node.

    @@ -259,8 +257,7 @@ -
    -

    Method callback on successful request navigation.

    +

    Method callback on successful request navigation.

    @@ -283,8 +280,7 @@ -
    -

    Method callback on failed request navigation.

    +

    Method callback on failed request navigation.

    @@ -307,8 +303,7 @@
    - -

    Returns a new instance of Node.

    +

    Returns a new instance of Node.

    @@ -376,8 +371,7 @@
    - -

    Returns the value of attribute remap.

    +

    Returns the value of attribute remap.

    @@ -419,8 +413,7 @@
    - -

    Returns the value of attribute root.

    +

    Returns the value of attribute root.

    @@ -467,8 +460,7 @@
    - -

    Try to navigate the path. Run method callback in response.

    +

    Try to navigate the path. Run method callback in response.

    @@ -562,8 +554,7 @@
    - -

    Method callback on successful request navigation

    +

    Method callback on successful request navigation

    @@ -596,8 +587,7 @@ -
    -

    true

    +

    true

    @@ -636,8 +626,7 @@
    - -

    Method callback on failed request navigation

    +

    Method callback on failed request navigation

    @@ -670,8 +659,7 @@ -
    -

    false

    +

    false

    @@ -704,7 +692,7 @@
    diff --git a/doc/Hyde/OPTIONSHandler.html b/doc/Hyde/OPTIONSHandler.html index 22312de..481dcee 100644 --- a/doc/Hyde/OPTIONSHandler.html +++ b/doc/Hyde/OPTIONSHandler.html @@ -211,7 +211,7 @@
    diff --git a/doc/Hyde/PATCHHandler.html b/doc/Hyde/PATCHHandler.html index 0b44079..9ade95d 100644 --- a/doc/Hyde/PATCHHandler.html +++ b/doc/Hyde/PATCHHandler.html @@ -211,7 +211,7 @@
    diff --git a/doc/Hyde/POSTHandler.html b/doc/Hyde/POSTHandler.html index debc523..4954867 100644 --- a/doc/Hyde/POSTHandler.html +++ b/doc/Hyde/POSTHandler.html @@ -211,7 +211,7 @@
    diff --git a/doc/Hyde/PUTHandler.html b/doc/Hyde/PUTHandler.html index 3989021..3d3f53c 100644 --- a/doc/Hyde/PUTHandler.html +++ b/doc/Hyde/PUTHandler.html @@ -211,7 +211,7 @@
    diff --git a/doc/Hyde/Path.html b/doc/Hyde/Path.html index b2340da..0557357 100644 --- a/doc/Hyde/Path.html +++ b/doc/Hyde/Path.html @@ -103,8 +103,7 @@

    Overview

    - -

    Primary building block of request navigation.

    +

    Primary building block of request navigation.

    @@ -125,10 +124,15 @@
    -
    Binding = +
    ProcContext =
    -
    Hyde::PathBinding
    +
    Hyde::ProcessorContext
    + +
    Context = + +
    +
    Hyde::PathContext
    @@ -161,8 +165,7 @@ -
    -

    Returns the value of attribute children.

    +

    Returns the value of attribute children.

    @@ -190,8 +193,7 @@ -
    -

    Returns the value of attribute properties.

    +

    Returns the value of attribute properties.

    @@ -232,8 +234,7 @@ -
    -

    Add a filter to the path.

    +

    Add a filter to the path.

    @@ -258,8 +259,7 @@ -
    -

    A new instance of Path.

    +

    A new instance of Path.

    @@ -282,8 +282,7 @@ -
    -

    Add a postprocessor to the path.

    +

    Add a postprocessor to the path.

    @@ -306,8 +305,7 @@ -
    -

    Add a preprocessor to the path.

    +

    Add a preprocessor to the path.

    @@ -330,8 +328,7 @@ -
    -

    Method callback on successful request navigation.

    +

    Method callback on successful request navigation.

    @@ -365,8 +362,7 @@
    - -

    Returns a new instance of Path.

    +

    Returns a new instance of Path.

    @@ -385,8 +381,7 @@ — -
    -

    Object to generate Hyde::Pattern from

    +

    Object to generate Hyde::Pattern from

    @@ -401,8 +396,7 @@ — -
    -

    Parent object to inherit properties to

    +

    Parent object to inherit properties to

    @@ -417,8 +411,7 @@ — -
    -

    Setup block

    +

    Setup block

    @@ -432,21 +425,22 @@
     
     
    -27
    -28
    -29
    -30
    -31
    -32
    -33
    -34
    -35
    -36
    -37
    -38
    +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50
    -
    # File 'lib/hyde/path.rb', line 27
    +      
    # File 'lib/hyde/path.rb', line 38
     
     def initialize(path, parent:, &setup)
       super(path, parent: parent)
    @@ -456,9 +450,10 @@
       @preprocessors = []
       @postprocessors = []
       @filters = []
    -
    -  binding = Binding.new(self)
    -  binding.instance_exec(&setup)
    +  # Contexts setup
    +  context = self.class::Context.new(self)
    +  context.instance_exec(&setup)
    +  @proccontext = self.class::ProcContext.new(self)
     end
    -
    # File 'lib/hyde/path.rb', line 86
    +      
    # File 'lib/hyde/path.rb', line 98
     
     def children
       @children
    @@ -526,8 +520,7 @@
       
     
    - -

    Returns the value of attribute properties.

    +

    Returns the value of attribute properties.

    @@ -541,12 +534,12 @@
     
     
    -86
    -87
    -88
    +98 +99 +100
    -
    # File 'lib/hyde/path.rb', line 86
    +      
    # File 'lib/hyde/path.rb', line 98
     
     def properties
       @properties
    @@ -574,8 +567,8 @@
       
     
    - -

    Add a filter to the path. Blocks path access if a filter returns false.

    +

    Add a filter to the path. +Blocks path access if a filter returns false.

    @@ -619,12 +612,12 @@
     
     
    -82
    -83
    -84
    +94 +95 +96
    -
    # File 'lib/hyde/path.rb', line 82
    +      
    # File 'lib/hyde/path.rb', line 94
     
     def filter(&block)
       @filters.append(block)
    @@ -645,8 +638,7 @@
       
     
    - -

    Add a postprocessor to the path.

    +

    Add a postprocessor to the path.

    @@ -701,12 +693,12 @@
     
     
    -74
    -75
    -76
    +86 +87 +88
    -
    # File 'lib/hyde/path.rb', line 74
    +      
    # File 'lib/hyde/path.rb', line 86
     
     def postprocess(&block)
       @postprocessors.append(block)
    @@ -727,8 +719,8 @@
       
     
    - -

    Add a preprocessor to the path. Does not modify path execution.

    +

    Add a preprocessor to the path. +Does not modify path execution.

    @@ -772,12 +764,12 @@
     
     
    -66
    -67
    -68
    +78 +79 +80
    -
    # File 'lib/hyde/path.rb', line 66
    +      
    # File 'lib/hyde/path.rb', line 78
     
     def preprocess(&block)
       @preprocessors.append(block)
    @@ -798,8 +790,8 @@
       
     
    - -

    Method callback on successful request navigation. Finds the next appropriate path to go to.

    +

    Method callback on successful request navigation. +Finds the next appropriate path to go to.

    @@ -817,8 +809,7 @@ — -
    -

    true if further navigation will be done

    +

    true if further navigation will be done

    @@ -835,8 +826,7 @@ — -
    -

    by default throws :response if no matches found.

    +

    by default throws :response if no matches found.

    @@ -849,26 +839,26 @@
     
     
    -44
    -45
    -46
    -47
    -48
    -49
    -50
    -51
    -52
    -53
    -54
    -55
     56
     57
     58
     59
    -60
    +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72
    -
    # File 'lib/hyde/path.rb', line 44
    +      
    # File 'lib/hyde/path.rb', line 56
     
     def process(request)
       return false unless run_filters(request)
    @@ -897,7 +887,7 @@
     
     
           
    diff --git a/doc/Hyde/PathContext.html b/doc/Hyde/PathContext.html
    new file mode 100644
    index 0000000..f10c891
    --- /dev/null
    +++ b/doc/Hyde/PathContext.html
    @@ -0,0 +1,242 @@
    +
    +
    +  
    +    
    +
    +
    +  Class: Hyde::PathContext
    +  
    +    — Documentation by YARD 0.9.34
    +  
    +
    +
    +  
    +
    +  
    +
    +
    +
    +
    +  
    +
    +  
    +
    +
    +  
    +  
    +    
    +
    +    
    + + +

    Class: Hyde::PathContext + + + +

    +
    + +
    +
    Inherits:
    +
    + Object + +
      +
    • Object
    • + + + +
    + show all + +
    +
    + + + + + + +
    +
    Includes:
    +
    DSL::PathConstructors, DSL::PathMethods
    +
    + + + + + + +
    +
    Defined in:
    +
    lib/hyde/path.rb
    +
    + +
    + +

    Overview

    +
    +

    Execution context for path setup block.

    + + +
    +
    +
    + + +
    +

    Direct Known Subclasses

    +

    ServerContext

    +
    + + + + + + + + +

    + Instance Method Summary + collapse +

    + + + + + + + + + + + + + +

    Methods included from DSL::PathMethods

    +

    #filter, #index, #postprocess, #preprocess, #remap, #root

    + + + + + + + + + +

    Methods included from DSL::PathConstructors

    +

    #connect, #delete, #get, #head, #options, #patch, #path, #post, #probe, #put, #register, #serve, #trace

    +
    +

    Constructor Details

    + +
    +

    + + #initialize(path) ⇒ PathContext + + + + + +

    +
    +

    Returns a new instance of PathContext.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +25
    +26
    +27
    +
    +
    # File 'lib/hyde/path.rb', line 25
    +
    +def initialize(path)
    +  @origin = path
    +end
    +
    +
    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/doc/Hyde/Pattern.html b/doc/Hyde/Pattern.html index af2693e..fe2827b 100644 --- a/doc/Hyde/Pattern.html +++ b/doc/Hyde/Pattern.html @@ -101,8 +101,8 @@

    Overview

    - -

    Delegate class for all available patterns. Picks appropriate pattern based on contents.

    +

    Delegate class for all available patterns. +Picks appropriate pattern based on contents.

    @@ -144,8 +144,7 @@ -
    -

    A new instance of Pattern.

    +

    A new instance of Pattern.

    @@ -168,8 +167,7 @@ -
    -

    Match the string and assign matches to parameters.

    +

    Match the string and assign matches to parameters.

    @@ -192,8 +190,7 @@ -
    -

    Test if a string can be matched.

    +

    Test if a string can be matched.

    @@ -216,8 +213,7 @@ -
    -

    Checks if pattern object is static (is a simple String pattern).

    +

    Checks if pattern object is static (is a simple String pattern).

    @@ -240,8 +236,7 @@
    - -

    Returns a new instance of Pattern.

    +

    Returns a new instance of Pattern.

    @@ -260,8 +255,7 @@ — -
    -

    object to generate pattern from

    +

    object to generate pattern from

    @@ -310,15 +304,14 @@
    - -

    Match the string and assign matches to parameters. Returns:

    -
    • -

      Unmatched part of a string

      -
    • -

      Unnamed parameters

      -
    • -

      Named parameters

      -
    +

    Match the string and assign matches to parameters. +Returns:

    + +
      +
    • Unmatched part of a string
    • +
    • Unnamed parameters
    • +
    • Named parameters
    • +
    @@ -337,8 +330,7 @@ — -
    -

    String to match

    +

    String to match

    @@ -365,8 +357,7 @@ — -
    -

    if input doesn’t match pattern

    +

    if input doesn't match pattern

    @@ -423,8 +414,8 @@
    - -

    Test if a string can be matched. Lighter version of match that doesn’t assign any variables.

    +

    Test if a string can be matched. +Lighter version of match that doesn't assign any variables.

    @@ -443,8 +434,7 @@ — -
    -

    String to match

    +

    String to match

    @@ -505,8 +495,7 @@
    - -

    Checks if pattern object is static (is a simple String pattern).

    +

    Checks if pattern object is static (is a simple String pattern).

    @@ -553,7 +542,7 @@
    diff --git a/doc/Hyde/PatternMatching.html b/doc/Hyde/PatternMatching.html index b994167..2c2623c 100644 --- a/doc/Hyde/PatternMatching.html +++ b/doc/Hyde/PatternMatching.html @@ -87,8 +87,8 @@

    Overview

    - -

    Utility functions and pattern-generator classes. Used primarily to create patterns for path definitions.

    +

    Utility functions and pattern-generator classes. +Used primarily to create patterns for path definitions.

    @@ -138,8 +138,7 @@ -
    -

    Strips extra slashes from a string.

    +

    Strips extra slashes from a string.

    @@ -165,8 +164,8 @@
    - -

    Strips extra slashes from a string. (including slashes at the start and end of the string)

    +

    Strips extra slashes from a string. +(including slashes at the start and end of the string)

    @@ -232,7 +231,7 @@
    diff --git a/doc/Hyde/PatternMatching/Glob.html b/doc/Hyde/PatternMatching/Glob.html index 6b028a6..246bc63 100644 --- a/doc/Hyde/PatternMatching/Glob.html +++ b/doc/Hyde/PatternMatching/Glob.html @@ -101,63 +101,72 @@

    Overview

    - -

    Implements glob-like pattern matching. Exact specifications for globbing rules:

    +

    Implements glob-like pattern matching. +Exact specifications for globbing rules:

    -

    “/”

    +

    "/"

    -
    - act as directory separators
    -- multiple slashes (i.e. "///") are the same as one slash ("/")
    -- slashes are stripped at start and end of an expression or path
    -- slashes are not matched by anything but the globstar ("**")
    -
    +
      +
    • act as directory separators
    • +
    • multiple slashes (i.e. "///") are the same as one slash ("/")
    • +
    • slashes are stripped at start and end of an expression or path
    • +
    • slashes are not matched by anything but the globstar ("**")
    • +
    -

    “*” ( regexp: /([^/]*)/ )

    +

    "" ( regexp: /([^/])/ )

    -
    - matches from 0 to any number of characters
    -- does not match nothing if placed between two slashes (i.e "/*/")
    -- result is captured in an array
    -- stops at slashes
    -- greedy (matches as much as possible)
    -
    +
      +
    • matches from 0 to any number of characters
    • +
    • does not match nothing if placed between two slashes (i.e "/*/")
    • +
    • result is captured in an array
    • +
    • stops at slashes
    • +
    • greedy (matches as much as possible)
    • +
    -

    “**” ( regexp: /(.*)/ )

    +

    "*" ( regexp: /(.)/ )

    -
    - matches any number of characters
    -- matches slashes ("/")
    -- result is captured in an array
    -- does not stop at slashes
    -- greedy (matches as much as possible)
    -
    +
      +
    • matches any number of characters
    • +
    • matches slashes ("/")
    • +
    • result is captured in an array
    • +
    • does not stop at slashes
    • +
    • greedy (matches as much as possible)
    • +
    -

    “[…]+” ( regexp: itself, ! and ^ at the start are interchangeable )

    +

    "[...]+" ( regexp: itself, ! and ^ at the start are interchangeable )

    -
    - acts like a regexp range
    -- matches any characters, including slashes if specified
    -- matches any number of characters
    -- valid ways to specify a range: [A-z], [a-z], [9-z] (ascii order)
    -- ! or ^ at the start invert meaning (any character not in range)
    -- result is captured in an array
    -
    +
      +
    • acts like a regexp range
    • +
    • matches any characters, including slashes if specified
    • +
    • matches any number of characters
    • +
    • valid ways to specify a range: [A-z], [a-z], 9-z
    • +
    • ! or ^ at the start invert meaning (any character not in range)
    • +
    • result is captured in an array
    • +
    -

    “:name” ( regexp: acts like a named group for /[^/]*/ )

    +

    ":name" ( regexp: acts like a named group for /[^/]*/ )

    -
    - acts like * as defined above
    -- result is captured in a hash with "name" as key
    -- name allows alphanumeric characters and underscores
    -- ignored unless placed between two slashes
    -
    +
      +
    • acts like * as defined above
    • +
    • result is captured in a hash with "name" as key
    • +
    • name allows alphanumeric characters and underscores
    • +
    • ignored unless placed between two slashes
    • +
    -

    “(name|name2|…)” ( regexp: itself )

    +

    "(name|name2|...)" ( regexp: itself )

    -
    - matches any of (full keywords) name, name2, ...
    -- result is captured in an array
    -- each name may include only these groups of characters:
    -  - alphanumeric
    -  - slashes
    -  - underscores
    -  - dashes
    -
    +
      +
    • matches any of (full keywords) name, name2, ...
    • +
    • result is captured in an array
    • +
    • each name may include only these groups of characters: + +
        +
      • alphanumeric
      • +
      • slashes
      • +
      • underscores
      • +
      • dashes
      • +
    • +
    @@ -197,8 +206,7 @@ -
    -

    Test if input is convertible to a Glob and if it should be converted.

    +

    Test if input is convertible to a Glob and if it should be converted.

    @@ -232,8 +240,7 @@ -
    -

    A new instance of Glob.

    +

    A new instance of Glob.

    @@ -256,8 +263,7 @@ -
    -

    Match the string and assign matches to parameters.

    +

    Match the string and assign matches to parameters.

    @@ -280,8 +286,7 @@ -
    -

    Test if a string can be matched.

    +

    Test if a string can be matched.

    @@ -304,8 +309,7 @@
    - -

    Returns a new instance of Glob.

    +

    Returns a new instance of Glob.

    @@ -324,8 +328,7 @@ — -
    -

    Glob pattern

    +

    Glob pattern

    @@ -382,8 +385,7 @@
    - -

    Test if input is convertible to a Glob and if it should be converted

    +

    Test if input is convertible to a Glob and if it should be converted

    @@ -416,8 +418,7 @@ — -
    -

    Input can be safely converted to Glob

    +

    Input can be safely converted to Glob

    @@ -464,15 +465,14 @@
    - -

    Match the string and assign matches to parameters. Returns:

    -
    • -

      Unmatched part of a string

      -
    • -

      Unnamed parameters

      -
    • -

      Named parameters

      -
    +

    Match the string and assign matches to parameters. +Returns:

    + +
      +
    • Unmatched part of a string
    • +
    • Unnamed parameters
    • +
    • Named parameters
    • +
    @@ -491,8 +491,7 @@ — -
    -

    String to match

    +

    String to match

    @@ -519,8 +518,7 @@ — -
    -

    if input doesn’t match glob

    +

    if input doesn't match glob

    @@ -571,8 +569,8 @@
    - -

    Test if a string can be matched. Lighter version of match that doesn’t assign any variables.

    +

    Test if a string can be matched. +Lighter version of match that doesn't assign any variables.

    @@ -591,8 +589,7 @@ — -
    -

    String to match

    +

    String to match

    @@ -641,7 +638,7 @@
    diff --git a/doc/Hyde/PatternMatching/ReMatch.html b/doc/Hyde/PatternMatching/ReMatch.html index 843c1ce..8a055e7 100644 --- a/doc/Hyde/PatternMatching/ReMatch.html +++ b/doc/Hyde/PatternMatching/ReMatch.html @@ -104,18 +104,17 @@
    Note: -
    -

    If you are planning to write your own pattern, this is the easiest one to read.

    +

    If you are planning to write your own pattern, this is the easiest one to read.

    +

    Regexp pattern matching wrapper. +Following principles apply to the wrapper:

    -

    Regexp pattern matching wrapper. Following principles apply to the wrapper:

    -
    • -

      Regexp input is canonicalized using Hyde::PatternMatching.canonicalize

      -
    • -

      Matched content and anything before it is consumed in #match output

      -
    +
      +
    • Regexp input is canonicalized using Hyde::PatternMatching.canonicalize
    • +
    • Matched content and anything before it is consumed in #match output
    • +
    @@ -155,8 +154,7 @@ -
    -

    Test if input is convertible and if it should be converted.

    +

    Test if input is convertible and if it should be converted.

    @@ -190,8 +188,7 @@ -
    -

    A new instance of ReMatch.

    +

    A new instance of ReMatch.

    @@ -214,8 +211,7 @@ -
    -

    Match the string and assign matches to parameters.

    +

    Match the string and assign matches to parameters.

    @@ -238,8 +234,7 @@ -
    -

    Test if a string can be matched.

    +

    Test if a string can be matched.

    @@ -262,8 +257,7 @@
    - -

    Returns a new instance of ReMatch.

    +

    Returns a new instance of ReMatch.

    @@ -310,8 +304,7 @@
    - -

    Test if input is convertible and if it should be converted.

    +

    Test if input is convertible and if it should be converted.

    @@ -344,8 +337,7 @@ — -
    -

    Input can be safely converted to Glob

    +

    Input can be safely converted to Glob

    @@ -390,15 +382,14 @@
    - -

    Match the string and assign matches to parameters. Returns:

    -
    • -

      Unmatched part of a string

      -
    • -

      Unnamed parameters

      -
    • -

      Named parameters

      -
    +

    Match the string and assign matches to parameters. +Returns:

    + +
      +
    • Unmatched part of a string
    • +
    • Unnamed parameters
    • +
    • Named parameters
    • +
    @@ -417,8 +408,7 @@ — -
    -

    String to match

    +

    String to match

    @@ -445,8 +435,7 @@ — -
    -

    if input doesn’t match regexp

    +

    if input doesn't match regexp

    @@ -491,8 +480,8 @@
    - -

    Test if a string can be matched. Lighter version of match that doesn’t assign any variables.

    +

    Test if a string can be matched. +Lighter version of match that doesn't assign any variables.

    @@ -511,8 +500,7 @@ — -
    -

    String to match

    +

    String to match

    @@ -559,7 +547,7 @@
    diff --git a/doc/Hyde/Probe.html b/doc/Hyde/Probe.html index 2282d75..7a43863 100644 --- a/doc/Hyde/Probe.html +++ b/doc/Hyde/Probe.html @@ -103,8 +103,7 @@

    Overview

    - -

    Test probe. Also base for all “reactive” nodes.

    +

    Test probe. Also base for all "reactive" nodes.

    @@ -114,7 +113,7 @@

    Direct Known Subclasses

    -

    Handler, ServeHandler

    +

    Handlers::Handler, Handlers::Serve

    @@ -145,8 +144,7 @@ -
    -

    Returns the value of attribute properties.

    +

    Returns the value of attribute properties.

    @@ -189,8 +187,7 @@ -
    -

    A new instance of Probe.

    +

    A new instance of Probe.

    @@ -213,8 +210,7 @@ -
    -

    Method callback on successful request navigation.

    +

    Method callback on successful request navigation.

    @@ -248,8 +244,7 @@
    - -

    Returns a new instance of Probe.

    +

    Returns a new instance of Probe.

    @@ -289,12 +284,12 @@
     
     
    -23
    -24
    -25
    +41 +42 +43
    -
    # File 'lib/hyde/probe.rb', line 23
    +      
    # File 'lib/hyde/probe.rb', line 41
     
     def initialize(path, parent:)
       super(path, parent: parent)
    @@ -322,8 +317,7 @@
       
     
    - -

    Returns the value of attribute properties.

    +

    Returns the value of attribute properties.

    @@ -337,12 +331,12 @@
     
     
    -27
    -28
    -29
    +45 +46 +47
    -
    # File 'lib/hyde/probe.rb', line 27
    +      
    # File 'lib/hyde/probe.rb', line 45
     
     def properties
       @properties
    @@ -370,8 +364,9 @@
       
     
    - -

    Method callback on successful request navigation. Throws an error upon reaching the path. This behaviour should only be used internally.

    +

    Method callback on successful request navigation. +Throws an error upon reaching the path. +This behaviour should only be used internally.

    @@ -404,8 +399,7 @@ — -
    -

    true if further navigation is possible

    +

    true if further navigation is possible

    @@ -431,17 +425,17 @@
     
     
    -35
    -36
    -37
    -38
    -39
    -40
    -41
    -42
    +53 +54 +55 +56 +57 +58 +59 +60
    -
    # File 'lib/hyde/probe.rb', line 35
    +      
    # File 'lib/hyde/probe.rb', line 53
     
     def process(request)
       return reject(request) unless request.path.match?(/^\/?$/)
    @@ -461,7 +455,7 @@
     
     
           
    diff --git a/doc/Hyde/ProbeContext.html b/doc/Hyde/ProbeContext.html
    new file mode 100644
    index 0000000..7447eb1
    --- /dev/null
    +++ b/doc/Hyde/ProbeContext.html
    @@ -0,0 +1,249 @@
    +
    +
    +  
    +    
    +
    +
    +  Class: Hyde::ProbeContext
    +  
    +    — Documentation by YARD 0.9.34
    +  
    +
    +
    +  
    +
    +  
    +
    +
    +
    +
    +  
    +
    +  
    +
    +
    +  
    +  
    +    
    +
    +    
    + + +

    Class: Hyde::ProbeContext + + + +

    +
    + +
    +
    Inherits:
    +
    + Object + +
      +
    • Object
    • + + + +
    + show all + +
    +
    + + + + + + +
    +
    Includes:
    +
    DSL::CommonMethods, DSL::ProbeConstructors, DSL::ProbeMethods
    +
    + + + + + + +
    +
    Defined in:
    +
    lib/hyde/probe.rb
    +
    + +
    + +

    Overview

    +
    +

    Context that provides execution context for Probes.

    + + +
    +
    +
    + + +
    + + + + + + + +

    + Instance Method Summary + collapse +

    + + + + + + + + + + + + + +

    Methods included from DSL::CommonMethods

    +

    #bounce, #die

    + + + + + + + + + +

    Methods included from DSL::ProbeMethods

    +

    #file, #form, #form?, #header, #remove_header, #request, #status

    + + + + + + + + + +

    Methods included from DSL::ProbeConstructors

    +

    #erb

    +
    +

    Constructor Details

    + +
    +

    + + #initialize(origin) ⇒ ProbeContext + + + + + +

    +
    +

    Returns a new instance of ProbeContext.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +32
    +33
    +34
    +
    +
    # File 'lib/hyde/probe.rb', line 32
    +
    +def initialize(origin)
    +  @origin = origin
    +end
    +
    +
    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/doc/Hyde/ProcessorContext.html b/doc/Hyde/ProcessorContext.html new file mode 100644 index 0000000..b902533 --- /dev/null +++ b/doc/Hyde/ProcessorContext.html @@ -0,0 +1,227 @@ + + + + + + + Class: Hyde::ProcessorContext + + — Documentation by YARD 0.9.34 + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Hyde::ProcessorContext + + + +

    +
    + +
    +
    Inherits:
    +
    + Object + +
      +
    • Object
    • + + + +
    + show all + +
    +
    + + + + + + +
    +
    Includes:
    +
    DSL::CommonMethods
    +
    + + + + + + +
    +
    Defined in:
    +
    lib/hyde/path.rb
    +
    + +
    + +

    Overview

    +
    +

    Execution context for filters and preprocessors.

    + + +
    +
    +
    + + +
    + + + + + + + +

    + Instance Method Summary + collapse +

    + + + + + + + + + + + + + +

    Methods included from DSL::CommonMethods

    +

    #bounce, #die

    +
    +

    Constructor Details

    + +
    +

    + + #initialize(path) ⇒ ProcessorContext + + + + + +

    +
    +

    Returns a new instance of ProcessorContext.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +15
    +16
    +17
    +
    +
    # File 'lib/hyde/path.rb', line 15
    +
    +def initialize(path)
    +  @origin = path
    +end
    +
    +
    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/doc/Hyde/Request.html b/doc/Hyde/Request.html index 9efd6fe..1ad005f 100644 --- a/doc/Hyde/Request.html +++ b/doc/Hyde/Request.html @@ -101,8 +101,7 @@

    Overview

    - -

    Request wrapper for Rack protocol

    +

    Request wrapper for Rack protocol

    @@ -137,8 +136,7 @@ -
    -

    Returns the value of attribute filepath.

    +

    Returns the value of attribute filepath.

    @@ -166,8 +164,7 @@ -
    -

    Returns the value of attribute headers.

    +

    Returns the value of attribute headers.

    @@ -195,8 +192,7 @@ -
    -

    Returns the value of attribute param.

    +

    Returns the value of attribute param.

    @@ -222,8 +218,7 @@ -
    -

    Returns the value of attribute path.

    +

    Returns the value of attribute path.

    @@ -251,8 +246,7 @@ -
    -

    Returns the value of attribute path_info.

    +

    Returns the value of attribute path_info.

    @@ -280,8 +274,7 @@ -
    -

    Returns the value of attribute postprocessors.

    +

    Returns the value of attribute postprocessors.

    @@ -309,8 +302,7 @@ -
    -

    Returns the value of attribute query.

    +

    Returns the value of attribute query.

    @@ -338,8 +330,7 @@ -
    -

    Returns the value of attribute request_method.

    +

    Returns the value of attribute request_method.

    @@ -367,8 +358,7 @@ -
    -

    Returns the value of attribute script_name.

    +

    Returns the value of attribute script_name.

    @@ -396,8 +386,7 @@ -
    -

    Returns the value of attribute server_name.

    +

    Returns the value of attribute server_name.

    @@ -425,8 +414,7 @@ -
    -

    Returns the value of attribute server_port.

    +

    Returns the value of attribute server_port.

    @@ -454,8 +442,7 @@ -
    -

    Returns the value of attribute server_protocol.

    +

    Returns the value of attribute server_protocol.

    @@ -483,8 +470,7 @@ -
    -

    Returns the value of attribute splat.

    +

    Returns the value of attribute splat.

    @@ -520,8 +506,7 @@ -
    -

    Returns request body (if POST data exists).

    +

    Returns request body (if POST data exists).

    @@ -546,8 +531,30 @@ -
    -

    A new instance of Request.

    +

    A new instance of Request.

    +
    + + + + +
  • + + + #input ⇒ IO + + + + + + + + + + + + + +

    Returns raw Rack input object.

  • @@ -570,8 +577,7 @@ -
    -

    Load last navigation state (path, splat, param) from state stack.

    +

    Load last navigation state (path, splat, param) from state stack.

    @@ -594,8 +600,7 @@ -
    -

    Push current navigation state (path, splat, param) onto state stack.

    +

    Push current navigation state (path, splat, param) onto state stack.

    @@ -618,8 +623,7 @@ -
    -

    Run postprocessors.

    +

    Run postprocessors.

    @@ -642,8 +646,7 @@
    - -

    Returns a new instance of Request.

    +

    Returns a new instance of Request.

    @@ -703,7 +706,7 @@ # Rack environment variable bindings. Should be public and frozen. init_request_params(env) # Query parsing - @query = Query.new(@query_string) + @query = Hyde::Util::Query.new(@query_string) # Pattern matching parameters. Public, readable, unfrozen. @param = {} @splat = [] @@ -741,8 +744,7 @@
    - -

    Returns the value of attribute filepath.

    +

    Returns the value of attribute filepath.

    @@ -756,12 +758,12 @@
     
     
    -59
    -60
    -61
    +65 +66 +67
    -
    # File 'lib/hyde/request.rb', line 59
    +      
    # File 'lib/hyde/request.rb', line 65
     
     def filepath
       @filepath
    @@ -784,8 +786,7 @@
       
     
    - -

    Returns the value of attribute headers.

    +

    Returns the value of attribute headers.

    @@ -799,12 +800,12 @@
     
     
    -56
    -57
    -58
    +62 +63 +64
    -
    # File 'lib/hyde/request.rb', line 56
    +      
    # File 'lib/hyde/request.rb', line 62
     
     def headers
       @headers
    @@ -827,8 +828,7 @@
       
     
    - -

    Returns the value of attribute param.

    +

    Returns the value of attribute param.

    @@ -842,12 +842,12 @@
     
     
    -56
    -57
    -58
    +62 +63 +64
    -
    # File 'lib/hyde/request.rb', line 56
    +      
    # File 'lib/hyde/request.rb', line 62
     
     def param
       @param
    @@ -870,8 +870,7 @@
       
     
    - -

    Returns the value of attribute path.

    +

    Returns the value of attribute path.

    @@ -885,12 +884,12 @@
     
     
    -59
    -60
    -61
    +65 +66 +67
    -
    # File 'lib/hyde/request.rb', line 59
    +      
    # File 'lib/hyde/request.rb', line 65
     
     def path
       @path
    @@ -913,8 +912,7 @@
       
     
    - -

    Returns the value of attribute path_info.

    +

    Returns the value of attribute path_info.

    @@ -928,12 +926,12 @@
     
     
    -56
    -57
    -58
    +62 +63 +64
    -
    # File 'lib/hyde/request.rb', line 56
    +      
    # File 'lib/hyde/request.rb', line 62
     
     def path_info
       @path_info
    @@ -956,8 +954,7 @@
       
     
    - -

    Returns the value of attribute postprocessors.

    +

    Returns the value of attribute postprocessors.

    @@ -971,12 +968,12 @@
     
     
    -56
    -57
    -58
    +62 +63 +64
    -
    # File 'lib/hyde/request.rb', line 56
    +      
    # File 'lib/hyde/request.rb', line 62
     
     def postprocessors
       @postprocessors
    @@ -999,8 +996,7 @@
       
     
    - -

    Returns the value of attribute query.

    +

    Returns the value of attribute query.

    @@ -1014,12 +1010,12 @@
     
     
    -56
    -57
    -58
    +62 +63 +64
    -
    # File 'lib/hyde/request.rb', line 56
    +      
    # File 'lib/hyde/request.rb', line 62
     
     def query
       @query
    @@ -1042,8 +1038,7 @@
       
     
    - -

    Returns the value of attribute request_method.

    +

    Returns the value of attribute request_method.

    @@ -1057,12 +1052,12 @@
     
     
    -56
    -57
    -58
    +62 +63 +64
    -
    # File 'lib/hyde/request.rb', line 56
    +      
    # File 'lib/hyde/request.rb', line 62
     
     def request_method
       @request_method
    @@ -1085,8 +1080,7 @@
       
     
    - -

    Returns the value of attribute script_name.

    +

    Returns the value of attribute script_name.

    @@ -1100,12 +1094,12 @@
     
     
    -56
    -57
    -58
    +62 +63 +64
    -
    # File 'lib/hyde/request.rb', line 56
    +      
    # File 'lib/hyde/request.rb', line 62
     
     def script_name
       @script_name
    @@ -1128,8 +1122,7 @@
       
     
    - -

    Returns the value of attribute server_name.

    +

    Returns the value of attribute server_name.

    @@ -1143,12 +1136,12 @@
     
     
    -56
    -57
    -58
    +62 +63 +64
    -
    # File 'lib/hyde/request.rb', line 56
    +      
    # File 'lib/hyde/request.rb', line 62
     
     def server_name
       @server_name
    @@ -1171,8 +1164,7 @@
       
     
    - -

    Returns the value of attribute server_port.

    +

    Returns the value of attribute server_port.

    @@ -1186,12 +1178,12 @@
     
     
    -56
    -57
    -58
    +62 +63 +64
    -
    # File 'lib/hyde/request.rb', line 56
    +      
    # File 'lib/hyde/request.rb', line 62
     
     def server_port
       @server_port
    @@ -1214,8 +1206,7 @@
       
     
    - -

    Returns the value of attribute server_protocol.

    +

    Returns the value of attribute server_protocol.

    @@ -1229,12 +1220,12 @@
     
     
    -56
    -57
    -58
    +62 +63 +64
    -
    # File 'lib/hyde/request.rb', line 56
    +      
    # File 'lib/hyde/request.rb', line 62
     
     def server_protocol
       @server_protocol
    @@ -1257,8 +1248,7 @@
       
     
    - -

    Returns the value of attribute splat.

    +

    Returns the value of attribute splat.

    @@ -1272,12 +1262,12 @@
     
     
    -56
    -57
    -58
    +62 +63 +64
    -
    # File 'lib/hyde/request.rb', line 56
    +      
    # File 'lib/hyde/request.rb', line 62
     
     def splat
       @splat
    @@ -1305,8 +1295,7 @@
       
     
    - -

    Returns request body (if POST data exists)

    +

    Returns request body (if POST data exists)

    @@ -1341,7 +1330,64 @@
    # File 'lib/hyde/request.rb', line 42
     
     def body
    -  @body ||= @rack.input&.gets
    +  @body ||= @rack.input&.read
    +end
    +
    +
    + +
    +

    + + #inputIO + + + + + +

    +
    +

    Returns raw Rack input object

    + + +
    +
    +
    + +

    Returns:

    +
      + +
    • + + + (IO) + + + + — +

      (May not entirely be compatible with IO, see Rack/SPEC.rdoc)

      +
      + +
    • + +
    + +
    + + + @@ -1359,8 +1405,7 @@
    - -

    Load last navigation state (path, splat, param) from state stack

    +

    Load last navigation state (path, splat, param) from state stack

    @@ -1374,12 +1419,12 @@
     
     
    -52
    -53
    -54
    +58 +59 +60
    + +
    +
    +
    +
    +48
    +49
    +50
    +
    +
    # File 'lib/hyde/request.rb', line 48
    +
    +def input
    +  @rack.input
     end
    -
    # File 'lib/hyde/request.rb', line 52
    +      
    # File 'lib/hyde/request.rb', line 58
     
     def pop_state
       @path, @param, @splat, @filepath = @states.pop
    @@ -1400,8 +1445,7 @@
       
     
    - -

    Push current navigation state (path, splat, param) onto state stack

    +

    Push current navigation state (path, splat, param) onto state stack

    @@ -1415,12 +1459,12 @@
     
     
    -47
    -48
    -49
    +53 +54 +55
    -
    # File 'lib/hyde/request.rb', line 47
    +      
    # File 'lib/hyde/request.rb', line 53
     
     def push_state
       @states.push([@path, @param.dup, @splat.dup, @filepath.dup])
    @@ -1441,8 +1485,7 @@
       
     
    - -

    Run postprocessors

    +

    Run postprocessors

    @@ -1495,7 +1538,7 @@
    diff --git a/doc/Hyde/Response.html b/doc/Hyde/Response.html index e5fa4ba..7900382 100644 --- a/doc/Hyde/Response.html +++ b/doc/Hyde/Response.html @@ -101,8 +101,7 @@

    Overview

    - -

    Rack protocol response wrapper.

    +

    Rack protocol response wrapper.

    @@ -137,8 +136,7 @@ -
    -

    Returns the value of attribute body.

    +

    Returns the value of attribute body.

    @@ -164,8 +162,7 @@ -
    -

    Returns the value of attribute chunk_size.

    +

    Returns the value of attribute chunk_size.

    @@ -191,8 +188,7 @@ -
    -

    Returns the value of attribute headers.

    +

    Returns the value of attribute headers.

    @@ -218,8 +214,7 @@ -
    -

    Returns the value of attribute status.

    +

    Returns the value of attribute status.

    @@ -255,8 +250,7 @@ -
    -

    Turn body into array of chunks.

    +

    Turn body into array of chunks.

    @@ -279,8 +273,7 @@ -
    -

    Ensure response correctness.

    +

    Ensure response correctness.

    @@ -312,8 +305,7 @@ -
    -

    Add a header to the headers hash.

    +

    Add a header to the headers hash.

    @@ -336,8 +328,7 @@ -
    -

    Delete a header value from the headers hash If no value is provided, deletes all key entries.

    +

    Delete a header value from the headers hash If no value is provided, deletes all key entries.

    @@ -360,8 +351,7 @@ -
    -

    Return internal representation of Rack response.

    +

    Return internal representation of Rack response.

    @@ -386,8 +376,7 @@ -
    -

    A new instance of Response.

    +

    A new instance of Response.

    @@ -410,8 +399,7 @@ -
    -

    Make internal representation conformant.

    +

    Make internal representation conformant.

    @@ -434,8 +422,7 @@
    - -

    Returns a new instance of Response.

    +

    Returns a new instance of Response.

    @@ -515,8 +502,7 @@
    - -

    Returns the value of attribute body.

    +

    Returns the value of attribute body.

    @@ -558,8 +544,7 @@
    - -

    Returns the value of attribute chunk_size.

    +

    Returns the value of attribute chunk_size.

    @@ -601,8 +586,7 @@
    - -

    Returns the value of attribute headers.

    +

    Returns the value of attribute headers.

    @@ -644,8 +628,7 @@
    - -

    Returns the value of attribute status.

    +

    Returns the value of attribute status.

    @@ -692,8 +675,7 @@
    - -

    Turn body into array of chunks

    +

    Turn body into array of chunks

    @@ -761,8 +743,7 @@
    - -

    Ensure response correctness

    +

    Ensure response correctness

    @@ -795,8 +776,7 @@ -
    -

    Response

    +

    Response

    @@ -867,8 +847,7 @@
    - -

    Add a header to the headers hash

    +

    Add a header to the headers hash

    @@ -887,8 +866,7 @@ — -
    -

    header name

    +

    header name

    @@ -903,8 +881,7 @@ — -
    -

    header value

    +

    header value

    @@ -956,8 +933,8 @@
    - -

    Delete a header value from the headers hash If no value is provided, deletes all key entries

    +

    Delete a header value from the headers hash +If no value is provided, deletes all key entries

    @@ -976,8 +953,7 @@ — -
    -

    header name

    +

    header name

    @@ -994,8 +970,7 @@ — -
    -

    header value

    +

    header value

    @@ -1043,8 +1018,7 @@
    - -

    Return internal representation of Rack response

    +

    Return internal representation of Rack response

    @@ -1097,8 +1071,7 @@
    - -

    Make internal representation conformant

    +

    Make internal representation conformant

    @@ -1167,7 +1140,7 @@
    diff --git a/doc/Hyde/ServeHandler.html b/doc/Hyde/ServeHandler.html index eb34b2e..1d0b2d9 100644 --- a/doc/Hyde/ServeHandler.html +++ b/doc/Hyde/ServeHandler.html @@ -307,12 +307,12 @@
     
     
    +11
     12
    -13
    -14
    +13
    -
    # File 'lib/hyde/probe/serve_handler.rb', line 12
    +      
    # File 'lib/hyde/probe/serve_handler.rb', line 11
     
     def initialize(path, parent:)
       super(path, parent: parent)
    @@ -355,12 +355,12 @@
           
     
     
    +15
     16
    -17
    -18
    +17
    -
    # File 'lib/hyde/probe/serve_handler.rb', line 16
    +      
    # File 'lib/hyde/probe/serve_handler.rb', line 15
     
     def response
       @response
    @@ -436,17 +436,17 @@
           
     
     
    +21
     22
     23
     24
     25
     26
     27
    -28
    -29
    +28
    -
    # File 'lib/hyde/probe/serve_handler.rb', line 22
    +      
    # File 'lib/hyde/probe/serve_handler.rb', line 21
     
     def process(request)
       path = File.expand_path(request.filepath)
    @@ -466,7 +466,7 @@
     
     
           
    diff --git a/doc/Hyde/Server.html b/doc/Hyde/Server.html
    index 0166536..99c4cac 100644
    --- a/doc/Hyde/Server.html
    +++ b/doc/Hyde/Server.html
    @@ -105,8 +105,7 @@
     
     

    Overview

    - -

    A specialized path that can be used directly as a Rack application.

    +

    A specialized path that can be used directly as a Rack application.

    @@ -123,16 +122,22 @@
    -
    Binding = +
    Context =
    -
    ServerBinding
    +
    ServerContext
    + + +

    Constants inherited + from Path

    +

    Path::ProcContext

    + @@ -172,8 +177,7 @@ -
    -

    Rack ingress point.

    +

    Rack ingress point.

    @@ -198,8 +202,7 @@ -
    -

    A new instance of Server.

    +

    A new instance of Server.

    @@ -244,8 +247,7 @@
    - -

    Returns a new instance of Server.

    +

    Returns a new instance of Server.

    @@ -266,8 +268,7 @@ — -
    -

    Parent object to inherit properties to

    +

    Parent object to inherit properties to

    @@ -282,8 +283,7 @@ — -
    -

    Setup block

    +

    Setup block

    @@ -297,6 +297,7 @@
     
     
    +17
     18
     19
     20
    @@ -312,11 +313,10 @@
     30
     31
     32
    -33
    -34
    +33
    -
    # File 'lib/hyde/server.rb', line 18
    +      
    # File 'lib/hyde/server.rb', line 17
     
     def initialize(parent: nil, &setup)
       super("", parent: parent, &setup)
    @@ -358,8 +358,9 @@
       
     
    - -

    Rack ingress point. This should not be called under any circumstances twice in the same application, although server nesting for the purpose of creating virtual hosts is allowed.

    +

    Rack ingress point. +This should not be called under any circumstances twice in the same application, +although server nesting for the purpose of creating virtual hosts is allowed.

    @@ -401,17 +402,17 @@
     
     
    +40
     41
     42
     43
     44
     45
     46
    -47
    -48
    +47
    -
    # File 'lib/hyde/server.rb', line 41
    +      
    # File 'lib/hyde/server.rb', line 40
     
     def call(env)
       request = Hyde::Request.new(env)
    @@ -431,7 +432,7 @@
     
     
           
    diff --git a/doc/Hyde/ServerContext.html b/doc/Hyde/ServerContext.html
    new file mode 100644
    index 0000000..76d4d19
    --- /dev/null
    +++ b/doc/Hyde/ServerContext.html
    @@ -0,0 +1,162 @@
    +
    +
    +  
    +    
    +
    +
    +  Class: Hyde::ServerContext
    +  
    +    — Documentation by YARD 0.9.34
    +  
    +
    +
    +  
    +
    +  
    +
    +
    +
    +
    +  
    +
    +  
    +
    +
    +  
    +  
    +    
    +
    +    
    + + +

    Class: Hyde::ServerContext + + + +

    +
    + +
    +
    Inherits:
    +
    + PathContext + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    lib/hyde/server.rb
    +
    + +
    + + + + + + + + + + + + + + + +

    Method Summary

    + +

    Methods inherited from PathContext

    +

    #initialize

    + + + + + + + + + +

    Methods included from DSL::PathMethods

    +

    #filter, #index, #postprocess, #preprocess, #remap, #root

    + + + + + + + + + +

    Methods included from DSL::PathConstructors

    +

    #connect, #delete, #get, #head, #options, #patch, #path, #post, #probe, #put, #register, #serve, #trace

    +
    +

    Constructor Details

    + +

    This class inherits a constructor from Hyde::PathContext

    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/doc/Hyde/TRACEHandler.html b/doc/Hyde/TRACEHandler.html index 30a8e7e..169d3a8 100644 --- a/doc/Hyde/TRACEHandler.html +++ b/doc/Hyde/TRACEHandler.html @@ -211,7 +211,7 @@ diff --git a/doc/Hyde/Template.html b/doc/Hyde/Template.html new file mode 100644 index 0000000..3e7cfea --- /dev/null +++ b/doc/Hyde/Template.html @@ -0,0 +1,763 @@ + + + + + + + Class: Hyde::Template + + — Documentation by YARD 0.9.34 + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Hyde::Template + Abstract + + +

    +
    + +
    +
    Inherits:
    +
    + Object + +
      +
    • Object
    • + + + +
    + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    lib/hyde/template.rb
    +
    + +
    + +

    Overview

    +
    +
    + This class is abstract. +

    does not represent any actual template engine.

    +
    +
    +

    Interface for Template engines

    + + +
    +
    +
    + + +
    +

    Direct Known Subclasses

    +

    Hyde::Templates::ERB

    +
    + + + + +

    Instance Attribute Summary collapse

    +
      + +
    • + + + #binding ⇒ Object + + + + + + + + + + + + + + + + +

      Returns the value of attribute binding.

      +
      + +
    • + + +
    + + + + + +

    + Instance Method Summary + collapse +

    + + + + +
    +

    Constructor Details

    + +
    +

    + + #initialize(input, toplevel: nil, locals: nil) ⇒ Template + + + + + +

    +
    +

    Returns a new instance of Template.

    + + +
    +
    +
    +

    Parameters:

    +
      + +
    • + + input + + + (String, File) + + + +
    • + +
    • + + context + + + (Binding, nil) + + + +
    • + +
    • + + locals + + + (Hash, nil) + + + (defaults to: nil) + + +
    • + +
    + + +
    + + + + +
    +
    +
    +
    +30
    +31
    +32
    +33
    +34
    +35
    +36
    +37
    +38
    +
    +
    # File 'lib/hyde/template.rb', line 30
    +
    +def initialize(input, toplevel: nil, locals: nil)
    +  @template = input.is_a?(File) ? input.read : input
    +  input.close if input.is_a? File
    +  @binding = toplevel or binding
    +  locals&.each do |k, v|
    +    @binding.local_variable_set(k,v)
    +  end
    +  @context = TemplateContext.new(self)
    +end
    +
    +
    + +
    + +
    +

    Instance Attribute Details

    + + + +
    +

    + + #bindingObject + + + + + +

    +
    +

    Returns the value of attribute binding.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +74
    +75
    +76
    +
    +
    # File 'lib/hyde/template.rb', line 74
    +
    +def binding
    +  @binding
    +end
    +
    +
    + +
    + + +
    +

    Instance Method Details

    + + +
    +

    + + #local_variable_get(key) ⇒ Object + + + + + +

    +
    +

    Get local variable

    + + +
    +
    +
    +

    Parameters:

    +
      + +
    • + + key + + + (Symbol) + + + +
    • + +
    + +

    Returns:

    +
      + +
    • + + + (Object) + + + +
    • + +
    + +
    + + + + +
    +
    +
    +
    +50
    +51
    +52
    +
    +
    # File 'lib/hyde/template.rb', line 50
    +
    +def local_variable_get(key)
    +  @binding.local_variable_get(key)
    +end
    +
    +
    + +
    +

    + + #local_variable_set(key, value) ⇒ Object + + + + + +

    +
    +

    Set local variable

    + + +
    +
    +
    +

    Parameters:

    +
      + +
    • + + key + + + (Symbol) + + + +
    • + +
    • + + value + + + (Object) + + + +
    • + +
    + + +
    + + + + +
    +
    +
    +
    +43
    +44
    +45
    +
    +
    # File 'lib/hyde/template.rb', line 43
    +
    +def local_variable_set(key, value)
    +  @binding.local_variable_set(key, value)
    +end
    +
    +
    + +
    +

    + + #local_variablesArray(Symbol) + + + + + +

    +
    +

    Get an array of defined local variables

    + + +
    +
    +
    + +

    Returns:

    +
      + +
    • + + + (Array(Symbol)) + + + +
    • + +
    + +
    + + + + +
    +
    +
    +
    +56
    +57
    +58
    +
    +
    # File 'lib/hyde/template.rb', line 56
    +
    +def local_variables
    +  @binding.local_variables
    +end
    +
    +
    + +
    +

    + + #override_locals(vars) ⇒ Object + + + + + +

    +
    +

    Override binding variables.

    + + +
    +
    +
    +

    Parameters:

    +
      + +
    • + + vars + + + (Hash{Symbol => Object}) + + + +
    • + +
    + + +
    + + + + +
    +
    +
    +
    +62
    +63
    +64
    +65
    +66
    +
    +
    # File 'lib/hyde/template.rb', line 62
    +
    +def override_locals(vars)
    +  vars.each do |k, v|
    +    @binding.local_variable_set(k, v)
    +  end
    +end
    +
    +
    + +
    +

    + + #runObject + + + + + +

    +
    + +
    + Note: +

    This method is a stub.

    +
    +
    + +

    Run the template

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +70
    +71
    +72
    +
    +
    # File 'lib/hyde/template.rb', line 70
    +
    +def run
    +  # ... (stub)
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/doc/Hyde/TemplateContext.html b/doc/Hyde/TemplateContext.html new file mode 100644 index 0000000..76d099d --- /dev/null +++ b/doc/Hyde/TemplateContext.html @@ -0,0 +1,249 @@ + + + + + + + Class: Hyde::TemplateContext + + — Documentation by YARD 0.9.34 + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Hyde::TemplateContext + + + +

    +
    + +
    +
    Inherits:
    +
    + Object + +
      +
    • Object
    • + + + +
    + show all + +
    +
    + + + + + + +
    +
    Includes:
    +
    DSL::CommonMethods, DSL::ProbeConstructors, DSL::ProbeMethods
    +
    + + + + + + +
    +
    Defined in:
    +
    lib/hyde/template.rb
    +
    + +
    + +

    Overview

    +
    +

    Context for template engines

    + + +
    +
    +
    + + +
    + + + + + + + +

    + Instance Method Summary + collapse +

    + + + + + + + + + + + + + +

    Methods included from DSL::ProbeConstructors

    +

    #erb

    + + + + + + + + + +

    Methods included from DSL::ProbeMethods

    +

    #file, #form, #form?, #header, #remove_header, #request, #status

    + + + + + + + + + +

    Methods included from DSL::CommonMethods

    +

    #bounce, #die

    +
    +

    Constructor Details

    + +
    +

    + + #initialize(parent) ⇒ TemplateContext + + + + + +

    +
    +

    Returns a new instance of TemplateContext.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +19
    +20
    +21
    +
    +
    # File 'lib/hyde/template.rb', line 19
    +
    +def initialize(parent)
    +  @origin = parent
    +end
    +
    +
    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/doc/Hyde/Templates.html b/doc/Hyde/Templates.html new file mode 100644 index 0000000..5a658e6 --- /dev/null +++ b/doc/Hyde/Templates.html @@ -0,0 +1,127 @@ + + + + + + + Module: Hyde::Templates + + — Documentation by YARD 0.9.34 + + + + + + + + + + + + + + + + + + + +
    + + +

    Module: Hyde::Templates + + + +

    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    lib/hyde/template.rb,
    + lib/hyde/template/erb.rb
    +
    +
    + +
    + +

    Overview

    +
    +

    All template engine adapters subclassed from Template

    + + +
    +
    +
    + + +

    Defined Under Namespace

    +

    + + + + + Classes: ERB + + +

    + + + + + + + + + +
    + + + +
    + + \ No newline at end of file diff --git a/doc/Hyde/Templates/ERB.html b/doc/Hyde/Templates/ERB.html new file mode 100644 index 0000000..4faaf33 --- /dev/null +++ b/doc/Hyde/Templates/ERB.html @@ -0,0 +1,311 @@ + + + + + + + Class: Hyde::Templates::ERB + + — Documentation by YARD 0.9.34 + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Hyde::Templates::ERB + + + +

    +
    + +
    +
    Inherits:
    +
    + Hyde::Template + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    lib/hyde/template/erb.rb
    +
    + +
    + +

    Overview

    +
    +

    ERB Template language adapter

    + + +
    +
    +
    + + +
    + + + + + +

    Instance Attribute Summary

    + +

    Attributes inherited from Hyde::Template

    +

    #binding

    + + + +

    + Instance Method Summary + collapse +

    + + + + + + + + + + + + + +

    Methods inherited from Hyde::Template

    +

    #local_variable_get, #local_variable_set, #local_variables, #override_locals

    +
    +

    Constructor Details

    + +
    +

    + + #initialize(input, toplevel: nil, locals: nil) ⇒ ERB + + + + + +

    +
    +

    Returns a new instance of ERB.

    + + +
    +
    +
    + + +

    See Also:

    +
      + +
    • Hyde::Template#new
    • + +
    + +
    + + + + +
    +
    +
    +
    +11
    +12
    +13
    +14
    +
    +
    # File 'lib/hyde/template/erb.rb', line 11
    +
    +def initialize(input, toplevel: nil, locals: nil)
    +  super
    +  @template = ::ERB.new(@template)
    +end
    +
    +
    + +
    + + +
    +

    Instance Method Details

    + + +
    +

    + + #runObject + + + + + +

    +
    +

    Run the template.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +17
    +18
    +19
    +20
    +21
    +
    +
    # File 'lib/hyde/template/erb.rb', line 17
    +
    +def run
    +  @context.instance_exec(@template) do |template|
    +    template.result @binding
    +  end
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/doc/Hyde/Util.html b/doc/Hyde/Util.html index c44f07c..887da0a 100644 --- a/doc/Hyde/Util.html +++ b/doc/Hyde/Util.html @@ -79,7 +79,7 @@
    Defined in:
    lib/hyde/util/lookup.rb,
    - lib/hyde/util/html.rb,
    lib/hyde/util/query.rb
    + lib/hyde/util/html.rb,
    lib/hyde/util/query.rb,
    lib/hyde/util/header.rb,
    lib/hyde/util/sorting.rb,
    lib/hyde/util/multipart.rb
    @@ -87,8 +87,7 @@

    Overview

    - -

    Various things that exists for purely logical reasons

    +

    Various things that exists for purely logical reasons

    @@ -100,9 +99,11 @@

    + Modules: ParserCommon + - Classes: Lookup, Query + Classes: FormPart, Lookup, MultipartParser, Query

    @@ -118,8 +119,8 @@
    HTTP_STATUS =
    - -

    HTTP status codes and descriptions Taken from WEBrick https://github.com/ruby/webrick/blob/master/lib/webrick/httpstatus.rb

    +

    HTTP status codes and descriptions +Taken from WEBrick https://github.com/ruby/webrick/blob/master/lib/webrick/httpstatus.rb

    @@ -165,6 +166,7 @@ 415 => 'Unsupported Media Type', 416 => 'Request Range Not Satisfiable', 417 => 'Expectation Failed', + 418 => "I'm a teapot", 422 => 'Unprocessable Entity', 423 => 'Locked', 424 => 'Failed Dependency', @@ -217,8 +219,7 @@ -
    -

    Default error page for Hyde.

    +

    Default error page for Hyde.

    @@ -241,8 +242,76 @@ -
    -

    Return string with escaped HTML entities.

    +

    Return string with escaped HTML entities.

    +
    + + + + +
  • + + + .make_value(input, opts, sep = ";") ⇒ String + + + + + + + + + + + + + +

    Construct a parametrized header value.

    +
    + +
  • + + +
  • + + + .parse_value(input, sep = ";") ⇒ Array(String, Hash) + + + + + + + + + + + + + +

    Parse parametrized header values.

    +
    + +
  • + + +
  • + + + .unescape_html(str) ⇒ String + + + + + + + + + + + + + +

    Return string with unescaped HTML entities.

  • @@ -268,8 +337,7 @@
    - -

    Default error page for Hyde

    +

    Default error page for Hyde

    @@ -288,8 +356,7 @@ — -
    -

    HTTP Status code

    +

    HTTP Status code

    @@ -304,8 +371,7 @@ — -
    -

    Message to show in backtrace window

    +

    Message to show in backtrace window

    @@ -332,15 +398,6 @@
     
     
    -78
    -79
    -80
    -81
    -82
    -83
    -84
    -85
    -86
     87
     88
     89
    @@ -358,10 +415,19 @@
     101
     102
     103
    -104
    +104 +105 +106 +107 +108 +109 +110 +111 +112 +113
    -
    # File 'lib/hyde/util/html.rb', line 78
    +      
    # File 'lib/hyde/util/html.rb', line 87
     
     def self.default_error_page(code, backtrace)
       backtrace ||= []
    @@ -407,7 +473,15 @@
     
    -

    Return string with escaped HTML entities

    +
    + Note: +

    Do not use this to inject untrusted input into JavaScript code

    +
    +
    + +

    Return string with escaped HTML entities. +or CSS style of the page. +This function is not adequate to prevent string interpolation.

    @@ -449,23 +523,279 @@
     
     
    -64
    -65
    -66
    -67
    -68
    -69
    -70
    +70 +71 +72
    -
    # File 'lib/hyde/util/html.rb', line 64
    +      
    # File 'lib/hyde/util/html.rb', line 70
     
     def self.escape_html(str)
    -  str.gsub("&", "&amp;")
    -     .gsub("<", "&lt;")
    -     .gsub(">", "&gt;")
    -     .gsub("\"", "&quot;")
    -     .gsub("'", "&#39;")
    +  CGI.escapeHTML(str)
    +end
    +
    +
    + +
    +

    + + .make_value(input, opts, sep = ";") ⇒ String + + + + + +

    +
    +

    Construct a parametrized header value

    + + +
    +
    +
    +

    Parameters:

    +
      + +
    • + + input + + + (String) + + + +
    • + +
    • + + opts + + + (Hash) + + + +
    • + +
    + +

    Returns:

    +
      + +
    • + + + (String) + + + +
    • + +
    + +
    + + + + +
    +
    +
    +
    +25
    +26
    +27
    +28
    +29
    +30
    +31
    +32
    +33
    +34
    +35
    +36
    +37
    +38
    +39
    +
    +
    # File 'lib/hyde/util/header.rb', line 25
    +
    +def self.make_value(input, opts, sep = ";")
    +  unless input.match?(/^[\w!#$%&'*+-.^_`|~]*=?[^[:cntrl:]\\",;]+$/)
    +    raise StandardError, "input contains invalid characters"
    +  end
    +
    +  output = input
    +  opts.each do |key, value|
    +    output += if value.is_a? String
    +                "#{sep} #{key}=#{value}"
    +              else
    +                "#{sep} #{key}"
    +              end
    +  end
    +  output
    +end
    +
    +
    + +
    +

    + + .parse_value(input, sep = ";") ⇒ Array(String, Hash) + + + + + +

    +
    +

    Parse parametrized header values

    + + +
    +
    +
    +

    Parameters:

    +
      + +
    • + + input + + + (String) + + + +
    • + +
    • + + sep + + + (String, Regexp) + + + (defaults to: ";") + + +
    • + +
    + +

    Returns:

    +
      + +
    • + + + (Array(String, Hash)) + + + +
    • + +
    + +
    + + + + +
    +
    +
    +
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +
    +
    # File 'lib/hyde/util/header.rb', line 11
    +
    +def self.parse_value(input, sep = ";")
    +  parts = input.split(sep).map { |x| URI.decode_uri_component(x).strip }
    +  base = parts.shift
    +  opts = parts.map do |raw|
    +    key, value = raw.match(/^([^=]*)(?:=(.*)|)\Z/).to_a[1..]
    +    [key, ((value&.match?(/^".*"$/) ? value[1..-2] : value) or true)]
    +  end.to_h
    +  [base, opts]
    +end
    +
    +
    + +
    +

    + + .unescape_html(str) ⇒ String + + + + + +

    +
    +

    Return string with unescaped HTML entities.

    + + +
    +
    +
    +

    Parameters:

    +
      + +
    • + + str + + + (String) + + + +
    • + +
    + +

    Returns:

    +
      + +
    • + + + (String) + + + +
    • + +
    + +
    + + + @@ -477,7 +807,7 @@ diff --git a/doc/Hyde/Util/FormPart.html b/doc/Hyde/Util/FormPart.html new file mode 100644 index 0000000..c70987c --- /dev/null +++ b/doc/Hyde/Util/FormPart.html @@ -0,0 +1,857 @@ + + + + + + + Class: Hyde::Util::FormPart + + — Documentation by YARD 0.9.34 + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Hyde::Util::FormPart + + + +

    +
    + +
    +
    Inherits:
    +
    + Struct + +
      +
    • Object
    • + + + + + +
    + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    lib/hyde/util/multipart.rb
    +
    + +
    + +

    Overview

    +
    +

    Valid element of form data with headers

    + + +
    +
    +
    + + +
    + + + +

    Instance Attribute Summary collapse

    +
      + +
    • + + + #data ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

      Data received in the field through form data.

      +
      + +
    • + + +
    • + + + #filename ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

      Original name of the sent file.

      +
      + +
    • + + +
    • + + + #filetype ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

      MIME-type of the file.

      +
      + +
    • + + +
    • + + + #name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

      name of the form part.

      +
      + +
    • + + +
    + + + + + +

    + Instance Method Summary + collapse +

    + + + + + + +
    +

    Instance Attribute Details

    + + + +
    +

    + + #dataObject (readonly) + + + + + +

    +
    +

    Data received in the field through form data

    + + +
    +
    +
    + + +
    +
    +
    +
    +77
    +78
    +79
    +
    +
    # File 'lib/hyde/util/html.rb', line 77
    +
    +def self.unescape_html(str)
    +  CGI.unescapeHTML(str)
     end
    + + + + +
    +
    +
    +
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    +24
    +25
    +26
    +27
    +28
    +29
    +30
    +
    +
    # File 'lib/hyde/util/multipart.rb', line 17
    +
    +FormPart = Struct.new(:data, :name, :filename,
    +                      :filetype, :tempfile, :headers) do
    +  # Is this form part a file or plain data?
    +  # @return [Boolean]
    +  def file?
    +    !tempfile.nil?
    +  end
    +
    +  # If FormPart is not a file, simplify to string.
    +  # @return [FormPart, String]
    +  def simplify
    +    file? ? self : self.data
    +  end
    +end
    +
    +
    + + + +
    +

    + + #filenameObject (readonly) + + + + + +

    +
    +

    Original name of the sent file

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    +24
    +25
    +26
    +27
    +28
    +29
    +30
    +
    +
    # File 'lib/hyde/util/multipart.rb', line 17
    +
    +FormPart = Struct.new(:data, :name, :filename,
    +                      :filetype, :tempfile, :headers) do
    +  # Is this form part a file or plain data?
    +  # @return [Boolean]
    +  def file?
    +    !tempfile.nil?
    +  end
    +
    +  # If FormPart is not a file, simplify to string.
    +  # @return [FormPart, String]
    +  def simplify
    +    file? ? self : self.data
    +  end
    +end
    +
    +
    + + + +
    +

    + + #filetypeObject (readonly) + + + + + +

    +
    +

    MIME-type of the file

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    +24
    +25
    +26
    +27
    +28
    +29
    +30
    +
    +
    # File 'lib/hyde/util/multipart.rb', line 17
    +
    +FormPart = Struct.new(:data, :name, :filename,
    +                      :filetype, :tempfile, :headers) do
    +  # Is this form part a file or plain data?
    +  # @return [Boolean]
    +  def file?
    +    !tempfile.nil?
    +  end
    +
    +  # If FormPart is not a file, simplify to string.
    +  # @return [FormPart, String]
    +  def simplify
    +    file? ? self : self.data
    +  end
    +end
    +
    +
    + + + +
    +

    + + #nameObject (readonly) + + + + + +

    +
    +

    name of the form part

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    +24
    +25
    +26
    +27
    +28
    +29
    +30
    +
    +
    # File 'lib/hyde/util/multipart.rb', line 17
    +
    +FormPart = Struct.new(:data, :name, :filename,
    +                      :filetype, :tempfile, :headers) do
    +  # Is this form part a file or plain data?
    +  # @return [Boolean]
    +  def file?
    +    !tempfile.nil?
    +  end
    +
    +  # If FormPart is not a file, simplify to string.
    +  # @return [FormPart, String]
    +  def simplify
    +    file? ? self : self.data
    +  end
    +end
    +
    +
    + +
    + + +
    +

    Instance Method Details

    + + +
    +

    + + #file?Boolean + + + + + +

    +
    +

    Is this form part a file or plain data?

    + + +
    +
    +
    + +

    Returns:

    +
      + +
    • + + + (Boolean) + + + +
    • + +
    + +
    + + + + +
    +
    +
    +
    +21
    +22
    +23
    +
    +
    # File 'lib/hyde/util/multipart.rb', line 21
    +
    +def file?
    +  !tempfile.nil?
    +end
    +
    +
    + +
    +

    + + #headers=(value) ⇒ Object + + + + + +

    +
    +

    headers recevied from form data

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    +24
    +25
    +26
    +27
    +28
    +29
    +30
    +
    +
    # File 'lib/hyde/util/multipart.rb', line 17
    +
    +FormPart = Struct.new(:data, :name, :filename,
    +                      :filetype, :tempfile, :headers) do
    +  # Is this form part a file or plain data?
    +  # @return [Boolean]
    +  def file?
    +    !tempfile.nil?
    +  end
    +
    +  # If FormPart is not a file, simplify to string.
    +  # @return [FormPart, String]
    +  def simplify
    +    file? ? self : self.data
    +  end
    +end
    +
    +
    + +
    +

    + + #simplifyFormPart, String + + + + + +

    +
    +

    If FormPart is not a file, simplify to string.

    + + +
    +
    +
    + +

    Returns:

    +
      + +
    • + + + (FormPart, String) + + + +
    • + +
    + +
    + + + + +
    +
    +
    +
    +27
    +28
    +29
    +
    +
    # File 'lib/hyde/util/multipart.rb', line 27
    +
    +def simplify
    +  file? ? self : self.data
    +end
    +
    +
    + +
    +

    + + #tempfile=(value) ⇒ Object + + + + + +

    +
    +

    Temporary file for storing sent file data.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    +24
    +25
    +26
    +27
    +28
    +29
    +30
    +
    +
    # File 'lib/hyde/util/multipart.rb', line 17
    +
    +FormPart = Struct.new(:data, :name, :filename,
    +                      :filetype, :tempfile, :headers) do
    +  # Is this form part a file or plain data?
    +  # @return [Boolean]
    +  def file?
    +    !tempfile.nil?
    +  end
    +
    +  # If FormPart is not a file, simplify to string.
    +  # @return [FormPart, String]
    +  def simplify
    +    file? ? self : self.data
    +  end
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/doc/Hyde/Util/Lookup.html b/doc/Hyde/Util/Lookup.html index 6af3b6f..a1fb651 100644 --- a/doc/Hyde/Util/Lookup.html +++ b/doc/Hyde/Util/Lookup.html @@ -101,8 +101,7 @@

    Overview

    - -

    Value container with recursive lookup

    +

    Value container with recursive lookup

    @@ -137,8 +136,7 @@ -
    -

    Returns the value of attribute parent.

    +

    Returns the value of attribute parent.

    @@ -174,8 +172,7 @@ -
    -

    Initialize a Lookup from Hash.

    +

    Initialize a Lookup from Hash.

    @@ -207,8 +204,7 @@ -
    -

    Get a value by key.

    +

    Get a value by key.

    @@ -231,8 +227,7 @@ -
    -

    Set a value by key.

    +

    Set a value by key.

    @@ -257,8 +252,7 @@ -
    -

    A new instance of Lookup.

    +

    A new instance of Lookup.

    @@ -281,8 +275,7 @@
    - -

    Returns a new instance of Lookup.

    +

    Returns a new instance of Lookup.

    @@ -348,8 +341,7 @@
    - -

    Returns the value of attribute parent.

    +

    Returns the value of attribute parent.

    @@ -396,8 +388,7 @@
    - -

    Initialize a Lookup from Hash

    +

    Initialize a Lookup from Hash

    @@ -458,8 +449,7 @@
    - -

    Get a value by key

    +

    Get a value by key

    @@ -478,8 +468,7 @@ — -
    -

    key for value

    +

    key for value

    @@ -532,8 +521,7 @@
    - -

    Set a value by key

    +

    Set a value by key

    @@ -552,8 +540,7 @@ — -
    -

    key for value

    +

    key for value

    @@ -568,8 +555,7 @@ — -
    -

    value value

    +

    value value

    @@ -603,7 +589,7 @@
    diff --git a/doc/Hyde/Util/MultipartParser.html b/doc/Hyde/Util/MultipartParser.html new file mode 100644 index 0000000..86ef9d3 --- /dev/null +++ b/doc/Hyde/Util/MultipartParser.html @@ -0,0 +1,487 @@ + + + + + + + Class: Hyde::Util::MultipartParser + + — Documentation by YARD 0.9.34 + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Hyde::Util::MultipartParser + + + +

    +
    + +
    +
    Inherits:
    +
    + Object + +
      +
    • Object
    • + + + +
    + show all + +
    +
    + + + + + + +
    +
    Includes:
    +
    ParserCommon
    +
    + + + + + + +
    +
    Defined in:
    +
    lib/hyde/util/multipart.rb
    +
    + +
    + +

    Overview

    +
    +

    A very naive implementation of a Multipart form parser.

    + + +
    +
    +
    + + +
    + + + + + + + +

    + Instance Method Summary + collapse +

    + + + + + + + + + + +
    +

    Constructor Details

    + +
    +

    + + #initialize(io, boundary) ⇒ MultipartParser + + + + + +

    +
    +

    Returns a new instance of MultipartParser.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +35
    +36
    +37
    +38
    +39
    +40
    +
    +
    # File 'lib/hyde/util/multipart.rb', line 35
    +
    +def initialize(io, boundary)
    +  @input = io.is_a?(String) ? StringIO.new(io) : io
    +  @boundary = boundary
    +  @state = :idle
    +  @data = []
    +end
    +
    +
    + +
    + + +
    +

    Instance Method Details

    + + +
    +

    + + #parseArray<FormPart, FormFile> + + + + + +

    +
    +

    Parse multipart formdata

    + + +
    +
    +
    + +

    Returns:

    +
      + +
    • + + + (Array<FormPart, FormFile>) + + + +
    • + +
    + +
    + + + + +
    +
    +
    +
    +48
    +49
    +50
    +51
    +52
    +53
    +54
    +55
    +56
    +57
    +58
    +59
    +60
    +61
    +62
    +63
    +64
    +65
    +66
    +67
    +68
    +69
    +70
    +71
    +72
    +73
    +74
    +75
    +76
    +77
    +78
    +79
    +80
    +81
    +82
    +83
    +84
    +85
    +86
    +87
    +88
    +89
    +90
    +91
    +92
    +93
    +94
    +95
    +96
    +97
    +98
    +99
    +100
    +
    +
    # File 'lib/hyde/util/multipart.rb', line 48
    +
    +def parse
    +  return @data unless @data.empty?
    +
    +  while (line = @input.gets)
    +    case @state
    +    when :idle # waiting for valid boundary
    +      if line == "--#{@boundary}\r\n"
    +        # transition to :headers on valid boundary
    +        @state = :headers
    +        @data.append(FormPart.new(*([nil] * 5), {}))
    +      end
    +    when :headers # after valid boundary - checking for headers
    +      if line == "\r\n"
    +        # prepare form field and transition to :data or :file
    +        @state = file?(@data[-1].headers) ? :file : :data
    +        if @state == :data
    +          setup_data_meta(@data[-1])
    +        else
    +          setup_file_meta(@data[-1])
    +        end
    +        next
    +      end
    +      push_header(line, @data[-1].headers)
    +    when :data, :file # after headers - processing form data
    +      if @data[-1].headers.empty?
    +        # transition to :idle on empty headers
    +        @state = :idle
    +        next
    +      end
    +      if ["--#{@boundary}\r\n", "--#{@boundary}--\r\n"].include? line
    +        # finalize and transition to either :headers or :idle
    +        if @state == :file
    +          @data[-1].tempfile.truncate(@data[-1].tempfile.size - 2)
    +          @data[-1].tempfile.close
    +        else
    +          @data[-1].data.delete_suffix! "\r\n"
    +        end
    +        @state = line == "--#{@boundary}\r\n" ? :headers : :idle
    +        @data.append(FormPart.new(*([nil] * 5), {}))
    +        next
    +      end
    +      if @state == :data
    +        @data[-1].data ||= ""
    +        @data[-1].data << line
    +      else
    +        @data[-1].tempfile << line
    +      end
    +    end
    +  end
    +  @state = :idle
    +  @data.pop
    +  @data.freeze
    +end
    +
    +
    + +
    +

    + + #to_hHash + + + + + +

    +
    +

    Return a hash of current form. +(equivalent to Query.parse but for multipart/form-data)

    + + +
    +
    +
    + +

    Returns:

    +
      + +
    • + + + (Hash) + + + +
    • + +
    + +
    + + + + +
    +
    +
    +
    +106
    +107
    +108
    +
    +
    # File 'lib/hyde/util/multipart.rb', line 106
    +
    +def to_h
    +  flatten(sort(gen_hash(parse)))
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/doc/Hyde/Util/ParserCommon.html b/doc/Hyde/Util/ParserCommon.html new file mode 100644 index 0000000..aecc37c --- /dev/null +++ b/doc/Hyde/Util/ParserCommon.html @@ -0,0 +1,120 @@ + + + + + + + Module: Hyde::Util::ParserCommon + + — Documentation by YARD 0.9.34 + + + + + + + + + + + + + + + + + + + +
    + + +

    Module: Hyde::Util::ParserCommon + + + +

    +
    + + + + + + + + + +
    +
    Included in:
    +
    MultipartParser, Query
    +
    + + + +
    +
    Defined in:
    +
    lib/hyde/util/sorting.rb
    +
    + +
    + +

    Overview

    +
    +

    Internal library for generating form hashes

    + + +
    +
    +
    + + +
    + + + + + + + + +
    + + + +
    + + \ No newline at end of file diff --git a/doc/Hyde/Util/Query.html b/doc/Hyde/Util/Query.html index 120361b..e43d504 100644 --- a/doc/Hyde/Util/Query.html +++ b/doc/Hyde/Util/Query.html @@ -87,6 +87,11 @@ +
    +
    Includes:
    +
    ParserCommon
    +
    + @@ -101,8 +106,8 @@

    Overview

    - -

    Query string parser

    +

    TODO: encoding support???? +Query string parser

    @@ -128,6 +133,29 @@
  • + #[](key) ⇒ String, Array + + + + + + + + + + + + + +

    Get key from query.

    +
    + +
  • + + +
  • + + #initialize(query) ⇒ Query @@ -144,8 +172,7 @@ -
    -

    A new instance of Query.

    +

    A new instance of Query.

  • @@ -168,8 +195,7 @@ -
    -

    Better(tm) query parser with Returns a hash with arrays Key semantics:.

    +

    Better(tm) query parser.

    @@ -192,8 +218,7 @@ -
    -

    Shallow query parser (does not do PHP-like array keys).

    +

    Shallow query parser (does not do PHP-like array keys).

    @@ -202,7 +227,13 @@ -
    + + + + + + +

    Constructor Details

    @@ -216,8 +247,7 @@
    - -

    Returns a new instance of Query.

    +

    Returns a new instance of Query.

    @@ -246,12 +276,12 @@
     
     
    -10
    -11
    -12
    +13 +14 +15 -
    # File 'lib/hyde/util/query.rb', line 10
    +      
    # File 'lib/hyde/util/query.rb', line 13
     
     def initialize(query)
       @query = query
    @@ -269,7 +299,75 @@
     
         
           
    -

    +

    + + #[](key) ⇒ String, Array + + + + + +

    +
    +

    Get key from query.

    + + +
    +
    +
    +

    Parameters:

    +
      + +
    • + + key + + + (String) + + + +
    • + +
    + +

    Returns:

    +
      + +
    • + + + (String, Array) + + + +
    • + +
    + +
    + + + + +
    +
    +
    +
    +40
    +41
    +42
    +
    +
    # File 'lib/hyde/util/query.rb', line 40
    +
    +def [](key)
    +  (@cache ||= parse)[key]
    +end
    +
    +
    + +
    +

    #parseHash @@ -279,15 +377,15 @@

    - -

    Better(tm) query parser with Returns a hash with arrays Key semantics:

    -
    • -

      ‘key=value` creates a key value pair

      -
    • -

      ‘key[]=value` appends `value` to an array named `key`

      -
    • -

      key=value` sets `value` at `index` of array named `key`

      -
    +

    Better(tm) query parser. +Returns a hash with arrays. +Key semantics:

    + +
      +
    • key=value creates a key value pair
    • +
    • key[]=value appends value to an array named key
    • +
    • key[index]=value sets value at index of array named key
    • +
    @@ -314,15 +412,15 @@
     
     
    -30
    -31
    -32
    +33 +34 +35
    -
    # File 'lib/hyde/util/query.rb', line 30
    +      
    # File 'lib/hyde/util/query.rb', line 33
     
     def parse
    -  construct_deep_hash(URI.decode_www_form(@query, Encoding::UTF_8))
    +  construct_deep_hash(URI.decode_www_form(@query))
     end
    @@ -340,8 +438,7 @@
    - -

    Shallow query parser (does not do PHP-like array keys)

    +

    Shallow query parser (does not do PHP-like array keys)

    @@ -368,17 +465,17 @@
     
     
    -16
    -17
    -18
     19
    -20
    +20 +21 +22 +23
    -
    # File 'lib/hyde/util/query.rb', line 16
    +      
    # File 'lib/hyde/util/query.rb', line 19
     
     def parse_shallow
    -  URI.decode_www_form(@query, Encoding::UTF_8)
    +  URI.decode_www_form(@query)
          .sort_by { |array| array[0] }
          .to_h
     end
    @@ -392,7 +489,7 @@
    diff --git a/doc/_index.html b/doc/_index.html index fe474d2..0d849c2 100644 --- a/doc/_index.html +++ b/doc/_index.html @@ -81,9 +81,16 @@
    diff --git a/doc/class_list.html b/doc/class_list.html index 5f73cb9..142398b 100644 --- a/doc/class_list.html +++ b/doc/class_list.html @@ -43,7 +43,7 @@
    diff --git a/doc/file.README.html b/doc/file.README.html index 0af2f42..9acf03c 100644 --- a/doc/file.README.html +++ b/doc/file.README.html @@ -151,11 +151,11 @@ path "important" do preprocess do |req| # Implement logging logic here - puts "Client at #{req.headers['REMOTE_ADDR']} wanted to access something /important!" + puts "Client at #{req.headers['remote-addr']} wanted to access something /important!" end get "answer" do header "content-type", "application/json" - '{"answer":42, "desc":"something important!"}' + '\\{"answer":42, "desc":"something important!"\\}' end end end @@ -190,7 +190,7 @@
    diff --git a/doc/index.html b/doc/index.html index 9ae2507..00183c3 100644 --- a/doc/index.html +++ b/doc/index.html @@ -151,11 +151,11 @@ path "important" do preprocess do |req| # Implement logging logic here - puts "Client at #{req.headers['REMOTE_ADDR']} wanted to access something /important!" +
    puts "Client at #{req.headers['remote-addr']} wanted to access something /important!" end get "answer" do header "content-type", "application/json" - '{"answer":42, "desc":"something important!"}' + '\\{"answer":42, "desc":"something important!"\\}' end end end @@ -190,7 +190,7 @@
    diff --git a/doc/method_list.html b/doc/method_list.html index 43b0bf2..477c905 100644 --- a/doc/method_list.html +++ b/doc/method_list.html @@ -46,15 +46,15 @@
  • - [] - Hyde::Util::Lookup + #[] + Hyde::Util::Query
  • - #[] + [] Hyde::Util::Lookup
  • @@ -62,13 +62,21 @@
  • - #[]= + #[] Hyde::Util::Lookup
  • +
    + #[]= + Hyde::Util::Lookup +
    +
  • + + +
  • #add_header Hyde::Response @@ -76,6 +84,14 @@
  • +
  • +
    + #binding + Hyde::Template +
    +
  • + +
  • #body @@ -94,8 +110,8 @@
  • - #bounce - Hyde::DSL::ProbeMethods + #bounce + Hyde::DSL::CommonMethods
  • @@ -173,6 +189,14 @@
  • +
    + #data + Hyde::Util::FormPart +
    +
  • + + +
  • default_error_page Hyde::Util @@ -180,7 +204,7 @@
  • -
  • +
  • #delete Hyde::DSL::PathConstructors @@ -188,7 +212,7 @@
  • -
  • +
  • #delete_header Hyde::Response @@ -196,10 +220,18 @@
  • +
  • +
    + #die + Hyde::DSL::CommonMethods +
    +
  • + +
  • - #die - Hyde::DSL::ProbeMethods + #erb + Hyde::DSL::ProbeConstructors
  • @@ -213,6 +245,30 @@
  • +
    + #file + Hyde::DSL::ProbeMethods +
    +
  • + + +
  • +
    + #file? + Hyde::Util::FormPart +
    +
  • + + +
  • +
    + #filename + Hyde::Util::FormPart +
    +
  • + + +
  • #filepath Hyde::Request @@ -220,6 +276,14 @@
  • +
  • +
    + #filetype + Hyde::Util::FormPart +
    +
  • + +
  • #filter @@ -244,6 +308,22 @@
  • +
  • +
    + #form + Hyde::DSL::ProbeMethods +
    +
  • + + +
  • +
    + #form? + Hyde::DSL::ProbeMethods +
    +
  • + +
  • #get @@ -293,6 +373,14 @@
  • +
    + #headers= + Hyde::Util::FormPart +
    +
  • + + +
  • #index Hyde::DSL::PathMethods @@ -300,7 +388,7 @@
  • -
  • +
  • #initialize Hyde::Node @@ -308,10 +396,18 @@
  • +
  • +
    + #initialize + Hyde::ProcessorContext +
    +
  • + +
  • - #initialize - Hyde::PathBinding + #initialize + Hyde::PathContext
  • @@ -325,6 +421,14 @@
  • +
    + #initialize + Hyde::ProbeContext +
    +
  • + + +
  • #initialize Hyde::Probe @@ -332,7 +436,7 @@
  • -
  • +
  • #initialize Hyde::Server @@ -340,7 +444,7 @@
  • -
  • +
  • #initialize Hyde::Request @@ -348,7 +452,7 @@
  • -
  • +
  • #initialize Hyde::Response @@ -356,7 +460,23 @@
  • +
  • +
    + #initialize + Hyde::TemplateContext +
    +
  • + +
  • +
    + #initialize + Hyde::Template +
    +
  • + + +
  • #initialize Hyde::Util::Query @@ -364,7 +484,7 @@
  • -
  • +
  • #initialize Hyde::Util::Lookup @@ -372,18 +492,26 @@
  • +
  • +
    + #initialize + Hyde::Templates::ERB +
    +
  • + +
  • - #initialize - Hyde::ProbeBinding + #initialize + Hyde::Handlers::Handler
  • - #initialize - Hyde::Handler + #initialize + Hyde::Util::MultipartParser
  • @@ -398,8 +526,8 @@
  • - #initialize - Hyde::ServeHandler + #initialize + Hyde::Handlers::Serve
  • @@ -421,6 +549,46 @@
  • +
    + #input + Hyde::Request +
    +
  • + + +
  • +
    + #local_variable_get + Hyde::Template +
    +
  • + + +
  • +
    + #local_variable_set + Hyde::Template +
    +
  • + + +
  • +
    + #local_variables + Hyde::Template +
    +
  • + + +
  • +
    + make_value + Hyde::Util +
    +
  • + + +
  • #match Hyde::Pattern @@ -428,7 +596,7 @@
  • -
  • +
  • #match Hyde::PatternMatching::Glob @@ -436,7 +604,7 @@
  • -
  • +
  • #match Hyde::PatternMatching::ReMatch @@ -444,7 +612,7 @@
  • -
  • +
  • #match? Hyde::Pattern @@ -452,7 +620,7 @@
  • -
  • +
  • #match? Hyde::PatternMatching::Glob @@ -460,7 +628,7 @@
  • -
  • +
  • #match? Hyde::PatternMatching::ReMatch @@ -468,6 +636,14 @@
  • +
  • +
    + #name + Hyde::Util::FormPart +
    +
  • + +
  • #options @@ -477,6 +653,14 @@
  • +
    + #override_locals + Hyde::Template +
    +
  • + + +
  • #param Hyde::Request @@ -484,7 +668,7 @@
  • -
  • +
  • #parent Hyde::Util::Lookup @@ -492,7 +676,7 @@
  • -
  • +
  • #parse Hyde::Util::Query @@ -500,6 +684,14 @@
  • +
  • +
    + #parse + Hyde::Util::MultipartParser +
    +
  • + +
  • #parse_shallow @@ -509,6 +701,14 @@
  • +
    + parse_value + Hyde::Util +
    +
  • + + +
  • #patch Hyde::DSL::PathConstructors @@ -516,7 +716,7 @@
  • -
  • +
  • #path Hyde::Request @@ -524,7 +724,7 @@
  • -
  • +
  • #path Hyde::DSL::PathConstructors @@ -532,7 +732,7 @@
  • -
  • +
  • #path_info Hyde::Request @@ -540,7 +740,7 @@
  • -
  • +
  • #pop_state Hyde::Request @@ -548,7 +748,7 @@
  • -
  • +
  • #post Hyde::DSL::PathConstructors @@ -556,7 +756,7 @@
  • -
  • +
  • #postprocess Hyde::Path @@ -564,7 +764,7 @@
  • -
  • +
  • #postprocess Hyde::DSL::PathMethods @@ -572,7 +772,7 @@
  • -
  • +
  • #postprocessors Hyde::Request @@ -580,7 +780,7 @@
  • -
  • +
  • #preprocess Hyde::Path @@ -588,7 +788,7 @@
  • -
  • +
  • #preprocess Hyde::DSL::PathMethods @@ -596,7 +796,7 @@
  • -
  • +
  • #probe Hyde::DSL::PathConstructors @@ -604,7 +804,7 @@
  • -
  • +
  • #process Hyde::Node @@ -612,7 +812,7 @@
  • -
  • +
  • #process Hyde::Path @@ -620,7 +820,7 @@
  • -
  • +
  • #process Hyde::Probe @@ -628,31 +828,31 @@
  • -
  • -
    - #process - Hyde::Handler -
    -
  • - -
  • - #process - Hyde::GETHandler + #process + Hyde::Handlers::Handler
  • - #process - Hyde::ServeHandler + #process + Hyde::Handlers::GET
  • +
    + #process + Hyde::Handlers::Serve +
    +
  • + + +
  • #properties Hyde::Path @@ -660,7 +860,7 @@
  • -
  • +
  • #properties Hyde::Probe @@ -668,7 +868,7 @@
  • -
  • +
  • #push_state Hyde::Request @@ -676,7 +876,7 @@
  • -
  • +
  • #put Hyde::DSL::PathConstructors @@ -684,7 +884,7 @@
  • -
  • +
  • #query Hyde::Request @@ -692,7 +892,7 @@
  • -
  • +
  • #register Hyde::DSL::PathConstructors @@ -700,7 +900,7 @@
  • -
  • +
  • #reject Hyde::Node @@ -708,7 +908,7 @@
  • -
  • +
  • #remap Hyde::Node @@ -716,7 +916,7 @@
  • -
  • +
  • #remap Hyde::DSL::PathMethods @@ -724,7 +924,7 @@
  • -
  • +
  • #remove_header Hyde::DSL::ProbeMethods @@ -732,15 +932,15 @@
  • -
  • +
  • - #request - Hyde::Handler + #request + Hyde::Handlers::Handler
  • -
  • +
  • #request Hyde::DSL::ProbeMethods @@ -748,7 +948,7 @@
  • -
  • +
  • #request_method Hyde::Request @@ -756,23 +956,23 @@
  • +
  • +
    + #response + Hyde::Handlers::Handler +
    +
  • + +
  • - #response - Hyde::Handler + #response + Hyde::Handlers::Serve
  • -
    - #response - Hyde::ServeHandler -
    -
  • - - -
  • #root Hyde::Node @@ -780,7 +980,7 @@
  • -
  • +
  • #root Hyde::DSL::PathMethods @@ -788,7 +988,23 @@
  • +
  • +
    + #run + Hyde::Template +
    +
  • + +
  • +
    + #run + Hyde::Templates::ERB +
    +
  • + + +
  • #run_postprocessors Hyde::Request @@ -796,7 +1012,7 @@
  • -
  • +
  • #script_name Hyde::Request @@ -804,7 +1020,7 @@
  • -
  • +
  • #serve Hyde::DSL::PathConstructors @@ -812,7 +1028,7 @@
  • -
  • +
  • #server_name Hyde::Request @@ -820,7 +1036,7 @@
  • -
  • +
  • #server_port Hyde::Request @@ -828,7 +1044,7 @@
  • -
  • +
  • #server_protocol Hyde::Request @@ -836,6 +1052,14 @@
  • +
  • +
    + #simplify + Hyde::Util::FormPart +
    +
  • + +
  • #splat @@ -868,6 +1092,22 @@
  • +
  • +
    + #tempfile= + Hyde::Util::FormPart +
    +
  • + + +
  • +
    + #to_h + Hyde::Util::MultipartParser +
    +
  • + +
  • #trace @@ -877,6 +1117,14 @@
  • +
    + unescape_html + Hyde::Util +
    +
  • + + +
  • #validate Hyde::Response diff --git a/doc/top-level-namespace.html b/doc/top-level-namespace.html index 6ebc842..bae6e7d 100644 --- a/doc/top-level-namespace.html +++ b/doc/top-level-namespace.html @@ -100,7 +100,7 @@
    diff --git a/examples/extension_testing/extension.ru b/examples/extension_testing/extension.ru new file mode 100644 index 0000000..d1fe5b8 --- /dev/null +++ b/examples/extension_testing/extension.ru @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/lib") +require 'hyde' +require_relative 'external_methods' + +app = Hyde::Server.new do + get "/hello" do + header "content-type", "text/plain" + do_hello() + end +end + +run app diff --git a/examples/extension_testing/external_methods.rb b/examples/extension_testing/external_methods.rb new file mode 100644 index 0000000..93109f7 --- /dev/null +++ b/examples/extension_testing/external_methods.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Hyde + module DSL + # Methods shared by probes, preprocessors and filters. + module CommonMethods + def do_hello() + "Hello world!" + end + end + end +end diff --git a/examples/extension_testing/lib b/examples/extension_testing/lib new file mode 120000 index 0000000..58677dd --- /dev/null +++ b/examples/extension_testing/lib @@ -0,0 +1 @@ +../../lib \ No newline at end of file diff --git a/examples/extension_testing/readme.txt b/examples/extension_testing/readme.txt new file mode 100644 index 0000000..ed8bfad --- /dev/null +++ b/examples/extension_testing/readme.txt @@ -0,0 +1 @@ +Example of extending base Hyde functionality with additional DSL methods. diff --git a/examples/form/readme.txt b/examples/form/readme.txt new file mode 100644 index 0000000..c5e32c6 --- /dev/null +++ b/examples/form/readme.txt @@ -0,0 +1 @@ +Example of handling forms in Hyde diff --git a/examples/templates/footer.rhtml b/examples/templates/footer.rhtml new file mode 100644 index 0000000..24f1eef --- /dev/null +++ b/examples/templates/footer.rhtml @@ -0,0 +1,4 @@ +
    +
    +

    Footer template part

    +
    diff --git a/examples/templates/helloworld.ru b/examples/templates/helloworld.ru new file mode 100644 index 0000000..362ef28 --- /dev/null +++ b/examples/templates/helloworld.ru @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/lib") +require 'hyde' + +app = Hyde::Server.new do + remap ENV["PWD"] + get "/" do + header "content-type", "text/html" + localrand = rand + bind = binding + erb(file("index.rhtml"), toplevel: bind).run + end +end + +run app diff --git a/examples/templates/index.rhtml b/examples/templates/index.rhtml new file mode 100644 index 0000000..ab1d1f9 --- /dev/null +++ b/examples/templates/index.rhtml @@ -0,0 +1,14 @@ + + + + Ruby template engine test + + +

    + Welcome to another ugly looking test page +

    +
    +

    This page exists only to test template engine functionality

    +

    Random value = <%= localrand %>

    + + diff --git a/examples/templates/lib b/examples/templates/lib new file mode 120000 index 0000000..58677dd --- /dev/null +++ b/examples/templates/lib @@ -0,0 +1 @@ +../../lib \ No newline at end of file diff --git a/examples/templates/readme.txt b/examples/templates/readme.txt new file mode 100644 index 0000000..8816f3c --- /dev/null +++ b/examples/templates/readme.txt @@ -0,0 +1 @@ +This example demonstrates usage of template engines. diff --git a/lib/hyde.rb b/lib/hyde.rb index f824d7f..a62dd4a 100644 --- a/lib/hyde.rb +++ b/lib/hyde.rb @@ -5,11 +5,11 @@ require_relative 'hyde/path' require_relative 'hyde/probe' require_relative 'hyde/request' require_relative 'hyde/response' +require_relative 'hyde/template' # Hyde is a hideously simple ruby web framework module Hyde # Hyde version - # @type [String] VERSION = '0.8 (beta/rewrite)' # Hyde branding and version diff --git a/lib/hyde/dsl/constructors_path.rb b/lib/hyde/dsl/constructors_path.rb new file mode 100644 index 0000000..ac919b1 --- /dev/null +++ b/lib/hyde/dsl/constructors_path.rb @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +module Hyde + # Shared DSL methods + module DSL + # Path (and subclasses) DSL constructors + module PathConstructors + # Append a Node child object to the list of children + def register(obj) + unless obj.is_a? Hyde::Node + raise StandardError, "register accepts node children only" + end + + @origin.children.append(obj) + end + + # Create a new {Hyde::Path} object + def path(path, &setup) + register(Hyde::Path.new(path, parent: @origin, &setup)) + end + + # Create a new {Hyde::Handlers::Probe} object + def probe(path, &_setup) + register(Hyde::Handlers::Probe.new(path, parent: @origin)) + end + + # Create a new {Hyde::Handlers::GETHandler} object + def get(path, &setup) + register(Hyde::Handlers::GET.new(path, parent: @origin, &setup)) + end + + # create a new {Hyde::Handlers::POSTHandler} object + def post(path, &setup) + register(Hyde::Handlers::POST.new(path, parent: @origin, &setup)) + end + + # Create a new {Hyde::Handlers::PUTHandler} object + def put(path, &setup) + register(Hyde::Handlers::PUT.new(path, parent: @origin, &setup)) + end + + # Create a new {Hyde::Handlers::HEADHandler} object + def head(path, &setup) + register(Hyde::Handlers::HEAD.new(path, parent: @origin, &setup)) + end + + # Create a new {Hyde::Handlers::DELETEHandler} object + def delete(path, &setup) + register(Hyde::Handlers::DELETE.new(path, parent: @origin, &setup)) + end + + # Create a new {Hyde::Handlers::CONNECTHandler} object + def connect(path, &setup) + register(Hyde::Handlers::CONNECT.new(path, parent: @origin, &setup)) + end + + # Create a new {Hyde::Handlers::TRACEHandler} object + def trace(path, &setup) + register(Hyde::Handlers::TRACE.new(path, parent: @origin, &setup)) + end + + # Create a new {Hyde::Handlers::PATCHHandler} object + def patch(path, &setup) + register(Hyde::Handlers::PATCH.new(path, parent: @origin, &setup)) + end + + # Create a new {Hyde::Handlers::OPTIONSHandler} object + def options(path, &setup) + register(Hyde::Handlers::OPTIONS.new(path, parent: @origin, &setup)) + end + + # Create a new {Hyde::Handlers::GETHandler} that serves static files + def serve(path) + register(Hyde::Handlers::Serve.new(path, parent: @origin)) + end + end + end +end diff --git a/lib/hyde/dsl/constructors_probe.rb b/lib/hyde/dsl/constructors_probe.rb new file mode 100644 index 0000000..2c38817 --- /dev/null +++ b/lib/hyde/dsl/constructors_probe.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Hyde + module DSL + # Probe (and subclasses) DSL construct + module ProbeConstructors + # Create a new erb template + # @see Hyde::Template#new + def erb(input, toplevel: nil, locals: nil) + Hyde::Templates::ERB.new(input, toplevel: toplevel, locals: locals) + end + end + end +end diff --git a/lib/hyde/dsl/common_methods.rb b/lib/hyde/dsl/methods_common.rb similarity index 100% rename from lib/hyde/dsl/common_methods.rb rename to lib/hyde/dsl/methods_common.rb diff --git a/lib/hyde/dsl/path_methods.rb b/lib/hyde/dsl/methods_path.rb similarity index 100% rename from lib/hyde/dsl/path_methods.rb rename to lib/hyde/dsl/methods_path.rb diff --git a/lib/hyde/dsl/probe_methods.rb b/lib/hyde/dsl/methods_probe.rb similarity index 92% rename from lib/hyde/dsl/probe_methods.rb rename to lib/hyde/dsl/methods_probe.rb index 30d076d..2dadfe7 100644 --- a/lib/hyde/dsl/probe_methods.rb +++ b/lib/hyde/dsl/methods_probe.rb @@ -82,6 +82,12 @@ module Hyde request.input, opts["boundary"] ).to_h end + + # Open a file relative to current filepath + # @see File#open + def file(path, mode = "r", *all, &block) + File.open("#{request.filepath}/#{path}", mode, *all, &block) + end end end end diff --git a/lib/hyde/dsl/methods_template.rb b/lib/hyde/dsl/methods_template.rb new file mode 100644 index 0000000..0dafa1b --- /dev/null +++ b/lib/hyde/dsl/methods_template.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +module Hyde + module DSL + module TemplateMethods + + end + end +end diff --git a/lib/hyde/dsl/path_constructors.rb b/lib/hyde/dsl/path_constructors.rb deleted file mode 100644 index 3a3a374..0000000 --- a/lib/hyde/dsl/path_constructors.rb +++ /dev/null @@ -1,80 +0,0 @@ -# frozen_string_literal: true - -module Hyde - # Shared DSL methods - module DSL - # Path (and subclasses) DSL constructors - module PathConstructors - # Append a Node child object to the list of children - def register(obj) - unless obj.is_a? Hyde::Node - raise StandardError, "register accepts node children only" - end - - @origin.children.append(obj) - end - - # Create a new {Hyde::Path} object - def path(path, &setup) - # i don't know WHAT is wrong with this thing. it just is wrong. - # @sg-ignore - register(Hyde::Path.new(path, parent: @origin, &setup)) - end - - # Create a new {Hyde::Probe} object - def probe(path, &_setup) - register(Hyde::Probe.new(path, parent: @origin)) - end - - # Create a new {Hyde::GETHandler} object - def get(path, &setup) - register(Hyde::GETHandler.new(path, parent: @origin, &setup)) - end - - # create a new {Hyde::POSTHandler} object - def post(path, &setup) - register(Hyde::POSTHandler.new(path, parent: @origin, &setup)) - end - - # Create a new {Hyde::PUTHandler} object - def put(path, &setup) - register(Hyde::PUTHandler.new(path, parent: @origin, &setup)) - end - - # Create a new {Hyde::HEADHandler} object - def head(path, &setup) - register(Hyde::HEADHandler.new(path, parent: @origin, &setup)) - end - - # Create a new {Hyde::DELETEHandler} object - def delete(path, &setup) - register(Hyde::DELETEHandler.new(path, parent: @origin, &setup)) - end - - # Create a new {Hyde::CONNECTHandler} object - def connect(path, &setup) - register(Hyde::CONNECTHandler.new(path, parent: @origin, &setup)) - end - - # Create a new {Hyde::TRACEHandler} object - def trace(path, &setup) - register(Hyde::TRACEHandler.new(path, parent: @origin, &setup)) - end - - # Create a new {Hyde::PATCHHandler} object - def patch(path, &setup) - register(Hyde::PATCHHandler.new(path, parent: @origin, &setup)) - end - - # Create a new {Hyde::OPTIONSHandler} object - def options(path, &setup) - register(Hyde::OPTIONSHandler.new(path, parent: @origin, &setup)) - end - - # Create a new {Hyde::GETHandler} that serves static files - def serve(path) - register(Hyde::ServeHandler.new(path, parent: @origin)) - end - end - end -end diff --git a/lib/hyde/path.rb b/lib/hyde/path.rb index 3660b09..4557ef4 100644 --- a/lib/hyde/path.rb +++ b/lib/hyde/path.rb @@ -2,14 +2,14 @@ require_relative 'pattern_matching' require_relative 'node' -require_relative 'dsl/path_constructors' -require_relative 'dsl/path_methods' -require_relative 'dsl/common_methods' +require_relative 'dsl/constructors_path' +require_relative 'dsl/methods_path' +require_relative 'dsl/methods_common' require_relative 'util/lookup' module Hyde - # Binding that provides execution context for filters and preprocessors. - class ProcessorBinding + # Execution context for filters and preprocessors. + class ProcessorContext include Hyde::DSL::CommonMethods def initialize(path) @@ -17,8 +17,8 @@ module Hyde end end - # Binding that provides execution context for path setup block. - class PathBinding + # Execution context for path setup block. + class PathContext include Hyde::DSL::PathConstructors include Hyde::DSL::PathMethods @@ -29,8 +29,8 @@ module Hyde # Primary building block of request navigation. class Path < Hyde::Node - ProcBinding = Hyde::ProcessorBinding - Binding = Hyde::PathBinding + ProcContext = Hyde::ProcessorContext + Context = Hyde::PathContext # @param path [Object] Object to generate {Hyde::Pattern} from # @param parent [Hyde::Node] Parent object to inherit properties to @@ -43,10 +43,10 @@ module Hyde @preprocessors = [] @postprocessors = [] @filters = [] - # Bindings setup - binding = self.class::Binding.new(self) - binding.instance_exec(&setup) - @procbinding = self.class::ProcBinding.new(self) + # Contexts setup + context = self.class::Context.new(self) + context.instance_exec(&setup) + @proccontext = self.class::ProcContext.new(self) end # Method callback on successful request navigation. @@ -104,7 +104,7 @@ module Hyde # @return [Boolean] true if request passed all filters def run_filters(request) @filters.each do |filter| - return false unless @procbinding.instance_exec(request, &filter) + return false unless @proccontext.instance_exec(request, &filter) end true end @@ -113,7 +113,7 @@ module Hyde # @param request [Hyde::Request] def run_preprocessors(request) @preprocessors.each do |preproc| - @procbinding.instance_exec(request, &preproc) + @proccontext.instance_exec(request, &preproc) end end diff --git a/lib/hyde/probe.rb b/lib/hyde/probe.rb index ec13920..2a851ad 100644 --- a/lib/hyde/probe.rb +++ b/lib/hyde/probe.rb @@ -2,23 +2,30 @@ require_relative 'node' require_relative 'util/lookup' +require_relative 'dsl/methods_probe' +require_relative 'dsl/methods_common' +require_relative 'dsl/constructors_probe' require 'pp' module Hyde - autoload :Handler, "hyde/probe/handler" - autoload :GETHandler, "hyde/probe/http_method" - autoload :POSTHandler, "hyde/probe/http_method" - autoload :HEADHandler, "hyde/probe/http_method" - autoload :PUTHandler, "hyde/probe/http_method" - autoload :DELETEHandler, "hyde/probe/http_method" - autoload :CONNECTHandler, "hyde/probe/http_method" - autoload :OPTIONSHandler, "hyde/probe/http_method" - autoload :TRACEHandler, "hyde/probe/http_method" - autoload :PATCHHandler, "hyde/probe/http_method" - autoload :ServeHandler, "hyde/probe/serve_handler" + # All subclasses of Hyde::Probe that respond to requests + module Handlers + autoload :Handler, "hyde/probe/handler" + autoload :GET, "hyde/probe/http_method" + autoload :POST, "hyde/probe/http_method" + autoload :HEAD, "hyde/probe/http_method" + autoload :PUT, "hyde/probe/http_method" + autoload :DELETE, "hyde/probe/http_method" + autoload :CONNECT, "hyde/probe/http_method" + autoload :OPTIONS, "hyde/probe/http_method" + autoload :TRACE, "hyde/probe/http_method" + autoload :PATCH, "hyde/probe/http_method" + autoload :Serve, "hyde/probe/serve_handler" + end - # Binding that provides execution context for Probes. - class ProbeBinding + # Context that provides execution context for Probes. + class ProbeContext + include Hyde::DSL::ProbeConstructors include Hyde::DSL::ProbeMethods include Hyde::DSL::CommonMethods diff --git a/lib/hyde/probe/handler.rb b/lib/hyde/probe/handler.rb index 205d905..8a8e19f 100644 --- a/lib/hyde/probe/handler.rb +++ b/lib/hyde/probe/handler.rb @@ -1,52 +1,56 @@ # frozen_string_literal: true +require_relative "../probe" + module Hyde - # Probe that executes a callback on request - class Handler < Hyde::Probe - # @param path [Object] - # @param parent [Hyde::Node] - # @param exec [#call] - def initialize(path, parent:, &exec) - super(path, parent: parent) - @callback = exec - @binding = Hyde::ProbeBinding.new(self) - @response = nil - end - - attr_accessor :response - attr_reader :request - - # Method callback on successful request navigation. - # Runs block supplied with object initialization. - # Request's #splat and #param are passed to block. - # - # Callback's returned should be one of viable responses: - # - # - {Hyde::Response} object - # - An array that matches Rack return form - # - An array that matches old (Rack 2.x) return form - # - A string (returned as HTML with code 200) - # - false (bounces the request to next handler) - # @param request [Hyde::Request] - # @return [Boolean] true if further navigation is possible - # @raise [UncaughtThrowError] may raise if die() is called. - def process(request) - @response = nil - return reject(request) unless request.path.match?(/^\/?$/) - - @request = request - response = catch(:break) do - @binding.instance_exec(*request.splat, - **request.param, - &@callback) + module Handlers + # Probe that executes a callback on request + class Handler < Hyde::Probe + # @param path [Object] + # @param parent [Hyde::Node] + # @param exec [#call] + def initialize(path, parent:, &exec) + super(path, parent: parent) + @callback = exec + @context = Hyde::ProbeContext.new(self) + @response = nil end - return false unless response - - if @response and [String, File, IO].include? response.class - @response.body = response - throw :finish, @response + + attr_accessor :response + attr_reader :request + + # Method callback on successful request navigation. + # Runs block supplied with object initialization. + # Request's #splat and #param are passed to block. + # + # Callback's returned should be one of viable responses: + # + # - {Hyde::Response} object + # - An array that matches Rack return form + # - An array that matches old (Rack 2.x) return form + # - A string (returned as HTML with code 200) + # - false (bounces the request to next handler) + # @param request [Hyde::Request] + # @return [Boolean] true if further navigation is possible + # @raise [UncaughtThrowError] may raise if die() is called. + def process(request) + @response = nil + return reject(request) unless request.path.match?(/^\/?$/) + + @request = request + response = catch(:break) do + @context.instance_exec(*request.splat, + **request.param, + &@callback) + end + return false unless response + + if @response and [String, File, IO].include? response.class + @response.body = response + throw :finish, @response + end + throw :finish, response end - throw :finish, response end end end diff --git a/lib/hyde/probe/http_method.rb b/lib/hyde/probe/http_method.rb index 7b4ed4a..f8bc439 100644 --- a/lib/hyde/probe/http_method.rb +++ b/lib/hyde/probe/http_method.rb @@ -1,70 +1,74 @@ # frozen_string_literal: true +require_relative "../probe" + module Hyde - # Probe that executes callback on a GET - class GETHandler < Hyde::Handler - METHOD = "GET" + module Handlers + # Probe that executes callback on a GET + class GET < Hyde::Handlers::Handler + METHOD = "GET" - # Method callback on successful request navigation. - # Runs block supplied with object initialization. - # Request's #splat and #param are passed to block. - # - # Callback's returned should be one of viable responses: - # - # - {Hyde::Response} object - # - An array that matches Rack return form - # - An array that matches old (Rack 2.x) return form - # - A string (returned as HTML with code 200) - # - false (bounces the request to next handler) - # @param request [Hyde::Request] - # @return [Boolean] true if further navigation is possible - # @raise [UncaughtThrowError] may raise if die() is called. - def process(request) - unless request.request_method.casecmp(self.class::METHOD).zero? - return false + # Method callback on successful request navigation. + # Runs block supplied with object initialization. + # Request's #splat and #param are passed to block. + # + # Callback's returned should be one of viable responses: + # + # - {Hyde::Response} object + # - An array that matches Rack return form + # - An array that matches old (Rack 2.x) return form + # - A string (returned as HTML with code 200) + # - false (bounces the request to next handler) + # @param request [Hyde::Request] + # @return [Boolean] true if further navigation is possible + # @raise [UncaughtThrowError] may raise if die() is called. + def process(request) + unless request.request_method.casecmp(self.class::METHOD).zero? + return false + end + + super(request) end + end - super(request) + # Probe that executes callback on a POST + class POST < GET + METHOD = "POST" + end + + # Probe that executes callback on a HEAD + class HEAD < GET + METHOD = "HEAD" + end + + # Probe that executes callback on a PUT + class PUT < GET + METHOD = "PUT" + end + + # Probe that executes callback on a DELETE + class DELETE < GET + METHOD = "DELETE" + end + + # Probe that executes callback on a CONNECT + class CONNECT < GET + METHOD = "CONNECT" + end + + # Probe that executes callback on a OPTIONS + class OPTIONS < GET + METHOD = "OPTIONS" + end + + # Probe that executes callback on a TRACE + class TRACE < GET + METHOD = "TRACE" + end + + # Probe that executes callback on a PATCH + class PATCH < GET + METHOD = "PATCH" end end - - # Probe that executes callback on a POST - class POSTHandler < GETHandler - METHOD = "POST" - end - - # Probe that executes callback on a HEAD - class HEADHandler < GETHandler - METHOD = "HEAD" - end - - # Probe that executes callback on a PUT - class PUTHandler < GETHandler - METHOD = "PUT" - end - - # Probe that executes callback on a DELETE - class DELETEHandler < GETHandler - METHOD = "DELETE" - end - - # Probe that executes callback on a CONNECT - class CONNECTHandler < GETHandler - METHOD = "CONNECT" - end - - # Probe that executes callback on a OPTIONS - class OPTIONSHandler < GETHandler - METHOD = "OPTIONS" - end - - # Probe that executes callback on a TRACE - class TRACEHandler < GETHandler - METHOD = "TRACE" - end - - # Probe that executes callback on a PATCH - class PATCHHandler < GETHandler - METHOD = "PATCH" - end end diff --git a/lib/hyde/probe/serve_handler.rb b/lib/hyde/probe/serve_handler.rb index a2b65e6..69911fd 100644 --- a/lib/hyde/probe/serve_handler.rb +++ b/lib/hyde/probe/serve_handler.rb @@ -1,28 +1,32 @@ # frozen_string_literal: true +require_relative "../probe" + module Hyde - # Probe that sends files from a location - class ServeHandler < Hyde::Probe - # @param path [Object] - # @param parent [Hyde::Node] - # @param exec [#call] - def initialize(path, parent:) - super(path, parent: parent) - end + module Handlers + # Probe that sends files from a location + class Serve < Hyde::Probe + # @param path [Object] + # @param parent [Hyde::Node] + # @param exec [#call] + def initialize(path, parent:) + super(path, parent: parent) + end - attr_accessor :response + attr_accessor :response - # Method callback on successful request navigation. - # Tries to serve files matched by handler - # @param request [Hyde::Request] - # @return [Boolean] true if file was found - def process(request) - path = File.expand_path(request.filepath) - return unless path.start_with? @properties["path"] + # Method callback on successful request navigation. + # Tries to serve files matched by handler + # @param request [Hyde::Request] + # @return [Boolean] true if file was found + def process(request) + path = File.expand_path(request.filepath) + return unless path.start_with? @properties["path"] - File.open(path.delete_suffix("/")) - rescue StandardError - false + File.open(path.delete_suffix("/")) + rescue StandardError + false + end end end end diff --git a/lib/hyde/server.rb b/lib/hyde/server.rb index 3b38d63..cb9dbfc 100644 --- a/lib/hyde/server.rb +++ b/lib/hyde/server.rb @@ -2,16 +2,15 @@ require_relative 'path' require_relative 'request' -require_relative 'dsl/path_constructors' require_relative 'util/html' module Hyde - class ServerBinding < Hyde::PathBinding + class ServerContext < Hyde::PathContext end # A specialized path that can be used directly as a Rack application. class Server < Hyde::Path - Binding = ServerBinding + Context = ServerContext # @param parent [Hyde::Node, nil] Parent object to inherit properties to # @param setup [#call] Setup block diff --git a/lib/hyde/template.rb b/lib/hyde/template.rb index 65e9346..b39f9a8 100644 --- a/lib/hyde/template.rb +++ b/lib/hyde/template.rb @@ -1,30 +1,76 @@ # frozen_string_literal: true +require_relative 'dsl/constructors_probe' +require_relative 'dsl/methods_common' +require_relative 'dsl/methods_probe' + module Hyde - # Adapter class for template engines - # @abstract This class does not actually do anything template related. + # All template engine adapters subclassed from Template + module Templates + autoload :ERB, "hyde/template/erb" + end + + # Context for template engines + class TemplateContext + include Hyde::DSL::CommonMethods + include Hyde::DSL::ProbeMethods + include Hyde::DSL::ProbeConstructors + + def initialize(parent) + @origin = parent + end + end + + # Interface for Template engines + # @abstract does not represent any actual template engine. class Template - # @param filename [String] + # @param input [String, File] # @param context [Binding, nil] - # @param locals [Hash{Symbol => Object}, nil] - def initialize(filename, context: nil, locals: nil) - @data = File.read(filename) - @context = context or binding - @locals.each do |k, v| - @context.local_variable_set(k, v) + # @param locals [Hash, nil] + def initialize(input, toplevel: nil, locals: nil) + @template = input.is_a?(File) ? input.read : input + input.close if input.is_a? File + @binding = toplevel or binding + locals&.each do |k, v| + @binding.local_variable_set(k,v) + end + @context = TemplateContext.new(self) + end + + # Set local variable + # @param key [Symbol] + # @param value [Object] + def local_variable_set(key, value) + @binding.local_variable_set(key, value) + end + + # Get local variable + # @param key [Symbol] + # @return [Object] + def local_variable_get(key) + @binding.local_variable_get(key) + end + + # Get an array of defined local variables + # @return [Array(Symbol)] + def local_variables + @binding.local_variables + end + + # Override binding variables. + # @param vars [Hash{Symbol => Object}] + def override_locals(vars) + vars.each do |k, v| + @binding.local_variable_set(k, v) end end - # Prepare template before rendering. - # (This method is an interface stub) - def prepare - @template = nil # your template generator goes here + # Run the template + # @note This method is a stub. + def run + # ... (stub) end - # Render template - # (This method is an interface stub) - def render - (@template ||= prepare).render(@context) - end + attr_accessor :binding end end diff --git a/lib/hyde/template/erb.rb b/lib/hyde/template/erb.rb new file mode 100644 index 0000000..d329c81 --- /dev/null +++ b/lib/hyde/template/erb.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +require 'erb' +require_relative '../template' + +module Hyde + module Templates + # ERB Template language adapter + class ERB < Hyde::Template + # @see Hyde::Template#new + def initialize(input, toplevel: nil, locals: nil) + super + @template = ::ERB.new(@template) + @template.filename = input.is_a?(File) ? input.path : "(Inline)" + end + + # Run the template. + def run + @context.instance_exec(@template,@binding) do |template, binding| + template.result binding + end + end + end + end +end