Building maintainable command-line tools with MRuby
summary
Builds a single-binary CLI for a Fastly API using mruby and mruby-cli, actually ports prototypes from CRuby and wires up mruby-curl and mruby-optparse; solves cross-compilation by automating per-platform builds and cross-compiling libcurl, reorganizes Docker-heavy workflow (originally invoked with docker-compose run compile) into outer/inner/rake phases, documents testing quirks (one VM per test, slow full-platform builds) and ships working tools with tradeoffs between static linking and dynamic libraries.
AI-written summary · about
chapters (23)
- 0:00Intro
- 0:16Building maintainable command-line tools with MRuby
- 1:57Install Ruby • Installing gems • Expensive support
- 2:151. Prototype in CRuby 2. Port to MRuby 3. Maintain in MRuby
- 2:30Lightweight ruby • Embeddable • Hardware • Software
- 3:51Using MRuby
- 5:52Write Ruby release on Linux, OS X, Windows
- 6:18MRuby Challenges
- 7:07Language Issues • No pre-defined globals • Some syntax bugs • No keyword arguments for def • Regexp replacements
- 9:55mruby-cli Challenges
- 11:48Improvements • Build MRuby separately • Run docker from a task
- 12:54Cross-compile libraries • Compile MRuby • Run tests
- 13:58Easy vulnerability management • Adds a dependency
- 14:18Cross Compiling
- 15:31Customer Support Tool
- 16:19Prototypes
- 17:17Lessons
- 18:29Switch to mruby-cli
- 19:21Familiar • Type checking Argument completion Shell completion
- 21:40Complications Global setup hard docker-compose documentation . Slow startup
- 23:21Integration tests • Assert output from input
- 24:28mruby-cli • Improved build system • Documentation • Easier upgrades
- 26:29Thank You Questions?








