{"id":13880076,"url":"https://github.com/andymeneely/squib","last_synced_at":"2025-07-16T16:30:45.315Z","repository":{"id":18706062,"uuid":"21916531","full_name":"andymeneely/squib","owner":"andymeneely","description":"A Ruby DSL for prototyping card games.","archived":false,"fork":false,"pushed_at":"2025-02-02T19:17:10.000Z","size":20686,"stargazers_count":935,"open_issues_count":62,"forks_count":68,"subscribers_count":22,"default_branch":"dev","last_synced_at":"2025-06-17T13:20:31.008Z","etag":null,"topics":["board-game","boardgamegeek","card","dsl","game","pngs","prototyping","ruby","squib","sublime-text","svg","tabletop"],"latest_commit_sha":null,"homepage":"http://squib.rocks","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andymeneely.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-07-16T20:46:39.000Z","updated_at":"2025-06-08T06:00:51.000Z","dependencies_parsed_at":"2024-06-19T05:16:31.173Z","dependency_job_id":"d9fa1c0a-0063-4e75-991b-60f4ab8f5537","html_url":"https://github.com/andymeneely/squib","commit_stats":{"total_commits":1100,"total_committers":22,"mean_commits":50.0,"dds":"0.10181818181818181","last_synced_commit":"ed87b47a1eb035470254a7b5507c32afeefc62a5"},"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"purl":"pkg:github/andymeneely/squib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andymeneely%2Fsquib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andymeneely%2Fsquib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andymeneely%2Fsquib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andymeneely%2Fsquib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andymeneely","download_url":"https://codeload.github.com/andymeneely/squib/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andymeneely%2Fsquib/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265524602,"owners_count":23782009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["board-game","boardgamegeek","card","dsl","game","pngs","prototyping","ruby","squib","sublime-text","svg","tabletop"],"created_at":"2024-08-06T08:02:46.329Z","updated_at":"2025-07-16T16:30:44.153Z","avatar_url":"https://github.com/andymeneely.png","language":"Ruby","readme":"# Squib [![Gem Version](https://badge.fury.io/rb/squib.svg)](https://rubygems.org/gems/squib) [![Build Status](https://secure.travis-ci.org/andymeneely/squib.svg?branch=master)](https://travis-ci.org/andymeneely/squib) [![Build status](https://ci.appveyor.com/api/projects/status/ptjw6fvjh73anlau/branch/master?svg=true)](https://ci.appveyor.com/project/andymeneely/squib/branch/master) [![Coverage Status](https://img.shields.io/coveralls/andymeneely/squib.svg)](https://coveralls.io/r/andymeneely/squib) [![ReadTheDocs](https://readthedocs.org/projects/squib/badge/?version=latest)](http://squib.readthedocs.io/en/latest/?badge=latest) [![BoardGameGeek](https://github.com/andymeneely/squib.rocks/raw/gh-pages/images/microbadge.png)](https://boardgamegeek.com/guild/2601)\n\nSquib is a Ruby [DSL](http://en.wikipedia.org/wiki/Domain-specific_language) 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](http://www.nand.it/nandeck/) done \"the Ruby way\". Squib supports:\n\n* A concise set of rules for laying out your cards\n* Loading PNGs and SVGs\n* Complex text rendering using [Pango](http://www.pango.org/)\n* Reading `xlsx` and `csv` files\n* Rendering to PNGs, PDFs, and SVGs (sheets or individual files)\n* Flexible, data-driven layouts in Yaml\n* Basic shape drawing, blending operators, gradients, etc.\n* Unit conversion\n* The full power of Ruby!\n\nSquib is based on the [Cairo](http://cairographics.org/) graphics rendering engine, the library of choice for WebKit, Gecko, Inkscape and many, many others.\n\nCheck this out.\n\n```ruby\nrequire 'squib'\n\nSquib::Deck.new(cards: 2) do\n  text str: %w(Hello World!)\n  save_png\nend\n```\n\nWe just created a 2-card deck with \"Hello\" on the first card, and \"World\" on the second, and saved them out to PNGs.\n\nWanna see more? Check out the website: http://andymeneely.github.io/squib/\n\n## Installation\n\nSquib requires Ruby 3.0 or later.\n\nInstall it yourself with:\n\n    $ gem install squib\n\nIf you're using Bundler, add this line to your application's Gemfile:\n\n    gem 'squib'\n\nAnd then execute:\n\n    $ bundle\n\nMore info: http://squib.readthedocs.org/en/latest/install.html\n\n\n## Getting Started\n\nAfter installing Squib, you can create a project and run your first build like this:\n\n```sh\n$ squib new my-cool-game\n$ cd my-cool-game\n$ ruby deck.rb\n```\n\nThe `squib new` command will generate files and folders like this:\n\n```\n├── .gitignore\n├── ABOUT.md\n├── Gemfile\n├── IDEAS.md\n├── PLAYTESTING.md\n├── PNP NOTES.md\n├── RULES.md\n├── Rakefile\n├── _output\n│   └── gitkeep.txt\n├── config.yml\n├── deck.rb\n└── layout.yml\n\n12 files\n```\n\n\n# Learning Squib\n\nGo [read the docs!](http://squib.readthedocs.org/)\n\nAlso:\n* The `samples` directory in the [source repository](https://github.com/andymeneely/squib) has lots of examples.\n* [Masters of the Heist](http://mastersoftheheist.com) is my own creation, and it was made with Squib. Go through the repository and watch how it evolved!\n* [Junk Land](https://github.com/andymeneely/junk-land) is my own creation that's uses Squib for full-color rendering, and makes use of Ruby in a lot of interesting ways. The port is still in process.\n* [Project Spider Monkey](https://github.com/andymeneely/project-spider-monkey) is another of my own creations. This one was started from scratch with Squib, but it's still in its early stages.\n\n\n## Staying DRY\n\nSquib tries to keep you DRY (Don't Repeat Yourself) with the following features:\n\n* Custom layouts allow you to specify various arguments in a separate file. This is great for x-y coordinates and alignment properties that would otherwise clutter up perfectly readable code. Squib goes even further and has a special \"extends\" that works especially well for grouped-together styles.\n* Flexible ranges and array handling: the `range` parameter in Squib is very flexible, meaning that one `text` command can specify different text in different fonts, styles, colors, etc. for each card. If you find yourself doing multiple `text` command for the same field across different ranges of cards, there's probably a better way to condense.\n* Custom colors keep you from hardcoding magic color strings everywhere. Custom colors go into `config.yml` file.\n* Plus, you know, Ruby.\n\n\n## Docker\n\nWant to run in a controlled environment? We've got a [Docker image on DockerHub](https://cloud.docker.com/u/andymeneely/repository/docker/andymeneely/squib)\n\nHere's one way to run it. On the command line, go to the root of your repository. With these commands, we'll map the current directory to the `/usr/src/app` directory in the Docker image. When squib-in-docker read \u0026 writes files from there, it'll write it back out to your current directory.\n\nAssuming you have a script called hello.rb:\n\nOn Windows:\n\n```\ndocker run --rm -v \"%cd%\":/usr/src/app andymeneely/squib ruby hello.rb\n```\n\nOn Macs:\n\n```\ndocker run --rm -v \"$PWD\":/usr/src/app andymeneely/squib ruby hello.rb\n```\n\nThis will create a folder called `_output` in your current directory and write the output of the script there.\n\nWe're still working on ways to customize your own Docker build (e.g. document building, custom fonts, etc.) with your own Dockerfile. Pull requests and ideas welcome!\n\n\n# Get Help and Give Help\n\nSee [this page](http://squib.readthedocs.org/en/latest/help.html)\n\n\n# What's up the with the name?\n\nTruthfully, 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:\n\n* Squibs are small explosive devices, much like Squib \"explodes\" your rules into a playable game\n* Squibs are often used in heist movies, leading to a sudden plot twist that often resembles the twists of good tabletop game\n* Squibs are also part of the Harry Potter world - they are people who are non-magical but wizard-born. Squib is aware of wizarding magic and comes from that heritage, but it's not magical itself.\n","funding_links":[],"categories":["Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandymeneely%2Fsquib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandymeneely%2Fsquib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandymeneely%2Fsquib/lists"}