SWF Ditty (swiff ditty)

A simple and flexible Sinatra helper for embedding SWFs in your views. Requires jQuery and jQuery SWFObject.

Installation

Install gemcutter if you haven’t already:

sudo gem install gemcutter
gem tumble

Install the ratpack gem:

sudo gem install swf_ditty

Drop this line in your app:

gem 'swf_ditty'
require 'sinatra/swf_ditty'

Usage

The following example assumes you’re using haml and my ratpack helpers.

%html
  %head
    =javascript_include_tag %w(jquery-1.3.2.min.js jquery.swfobject.1-0-7.min)
  %body
    = swf 'my_swf.swf'
    = swf 'subdirectory/of/public/another.swf', :width => 500, :height => 300, :flashvars => {:foo => 'chacha', :bar => 250}
    = swf 'http://example.com/yet_another.swf', :wmode => 'opaque'

See full auto-generated documentation at rdoc.info/projects/zeke/swf_ditty

Colophon

Copyright © 2009 Zeke Sikelianos. See LICENSE for details.