easylittleprinter

easylittleprinter is a static image server for the BERG Cloud Little Printer. Image editions, icons, samples, and meta.json should be stored in the root directory of a remote static server. NOT this server.

Incidentally, Github Pages works fantastically as a remote static server.

You could probably set it up so that you don’t have to use a remote server, but that ain’t no fun.

You can either run this guy locally, or on heroku.

Installation

“gem install easylittleprinter”

Image naming format

The image editions should be named in the following format:

yyyy-mm-dd

The file extension is specified in the configuration file

Required Environmental Variables

EXTENSION , the file extension for all of your images. Pick one. The icon will always be .png HOSTURL , the address of your static image host, e.g. yourname.github.com . NO TRAILING SLASH! TITLE , the title of the pages with images on them. Purely cosmetic. SAMPLE , the filename of the sample image, no slashes, no extensions ICON , the filename of the icon image, no slashes, no extensions. Must be a png.

You can configure the application to publish on certain days. Non-temporally-bound publications are not supported at this time. You can totally mod my code if you want, though.

The following are the options for the FREQUENCY variable:

every_monday, every_tuesday, every_wednesday, every_thursday, every_friday, every_saturday, every_sunday, everyday, every_mwf

NOTE!!! Once the user passes the check to make sure the date they’re accessing from is within your publishing specs, the server will then attempt to serve an image with a corresponding filename, e.g. 2012-08-30.png See above for more information.

Deploying to Heroku

Create a config.ru file containing:

require ‘easylittleprinter’

run easylittleprinter

This part of the process can also be used for deploying to a physical server.

You’ll also need a Gemfile:

source :rubygems

gem “easylittleprinter”, “>=0.2.1”

gem “camping”

gem “markaby”

Initialize a git repo in the folder where your files are, add them, commit

Then run “heroku create app anme here, minus brackets”

Then run “git push heroku master”

Next, set your environment variables with “heroku config:add the vars here

You’re done!

Contributing to easylittleprinter

  • Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet.

  • Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it.

  • Fork the project.

  • Start a feature/bugfix branch.

  • Commit and push until you are happy with your contribution.

  • Make sure to add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

Copyright © 2012 Simon Orr. See LICENSE.txt for further details.