Squib is a Ruby DSL for prototyping card and board games. Write a little bit of Ruby, define your deck’s stats, then compile your game into a series of images ready for print-and-play or even print-on-demand. Squib is very data-driven and built on the principle of Don’t Repeat Yourself. Think of it like nanDeck done “the Ruby way”. Squib supports:
Squib is based on the Cairo graphics rendering engine, the library of choice for WebKit, Gecko, Inkscape and many, many others.
Check this out.
require 'squib' Squib::Deck.new(cards: 2) do text str: %w(Hello World!) save_png end
We just created a 2-card deck with “Hello” on the first card, and “World” on the second, and saved them out to PNGs.
Wanna see more? Check out the website: http://andymeneely.github.io/squib/
Squib requires Ruby 2.4 or later.
Install it yourself with:
$ gem install squib
If you’re using Bundler, add this line to your application’s Gemfile:
And then execute:
More info: http://squib.readthedocs.org/en/latest/install.html
After installing Squib, you can create a project and run your first build like this:
$ squib new my-cool-game $ cd my-cool-game $ ruby deck.rb
squib new command will generate files and folders like this:
├── .gitignore ├── ABOUT.md ├── Gemfile ├── IDEAS.md ├── PLAYTESTING.md ├── PNP NOTES.md ├── RULES.md ├── Rakefile ├── _output │ └── gitkeep.txt ├── config.yml ├── deck.rb └── layout.yml 12 files
samplesdirectory in the source repository has lots of examples.
Squib tries to keep you DRY (Don’t Repeat Yourself) with the following features:
rangeparameter in Squib is very flexible, meaning that one
textcommand can specify different text in different fonts, styles, colors, etc. for each card. If you find yourself doing multiple
textcommand for the same field across different ranges of cards, there’s probably a better way to condense.
Using SublimeText? I like you already. I’ve written up some Squib snippets to ease remembering Squib commands. It’s called
Squib Snippets on Package Control. Compatible with SublimeText 3. Source code is also on Github (contributions welcome!). Check it out:
See this page
Truthfully, I just thought it was a cool, simple word that was not used much in the Ruby community nor the board game community. But, now that I’ve committed to the name, I’ve realized that: