Project

nyth

0.0
The project is in a healthy, maintained state
Nyth maps Rack requests to files under an app directory and renders ERB with simple partial support.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

>= 5.25, < 6
>= 13, < 15

Runtime

>= 3.1, < 4
>= 2.7, < 3
 Project Readme

Nyth 🪺

Pronounced neeth (Welsh for "nest")

Nyth is a tiny Rack renderer for file-backed ERB pages and partials. No structure, just build it: put files in app, put Ruby in lib, refresh the page.

Usage

run Nyth.app(root: __dir__, reload: :changed, reload_check_interval: 5.0)

Requests map directly to files in app:

  • / renders app/index.erb.
  • /about.erb renders app/about.erb.
  • /assets/style.css serves app/assets/style.css.

ERB files can render partials from app:

<%= render "_nav.erb" %>
<%= render "_page_title.erb", heading: "About" %>

Files beginning with _ are render-only partials and return 404 when requested directly.

Ruby constants under lib are loaded with Zeitwerk. By default, reload: :changed checks Ruby file mtimes under lib at most once every 5 seconds and reloads constants only after a file changes. The nest stays warm without rebuilding it on every request.

Reload modes:

  • :changed reloads lib only when Ruby files change.
  • :always reloads lib on every request.
  • false loads lib once at boot.

Set reload_check_interval: to control how often :changed scans lib.

Tests

bundle exec rake