Skip to content

Commit abe15f3

Browse files
committed
small wubular tweaks
1 parent 1ab5a5a commit abe15f3

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

md/wubular-1.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*Ever wished a Ruby app could run entirely in your browser, without ever calling back to a server? That’s the spark behind story of [**Wubular**](https://rubyelders.github.io/wubular)[**Rubular**](https://rubular.com/) remake, powered by Ruby compiled to [WebAssembly](https://webassembly.org/) running nativelly in browser.*
1+
*Ever wished a Ruby app could run entirely in your browser, without ever calling back to a server? That’s what sparked [**Wubular**](https://rubyelders.github.io/wubular)a [**Rubular**](https://rubular.com/) remake, powered by Ruby compiled to [WebAssembly](https://webassembly.org/) running natively in the browser.*
22

33
If you’ve been around Ruby, you probably know [**Rubular**](https://rubular.com/) — the de-facto standard tool created by <img src="https://avatars.githubusercontent.com/u/22803?v=4" class="avatar"> [Michael Lovitt (@lovitt)](https://github.com/lovitt) back in 2007 for quickly composing and testing [Ruby regular expressions](https://www.ruby-lang.org/en/). I’ve relied on it countless times, but the app itself now feels a bit outdated — for example, the footer shows it’s still running on an old Ruby. On top of that, Rubular isn’t open source (at least I haven’t been able to find any code published), so the only way I thought I might help was by reaching out to the original author and offering some community support.
44

@@ -20,7 +20,7 @@ But then it hit me: why not just run it directly in the browser? Since Ruby 3.2,
2020

2121
## Rubular’s classic architecture
2222

23-
Rubular was a brilliant little invention: a regex box, a test string box, and instant feedback. Behind the curtain, though, it’s a traditional **server–client setup**.
23+
Rubular was a brilliant little invention: just a regex box, a test string box, and instant feedback. Behind the curtain, though, it’s a traditional **server–client setup**.
2424

2525
The frontend is plain HTML + JavaScript. Each time you type, the JS serializes the form and fires off a **POST** request to the backend:
2626

@@ -73,13 +73,13 @@ It’s still the same Ruby you know — now just living inside a browser tab.
7373

7474
[**Wubular**](https://rubyelders.github.io/wubular) is a Rubular clone that runs 100% in your browser.
7575

76-
From the user’s perspective, it feels the same: paste a regexp, pick options, type a test string, and see results instantly. But under the hood, everything changed:
76+
For users, it feels the same: paste a regexp, pick options, type a test string, and see results instantly. But under the hood, everything changed:
7777

7878
* The Ruby interpreter is compiled to WebAssembly.
7979
* App logic is plain `.rb` files, loaded with `<script type="text/ruby" src="app.rb">`.
8080
* The DOM is manipulated directly from Ruby classes that behave like components — mount, unmount, react to events.
8181

82-
There aren’t polished frameworks yet for Ruby-in-the-browser, but Ruby doesn’t need to reinvent the wheel. Using the built-in `js` library (`require "js"`), Ruby can talk to native browser APIs like `document.querySelector` or `addEventListener`.
82+
There aren’t polished Ruby-in-the-browser frameworks yet, but Ruby doesn’t need to reinvent the wheel. Using the built-in `js` library (`require "js"`), Ruby can talk to native browser APIs like `document.querySelector` or `addEventListener`.
8383

8484
It really is this simple, just try it:
8585

@@ -90,7 +90,7 @@ It really is this simple, just try it:
9090
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
9191
></iframe>
9292
93-
Or, a slightly richer one: regex input + text input + a checkbox that updates live:
93+
Or, a slightly richer one: a regex input, a text input, and a checkbox that updates live:
9494

9595
<iframe src="https://codesandbox.io/embed/nlwj4q?view=split&module=%2Findex.html&editorsize=65&runonclick=1&hidenavigation=1"
9696
style="width:100%; height: 800px; border:0; border-radius: 4px; overflow:hidden;"
@@ -99,15 +99,15 @@ Or, a slightly richer one: regex input + text input + a checkbox that updates li
9999
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
100100
></iframe>
101101
102-
That’s literally how the first Wubular prototype came to life.
102+
That’s exactly how the first Wubular prototype came to life.
103103

104104
---
105105

106106
## Ruby, WASM, and the Future of Browser Apps
107107

108108
Wubular is already [live](https://rubyelders.github.io/wubular) and usable — paste a regex, type your string, and see results instantly. But it’s also an experiment in what Ruby + WASM makes possible.
109109

110-
And here’s the kicker: Wubular isn’t just a quick prototype — it’s also fully tested app developed using [TDD](https://en.wikipedia.org/wiki/Test-driven_development). Like any serious Ruby project, it ships with an automated test suite. The difference? It runs also directly in your browser, using the same tools you’d use locally. In Wubular’s case, that’s good old [**Minitest**](https://github.com/minitest/minitest/). Open the [DevTools console](https://en.wikipedia.org/wiki/Web_development_tools) in your browser, append `?run_tests` to the URL, and watch the results fly by. Full integration test runs complete in milliseconds. Imagine a world where client-side apps boot only after passing their own test suite on client.
110+
And here’s the kicker: Wubular isn’t just a quick prototype — it’s also a fully tested app, developed with [TDD](https://en.wikipedia.org/wiki/Test-driven_development). Like any serious Ruby project, it ships with an automated test suite. The difference? It also runs directly in your browser, using the same tools you’d use locally. In Wubular’s case, that’s good old [**Minitest**](https://github.com/minitest/minitest/). Open the [DevTools console](https://en.wikipedia.org/wiki/Web_development_tools) in your browser, append `?run_tests` to the URL, and watch the results fly by. Full integration test runs complete in milliseconds. Imagine if client-side apps booted only after passing their own test suite locally.
111111

112112
**PRO TIP: You can combine various Ruby versions with `run_tests` parameter like `?ruby=3.2&run_tests`.**
113113

@@ -123,8 +123,8 @@ And here’s the kicker: Wubular isn’t just a quick prototype — it’s also
123123
</figcaption>
124124
</figure>
125125

126-
This is first post of Wubular serie. In the next one, I’ll dig into the internals: how Wubular mounts Ruby components in the DOM, how test-driven development feels when everything runs in the browser, and why the speed feels almost unreal.
126+
This is the first post in the Wubular series. In the next one, I’ll dig into the internals: how Wubular mounts Ruby components in the DOM, how test-driven development feels when everything runs in the browser, and why the speed feels almost unreal.
127127

128-
In the meantime, go explore: the source is [all right there](https://rubyelders.github.io/wubular) in DevTools → Network, or [up on GitHub](https://github.com/RubyElders/wubular). Have fun, try to run the tests, and imagine what else Ruby in the browser might unlock.
128+
In the meantime, go explore: the source is [right there](https://rubyelders.github.io/wubular) in DevTools → Network, or [up on GitHub](https://github.com/RubyElders/wubular). Have fun, try to run the tests, and imagine what else Ruby in the browser might unlock.
129129

130130
**Stay connected!** [Mastodon](https://ruby.social/@rubyelders), [Bluesky](https://rubyelders.bsky.social) or [Twitter/X](https://x.com/RubyElders).

writings/2025-08-wubular-1.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ <h1>Introducing Wubular: Rubular Reimagined in Ruby+WASM</h1>
7777
</p>
7878
</header>
7979

80-
<p><em>Ever wished a Ruby app could run entirely in your browser, without ever calling back to a server? That’s the spark behind story of <a href="https://rubyelders.github.io/wubular" target="_blank" rel="nofollow noopener"><strong>Wubular</strong></a><a href="https://rubular.com/" target="_blank" rel="nofollow noopener"><strong>Rubular</strong></a> remake, powered by Ruby compiled to <a href="https://webassembly.org/" target="_blank" rel="nofollow noopener">WebAssembly</a> running nativelly in browser.</em></p>
80+
<p><em>Ever wished a Ruby app could run entirely in your browser, without ever calling back to a server? That’s what sparked <a href="https://rubyelders.github.io/wubular" target="_blank" rel="nofollow noopener"><strong>Wubular</strong></a>a <a href="https://rubular.com/" target="_blank" rel="nofollow noopener"><strong>Rubular</strong></a> remake, powered by Ruby compiled to <a href="https://webassembly.org/" target="_blank" rel="nofollow noopener">WebAssembly</a> running natively in the browser.</em></p>
8181

8282
<p>If you’ve been around Ruby, you probably know <a href="https://rubular.com/" target="_blank" rel="nofollow noopener"><strong>Rubular</strong></a> — the de-facto standard tool created by <img src="https://avatars.githubusercontent.com/u/22803?v=4" class="avatar"> <a href="https://github.com/lovitt" target="_blank" rel="nofollow noopener">Michael Lovitt (@lovitt)</a> back in 2007 for quickly composing and testing <a href="https://www.ruby-lang.org/en/" target="_blank" rel="nofollow noopener">Ruby regular expressions</a>. I’ve relied on it countless times, but the app itself now feels a bit outdated — for example, the footer shows it’s still running on an old Ruby. On top of that, Rubular isn’t open source (at least I haven’t been able to find any code published), so the only way I thought I might help was by reaching out to the original author and offering some community support.</p>
8383

@@ -96,7 +96,7 @@ <h1>Introducing Wubular: Rubular Reimagined in Ruby+WASM</h1>
9696

9797
<h2 id="rubulars-classic-architecture">Rubular’s classic architecture</h2>
9898

99-
<p>Rubular was a brilliant little invention: a regex box, a test string box, and instant feedback. Behind the curtain, though, it’s a traditional <strong>server–client setup</strong>.</p>
99+
<p>Rubular was a brilliant little invention: just a regex box, a test string box, and instant feedback. Behind the curtain, though, it’s a traditional <strong>server–client setup</strong>.</p>
100100

101101
<p>The frontend is plain HTML + JavaScript. Each time you type, the JS serializes the form and fires off a <strong>POST</strong> request to the backend:</p>
102102

@@ -159,33 +159,33 @@ <h2 id="meet-wubular">Meet <a href="https://rubyelders.github.io/wubular" target
159159

160160
<p><a href="https://rubyelders.github.io/wubular" target="_blank" rel="nofollow noopener"><strong>Wubular</strong></a> is a Rubular clone that runs 100% in your browser.</p>
161161

162-
<p>From the user’s perspective, it feels the same: paste a regexp, pick options, type a test string, and see results instantly. But under the hood, everything changed:</p>
162+
<p>For users, it feels the same: paste a regexp, pick options, type a test string, and see results instantly. But under the hood, everything changed:</p>
163163

164164
<ul>
165165
<li>The Ruby interpreter is compiled to WebAssembly.</li>
166166
<li>App logic is plain <code>.rb</code> files, loaded with <code>&lt;script type="text/ruby" src="app.rb"&gt;</code>.</li>
167167
<li>The DOM is manipulated directly from Ruby classes that behave like components — mount, unmount, react to events.</li>
168168
</ul>
169169

170-
<p>There aren’t polished frameworks yet for Ruby-in-the-browser, but Ruby doesn’t need to reinvent the wheel. Using the built-in <code>js</code> library (<code>require "js"</code>), Ruby can talk to native browser APIs like <code>document.querySelector</code> or <code>addEventListener</code>.</p>
170+
<p>There aren’t polished Ruby-in-the-browser frameworks yet, but Ruby doesn’t need to reinvent the wheel. Using the built-in <code>js</code> library (<code>require "js"</code>), Ruby can talk to native browser APIs like <code>document.querySelector</code> or <code>addEventListener</code>.</p>
171171

172172
<p>It really is this simple, just try it:</p>
173173

174174
<iframe src="https://codesandbox.io/embed/xpjsns?view=split&amp;module=%2Findex.html&amp;editorsize=65&amp;runonclick=1&amp;hidenavigation=1" style="width:100%; height: 350px; border:0; border-radius: 4px; overflow:hidden;" title="ruby-wasm-hello-world" allow="accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking" sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"></iframe>
175175

176-
<p>Or, a slightly richer one: regex input + text input + a checkbox that updates live:</p>
176+
<p>Or, a slightly richer one: a regex input, a text input, and a checkbox that updates live:</p>
177177

178178
<iframe src="https://codesandbox.io/embed/nlwj4q?view=split&amp;module=%2Findex.html&amp;editorsize=65&amp;runonclick=1&amp;hidenavigation=1" style="width:100%; height: 800px; border:0; border-radius: 4px; overflow:hidden;" title="ruby-wasm-hello-world" allow="accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking" sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"></iframe>
179179

180-
<p>That’s literally how the first Wubular prototype came to life.</p>
180+
<p>That’s exactly how the first Wubular prototype came to life.</p>
181181

182182
<hr>
183183

184184
<h2 id="ruby-wasm-and-the-future-of-browser-apps">Ruby, WASM, and the Future of Browser Apps</h2>
185185

186186
<p>Wubular is already <a href="https://rubyelders.github.io/wubular" target="_blank" rel="nofollow noopener">live</a> and usable — paste a regex, type your string, and see results instantly. But it’s also an experiment in what Ruby + WASM makes possible.</p>
187187

188-
<p>And here’s the kicker: Wubular isn’t just a quick prototype — it’s also fully tested app developed using <a href="https://en.wikipedia.org/wiki/Test-driven_development" target="_blank" rel="nofollow noopener">TDD</a>. Like any serious Ruby project, it ships with an automated test suite. The difference? It runs also directly in your browser, using the same tools you’d use locally. In Wubular’s case, that’s good old <a href="https://github.com/minitest/minitest/" target="_blank" rel="nofollow noopener"><strong>Minitest</strong></a>. Open the <a href="https://en.wikipedia.org/wiki/Web_development_tools" target="_blank" rel="nofollow noopener">DevTools console</a> in your browser, append <code>?run_tests</code> to the URL, and watch the results fly by. Full integration test runs complete in milliseconds. Imagine a world where client-side apps boot only after passing their own test suite on client.</p>
188+
<p>And here’s the kicker: Wubular isn’t just a quick prototype — it’s also a fully tested app, developed with <a href="https://en.wikipedia.org/wiki/Test-driven_development" target="_blank" rel="nofollow noopener">TDD</a>. Like any serious Ruby project, it ships with an automated test suite. The difference? It also runs directly in your browser, using the same tools you’d use locally. In Wubular’s case, that’s good old <a href="https://github.com/minitest/minitest/" target="_blank" rel="nofollow noopener"><strong>Minitest</strong></a>. Open the <a href="https://en.wikipedia.org/wiki/Web_development_tools" target="_blank" rel="nofollow noopener">DevTools console</a> in your browser, append <code>?run_tests</code> to the URL, and watch the results fly by. Full integration test runs complete in milliseconds. Imagine if client-side apps booted only after passing their own test suite locally.</p>
189189

190190
<p><strong>PRO TIP: You can combine various Ruby versions with <code>run_tests</code> parameter like <code>?ruby=3.2&amp;run_tests</code>.</strong></p>
191191

@@ -198,9 +198,9 @@ <h2 id="ruby-wasm-and-the-future-of-browser-apps">Ruby, WASM, and the Future of
198198
</figcaption>
199199
</figure>
200200

201-
<p>This is first post of Wubular serie. In the next one, I’ll dig into the internals: how Wubular mounts Ruby components in the DOM, how test-driven development feels when everything runs in the browser, and why the speed feels almost unreal.</p>
201+
<p>This is the first post in the Wubular series. In the next one, I’ll dig into the internals: how Wubular mounts Ruby components in the DOM, how test-driven development feels when everything runs in the browser, and why the speed feels almost unreal.</p>
202202

203-
<p>In the meantime, go explore: the source is <a href="https://rubyelders.github.io/wubular" target="_blank" rel="nofollow noopener">all right there</a> in DevTools → Network, or <a href="https://github.com/RubyElders/wubular" target="_blank" rel="nofollow noopener">up on GitHub</a>. Have fun, try to run the tests, and imagine what else Ruby in the browser might unlock.</p>
203+
<p>In the meantime, go explore: the source is <a href="https://rubyelders.github.io/wubular" target="_blank" rel="nofollow noopener">right there</a> in DevTools → Network, or <a href="https://github.com/RubyElders/wubular" target="_blank" rel="nofollow noopener">up on GitHub</a>. Have fun, try to run the tests, and imagine what else Ruby in the browser might unlock.</p>
204204

205205
<p><strong>Stay connected!</strong> <a href="https://ruby.social/@rubyelders" target="_blank" rel="nofollow noopener">Mastodon</a>, <a href="https://rubyelders.bsky.social" target="_blank" rel="nofollow noopener">Bluesky</a> or <a href="https://x.com/RubyElders" target="_blank" rel="nofollow noopener">Twitter/X</a>.</p>
206206

0 commit comments

Comments
 (0)