Friday, September 10, 2010

BlankStatic Version 1 released with "Bundled" Gems, Onward to Version 2

My template for creating static sites and prototyping templates for web applications and Radiant CMS templates, BlankStatic, has reached a version 1 release. Admittedly BlankStatic hasn't seen much love lately, and I wanted to upgrade the versions of Haml, Sass and Compass it's using. However, this posed a problem for working with older sites using the current version. Enter Bundler.

Bundler allowed me to specify what Ruby Gems my tagged version of the template required in the Gemfile.

# Gemfile
source "http://rubygems.org"

gem "haml", "2.2.0"
gem "compass", "0.8.16"
gem "staticmatic", "0.10.1"

Perfect. A bundle install installed the gems I needed and create the Gemfile.lock that includes specific dependencies and I checked those both into git.

# Gemfile.lock
GEM
  specs:
    cgi_multipart_eof_fix (2.5.0)
    compass (0.8.16)
      haml (>= 2.2.0)
    daemons (1.1.0)
    fastthread (1.0.7)
    gem_plugin (0.2.3)
    haml (2.2.0)
    mongrel (1.1.5)
      cgi_multipart_eof_fix (>= 2.4)
      daemons (>= 1.0.3)
      fastthread (>= 1.0.1)
      gem_plugin (>= 0.2.3)
    staticmatic (0.10.1)
      haml (>= 2.0)
      mongrel (>= 1.0)

PLATFORMS
  ruby

DEPENDENCIES
  compass (= 0.8.16)
  haml (= 2.2.0)
  staticmatic (= 0.10.1)

However, I still had issues with the bin executables when running the server. For example, /usr/loca/bin/staticmatic points to the newer version of the StaticMatic gem, while I need to use an older version. No problem, bundle those executables using bundle exec. Now I can execute the bin/staticmatic preview . in the root of my static site. Super cool.

Now that I have a "freezed" version, I will start working on version 2. This will include an upgrade to the latest dependent gems and changes to the Sass templates to make them compatible with the new syntax.