| gemspec("counter-app") do |config| | |
| gem path: "../mruby" | |
| gem path: "../hokusai-pocket" | |
| end |
| # Proposed DSL API | |
| # Declare a gemspec with an ID | |
| # | |
| # conf contains properties about the build | |
| gemspec "mruby-hokusai-pocket" do |conf| | |
| conf.version = "0.1.0" | |
| conf.author = "skinnyjames" | |
| #..etc |
You will need Raylib to run this example: https://github.com/raysan5/raylib?tab=readme-ov-file#build-and-installation
To run, you will need to set the RAYLIB_PATH env, eg:
gem install hokusai-zero -v 0.2.7
# install raylib ...
RAYLIB_PATH=libraylib.dylib ruby --yjit squares.rbThe strategy is about representing the initial state of a file, adding patches (which add changes to a file), and the reconstruction of a file from a given patch's ancestor tree is about calculating offsets.
A rough schema looks like...
// the initial file
CREATE TABLE IF NOT EXISTS files (
id INTEGER PRIMARY KEY AUTOINCREMENT,
directory INTEGER CHECK( directory in (0, 1) ) NOT NULL DEFAULT 0,
content BLOB DEFAULT NULL,
added_on INTEGER NOT NULL,The strategy is about representing the initial state of a file, adding patches (which add changes to a file), and the reconstruction of a file from a given patch's ancestor tree is about calculating offsets.
A rough schema looks like...
// the initial file
CREATE TABLE IF NOT EXISTS files (
id INTEGER PRIMARY KEY AUTOINCREMENT,
directory INTEGER CHECK( directory in (0, 1) ) NOT NULL DEFAULT 0,
content BLOB DEFAULT NULL,
added_on INTEGER NOT NULL,| # dependencies | |
| require_relative "../src/hokusai" | |
| require_relative "../src/hokusai/backends/sdl2" | |
| require_relative "../src/hokusai/backends/raylib" | |
| module Dynamic | |
| class Block < Hokusai::Block | |
| template <<~EOF | |
| [template] | |
| empty |
| # frozen_string_literal: true | |
| # dependencies | |
| require_relative "../src/hokusai" | |
| require_relative "../src/hokusai/backends/sdl2" | |
| require_relative "../src/hokusai/backends/raylib" | |
| require_relative "./stock" | |
| require_relative "./tic_tac_toe" | |
| # can use ruby stdlib |
| require "socket" | |
| require "./format" | |
| module Test | |
| Log.setup do |log| | |
| dispatcher = Log::DispatchMode::Direct | |
| backend = Log::IOBackend.new(dispatcher: dispatcher, formatter: Format) | |
| log.bind "*", :trace, backend | |
| end |
The premise for the layouting is using sane defaults. Ignoring the propositions of css and html for a while, imagine a whitespace significant template.
{{ template }}
root
hblock
text {:content="first"}
vblock
text {:content="second"}
text {:content="third"}