How mustache/mustache-sinatra works
Mustache::Sinatra integrates Mustache rendering into Sinatra. A Sinatra route calls the installed mustache helper, which resolves or compiles a view class, renders it, and optionally wraps the result in a layout. The README also documents direct Mustache subclasses and template-only fallback. Runtime behavior is concentrated in the helper module; templates, view classes, Sinatra, and Mustache itself are supplied by the host application or dependencies.
Main entry points: helpers.rb Render helper · sinatra.rb Extension registration
Components 7
Sinatra integration
- Extension registration
lib/mustache/sinatra.rb - Render helper
lib/mustache/sinatra/helpers.rb
Mustache rendering
- View resolution
lib/mustache/sinatra/helpers.rb - View classes
- Mustache templates
- Mustache engine
Other components
- Sinatra app
Connections 8
- Sinatra app → Extension registration: registers
README.md - Extension registration → Sinatra app: installs helpers
lib/mustache/sinatra.rb - Sinatra app → Render helper: calls helper
README.md - Render helper → View resolution: resolves view
lib/mustache/sinatra/helpers.rb - View resolution → View classes: looks up
lib/mustache/sinatra/helpers.rb - Render helper → Mustache engine: renders view
lib/mustache/sinatra/helpers.rb - Render helper → Mustache engine: renders layout
lib/mustache/sinatra/helpers.rb - Mustache engine → Mustache templates: renders from
README.md