Module: Wurk::Web::Extension
- Defined in:
- lib/wurk/web/extension.rb,
lib/wurk/web/helpers.rb
Overview
Server-side renderer for third-party Web extensions (spec §25, #187).
Sidekiq extensions register Sinatra-style routes + ERB views via
Sidekiq::Web.register(Ext, name:, tab:, index:, root_dir:, asset_paths:),
where Ext.registered(app) calls app.get "/path" do … end and
app.helpers SomeModule. wurk's dashboard is a SolidJS SPA with no Sinatra
render path, so this module provides a minimal, Sidekiq-Web-compatible
renderer: it captures the routes, runs the matched block in an Action
context (a WebHelpers subset, upstream's Action surface, and the ext's
own helpers), and returns the response for the SPA's Extension page to
embed.
It does NOT depend on the sidekiq gem — extensions registered through
wurk's own Sidekiq::Web.register alias render unchanged.
Defined Under Namespace
Modules: Helpers Classes: Action, App, Renderer, Route
Constant Summary collapse
- OFF_SITE =
A scheme ("https:", "javascript:") or a scheme-relative "//" — which browsers also spell
/\or\\— names somewhere off this host. %r{\A(?:[a-z][a-z0-9+.-]*:|[/\\]{2})}i- RACK_TRIPLE =
->(r) { r.is_a?(::Array) && r.size == 3 && r[0].is_a?(::Integer) }