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.cr

Constant 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

Class Method Detail

def self.categories : Array(String) #

Every category name that has a markdown page, sorted for stable output.


[View source]
def self.entries : Hash(String, Solution) #

maze name -> Solution.


[View source]
def self.json_body : String #

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.


[View source]
def self.markdown(category : String) : String | Nil #

Raw markdown for one category, or nil if there is no such page.


[View source]