In config/assets.cr:
require "../src/lib/asset_renderer"
require "../src/lib/import_map"
AssetRenderer.configure do |c|
c.source_path = Path.new("src")
c.output_path = Path.new("public/h/")
c.rendered_path = Path.new("/h/")
In config/assets.cr:
require "../src/lib/asset_renderer"
require "../src/lib/import_map"
AssetRenderer.configure do |c|
c.source_path = Path.new("src")
c.output_path = Path.new("public/h/")
c.rendered_path = Path.new("/h/")
class FanOutInJob < Mosquito::QueuedJob | |
params( | |
root : String, | |
fan_state : String = "starting", | |
parent_job_id : String = "", | |
branch : String = "" | |
) | |
def perform | |
case fan_state |
export default class Builder { | |
static tag(name, text) { | |
const tag = document.createElement(name) | |
tag.textContent = text | |
return tag | |
} | |
static link(href, text) { | |
const link = Builder.tag("a", text) | |
link.href = href |
This is the series of steps I followed to get Crystal and Lucky running on a Mac M1 from scratch, as of Oct. 2021.
~/bin
and /opt
both exist./opt
will have to be created with sudo
but should be owned by your user.$PATH
includes ~/bin
. Doing so is up to you and will vary a bit depending on your shell.+public/_entrypoint.html | |
+public/*.js | |
+public/*.css | |
+public/*.map |
FROM crystallang/crystal:0.27.2 | |
WORKDIR /opt/src | |
# Install nodejs | |
COPY bin ./bin | |
RUN bin/nodesource_11.x | |
RUN apt-get update && apt-get install -y nodejs | |
# npm install |
# src/actions/browser_action.cr | |
abstract class BrowserAction < Lucky::Action | |
include Lucky::ProtectFromForgery | |
include Auth::SessionManagement | |
include Auth::SessionEnforcement | |
require_logged_in! | |
expose current_user |
module Auth::RedirectIfSignedIn | |
macro included | |
include Auth::SkipRequireSignIn | |
before redirect_if_signed_in | |
# Most notably, this is removed everywhere. All actions now depend on a current_user. | |
# unexpose current_user | |
end | |
# ... |
print "Type something: " | |
entered_chars = [] of Char | |
STDIN.raw do | |
loop do | |
char = STDIN.read_char | |
next if char.nil? |
########################## | |
# CONFIG | |
########################## | |
# select and require the appropriate database driver here: | |
require "pg" | |
# require "sqlite" | |
# require "mysql" | |
TABLE_NAME = "schema_version" |