Go to file
Andy Meneely f6480445df Stabilizing the code after the options switch. Getting there... 2014-07-28 17:08:57 -04:00
bin Putting together a basic squib new command 2014-07-20 00:17:05 -04:00
lib Stabilizing the code after the options switch. Getting there... 2014-07-28 17:08:57 -04:00
samples Stabilizing the code after the options switch. Getting there... 2014-07-28 17:08:57 -04:00
spec Stabilizing the code after the options switch. Getting there... 2014-07-28 17:08:57 -04:00
.gitignore Spec for the new command 2014-07-25 13:04:53 -04:00
.travis.yml Getting travis to use new bundler 2014-07-19 08:31:30 -04:00
.yardopts Starting work on the new options 2014-07-25 13:10:04 -04:00
API.md Starting work on the new options 2014-07-25 13:10:04 -04:00
Gemfile Re-generating gem with bundler 2014-07-08 01:21:21 -04:00
LICENSE.txt Re-generating gem with bundler 2014-07-08 01:21:21 -04:00
README.md Starting work on the new options 2014-07-25 13:10:04 -04:00
Rakefile Rake installs THEN specs 2014-07-25 10:59:48 -04:00
squib.gemspec Adding in coveralls CI 2014-07-24 16:28:28 -04:00

README.md

Squib Gem Version Build Status Dependency Status Coverage Status Inline docs

Squib is a Ruby DSL for prototyping card and board games. Think of it like nanDeck done "the Ruby way". Squib supports:

  • Complex text rendering using Pango
  • Reading PNGs and SVGs using Cairo
  • Reading .xlsx files
  • Basic shape drawing
  • Rendering to PNGs and PDFs
  • Plus the full power of Ruby!

Check this out.

require 'squib'

Squib::Deck.new do
  text str: 'Hello, World!'  
  save_png
end

That script just created 3 PNG images at 825x1125 with the string "Hello, World" in the upper-left corner.

Installation

Install it yourself with:

$ gem install squib

If you're using Bundler, add this line to your application's Gemfile:

gem 'squib'

And then execute:

$ bundle

Note: Squib has some native dependencies, such as Cairo, Pango, and Nokogiri, which all require DevKit to compile C code. This is usually not painful, but can cause headaches on some setups. For Windows users, I strongly recommend using the non-64 bit RubyInstaller at http://rubyinstaller.org. For Mac, I recommend using rvm. Squib requires Ruby 2.0 or later.

Getting Started

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

The squib new command will generate files and folders like this:

_output
  gitkeep.txt
.gitignore
ABOUT.md
config.yml
deck.rb
Gemfile
layout.yml
PNP NOTES.md

The central file here is deck.rb. Here's a basic example of a deck to work from:

{include:file:samples/basic.rb}

Learning Squib's API

  • The samples directory in the source repository has lots of examples
  • The document called API.md walks through the various methods and options that apply to the entire Squib API
  • API Documentation is also kept up-to-date.

Development

Squib is currently in pre-release alpha, so the API is still maturing. If you are using Squib, however, I'd love to hear about it! Feel free to file a bug or feature request.

Contributing

Squib is an open source tool, and I would love participation. If you want your code integrated:

  1. Fork it ( https://github.com/[my-github-username]/squib/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request