Skip to content

Instantly share code, notes, and snippets.

View zenspider's full-sized avatar
🌈
It's complicated?

Ryan Davis zenspider

🌈
It's complicated?
View GitHub Profile
#!/usr/bin/env -S ruby -w
$: << File.expand_path("~/Links/RI/lib")
$: << File.expand_path("~/Links/ZT/lib")
require "rubygems"
require "inline"
class X
inline :C do |builder|
10000 $ ./diffdump 'def a(...); b(...); end' 'def a(x, ...); b(...); end'
--- /dev/fd/63 2025-05-10 14:00:39
+++ /dev/fd/62 2025-05-10 14:00:39
@@ -1,12 +1,17 @@
-== disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(1,23)>
+== disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(1,26)>
0000 definemethod :a, a ( 1)[Li]
0003 putobject :a
0005 leave
--- /dev/fd/63 2025-05-08 15:52:58
+++ /dev/fd/62 2025-05-08 15:52:58
@@ -1,14 +1,19 @@
-== disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(1,33)>
+== disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(1,36)>
0000 definemethod :x, x ( 1)[Li]
0003 putself
0004 putobject 4
0006 opt_send_without_block <calldata!mid:x, argc:1, FCALL|ARGS_SIMPLE>
0008 leave
### Renames::
* Minitest.__run becomes Minitest.run_all_suites
* Runnable.run becomes Runnable.run_suite
* Minitest.run_one_method becomes Runnable.run (essentially, see below)
### Additions::
* Added Runnable#filter_runnable_methods # extraction from Runnable.run_suite
* ? maybe add --plugins option?
const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
// TODO: import cppunit as direct build
const flags = .{
// TODO: "-std=c++17",
# alt 3
sclas =
stack.last ||
(is_spec_class && self) ||
Minitest::Spec.spec_type(desc, *additional_desc)
# alt 4
sclas =
stack.last \
|| (is_spec_class && self) \
#!/bin/bash
set -e
# set -xv
DIR=/usr/local/opt/zig
if [ "$1" == "clean" ]; then
shift
echo "...from clean"
diff -r old/lib/minitest/assertions.rb new/lib/minitest/assertions.rb
--- old/lib/minitest/assertions.rb
+++ new/lib/minitest/assertions.rb
@@ -212,8 +212,12 @@
# See also: Minitest::Assertions.diff
def assert_equal exp, act, msg = nil
- msg = message(msg, E) { diff exp, act }
- result = assert exp == act, msg
+ begin
diff -r old/lib/minitest.rb new/lib/minitest.rb
--- old/lib/minitest.rb
+++ new/lib/minitest.rb
@@ -647,7 +647,7 @@
##
# The location of the test method.
- attr_accessor :source_location
+ attr_writer :source_location
class ZenwebBuilder < WEBrick::HTTPServlet::FileHandler
@@semaphore = Mutex.new
def service req, res
@@site ||= @@semaphore.synchronize { website }
url = req.path
target_path = File.join(".site", url)
target_path = File.join target_path, "index.html" if