-
Notifications
You must be signed in to change notification settings - Fork 69
Part 0: Ruby Basics
(This page is just a sketch of what is to come. Feel free to contribute if you like.)
I'm not a programmer, but I want to use Squib. Can you make it easy for non-programmers?
If you want to use Squib, then you want to automate the graphics generation of a tabletop game in a data-driven way. You want to be able to change your mind about icons, illustrations, stats, and graphic design - then rebuild your game with a few edits. You want to give a list of instructions to a computer, and have it execute your bidding.
If you want those things, then I have news for you. I think you are a programmer. And maybe Squib will be your excuse to finally learn how to do some coding.
Squib is a Ruby library. To learn Squib, you will need to learn Ruby. There is no getting around that fact. Don't fight it, embrace it.
Fortunately, Squib doesn't really require tons of Ruby-fu to get going. And I've done my best to keep to Ruby's own philosophy that programming in it should be a delight, not a chore.
Doubly fortunately, Ruby is wonderfully rich in features and very expressive in its syntax. Ruby has a vibrant, friendly community (much like tabletop game designers!). Ruby is the language of choice for many new programmers, including many universities. On the flip side, Ruby is "industrial strength", so it really can do just about anything you need it to. Plus, resources for learning how code is ubiquitous on the Internet.
In this article, we'll go over some topics that you will undoubtedly want to pick up if you're new to programming or just new to Ruby.
Let's get a few things out of the way. When you are out there searching the interwebs for solutions to your problems, you will not need to learn anything about the following things:
- Rails. Ruby on Rails is a heavyweight framework for web development (awesome in its own way, but not relevant to learning Ruby). Squib is about scripting, and will never be a web app.
- Object-Oriented Programming. While OO is very important for developing long-term, scalable applications, some of the philosophy around "Everything in Ruby is an object" can be confusing to newcomers. It's not super-important to grasp this concept for Squib. This means material about classes, modules, mixins, attributes, etc. are not really necessary for Squib scripts. (Contributing to Squib, that's another matter.)
- Metaprogramming. Such a cool thing in Ruby... don't worry about it for Squib.
- Understand scripting
- What
doandendmean - Ruby Arrays, so that the range parameter makes more sense
- Strings, variables, and symbols
- If you are using Excel or CSV, then Ruby hashes are worth a glance.
- Editing Yaml. Yaml is not Ruby per se, but it's a data format common in the Ruby community and Squib uses it in a couple of places (e.g. layouts and the configuration file)
- Command line basics
- Edit-Run-Check. (i.e. working iteratively). making small edits and run your code frequently (every few minutes)
- Getting a good text editor
CodeSchool's TryRuby. This is one of my favorites. It's pretty basic but it walks you through the exercises interactively and through challenges.
RubyMonk.com. An interactive explanation through Ruby. Gets a bit philosophical, but hey, what else would you expect from a monk??
Ruby's Own Website: Getting Started
This will take you through the basics of programming in Ruby. It works mostly from the Interactive Ruby shell irb, which is pretty helpful for seeing how things work and what Ruby syntax looks like.
Why's Poignant Guide to Ruby No list of Ruby resources is complete without a reference to this, well, poignant guide to Ruby.
Install: Windows OSX Linux Cygwin
Getting Started
Important
Advanced Squibbing
- The Mighty text Method
- Layouts
- Manipulating PNGs
- Manipulating SVGs
- Vector back end
- Rendering both BW and Color
- Colors
- Configuration Options
Real Project Histories
Squiblets
- Category specific template text
- Combining Multiple Columns
- One Icon Per Location
- One Location, Multiple Icons
- Google Sheets
- Rake Rendering Modes
- Autoscale Fonts
- Marketing Materials
- Autobuild with Guardfiles
- Wireframing with an SVG Editor
- Front to Back Printing
- Versioning Practices
- Icon Library: FontAwesome
- Icon Library: GameIcons
- Combining Multiple Columns
- Combine Multiple CSV Files
- Switch card background or invert theme
Tools
Contributing