module
Xssmaze::Solutions
Overview
Compile-time answer key. The solutions/ tree carries a ground-truth payload
and injection context for every maze; embedding it here the way
Xssmaze::VERSION embeds shard.yml keeps the binary self-contained, so the
Docker image ships the answer key without shipping the directory. Parity with
the live catalog is enforced by spec/solutions_spec.cr, so the two can never
drift apart again.
Defined in:
solutions.crConstant Summary
-
ENTRIES =
begin parsed = {} of String => Solution MARKDOWN.each_value do |md| parse_into(md, parsed) end parsed end -
maze name -> Solution, parsed once at boot from the embedded markdown.
-
MARKDOWN =
embed_solutions -
category -> markdown body (what
GET /solutions/<category>serves).
Class Method Summary
-
.categories : Array(String)
Every category name that has a markdown page, sorted for stable output.
-
.entries : Hash(String, Solution)
maze name -> Solution.
-
.json_body : String
Every entry keyed by maze name, for
GET /solutions.json. -
.markdown(category : String) : String | Nil
Raw markdown for one category, or nil if there is no such page.
Class Method Detail
Every category name that has a markdown page, sorted for stable output.
Every entry keyed by maze name, for GET /solutions.json. Keys are sorted
so the body — and therefore its cached ETag — is stable across boots.
Raw markdown for one category, or nil if there is no such page.