Sha256: 95fdb0591f3dca7d70d5b5680d4fddcf2994e0ad422d6adcc0fcaf12c9c72595
Contents?: true
Size: 1.69 KB
Versions: 3
Compression:
Stored size: 1.69 KB
Contents
= SWF Ditty (swiff ditty) A simple and flexible Sinatra helper for embedding SWFs in your views. Requires {jQuery}[http://jquery.com/] and {jQuery SWFObject}[http://jquery.thewikies.com/swfobject/]. == Installation Install {gemcutter}[http://gemcutter.org] 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}[http://haml-lang.com/] and my {ratpack}[http://github.com/zeke/ratpack] helpers gem (for the `javascript_include_tag` method): %html %head =javascript_include_tag %w(jquery-1.3.2.min jquery.swfobject.1-0-7.min) %body = swf 'my_swf.swf' = swf 'subdirectory/of/public/another.swf', :width => 500, :height => 300 = swf 'http://example.com/yet_another.swf', :wmode => 'opaque' Passing in FlashVars is easy: = swf 'swf/foo.swf', :flashvars => {:foo => 'chacha', :bar => 250} By default, a DOM element is automatically created based on a variation of the swf filename, but you can override it like so: = swf 'swf/foo.swf', :dom_id => 'custom_dom_dom_doobie', :create_dom_container => false See full auto-generated documentation at {rdoc.info/projects/zeke/swf_ditty}[http://rdoc.info/projects/zeke/swf_ditty] == Colophon * Thanks to the Sinatra page on {Writing Extensions}[http://www.sinatrarb.com/extensions.html] * Tests modified from {wbzyl/sinatra-static-assets}[http://github.com/wbzyl/sinatra-static-assets] * Gem built with {Jeweler}[http://github.com/technicalpickles/jeweler] == Copyright Copyright (c) 2009 Zeke Sikelianos. See LICENSE for details.
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
swf_ditty-0.0.5 | README.rdoc |
swf_ditty-0.0.4 | README.rdoc |
swf_ditty-0.0.3 | README.rdoc |