<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/saucy/helper.rb</filename>
    </added>
    <added>
      <filename>lib/saucy/image.rb</filename>
    </added>
    <added>
      <filename>lib/saucy/render.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -3,88 +3,198 @@ Saucy
 
 Dynamic Text Rendering Plugin for Rails. Like sIFR but without the hassle/flash/javascript.
 
-* Automatic cacheing
+* Automatic caching
 * SEO friendly
 * render any TTF font
-* Shadows, outlines, rotation.
 
+Examples
+--------
+
+  &lt;%= saucy_tag(&quot;Hi there&quot;) %&gt;
+  &lt;%= saucy_tag(&quot;I am red&quot;, :style =&gt; {:font =&gt; {:color =&gt; 'red' }}) %&gt;
+  &lt;%= saucy_tag(&quot;I am a red/blue sprite&quot;, 
+                  :style =&gt; {:font =&gt; {:color =&gt; 'red'}}, 
+                  :hover =&gt; {:font =&gt; {:color =&gt; 'blue'}}
+                ) %&gt;
+  
 Use
 ---
 
 In a view:
 
-&lt;%= saucy_tag tag, text, style, options  %&gt;
+  &lt;%= saucy_tag(text, options) %&gt;
 
-* tag: the type of tag to output, eg. &quot;h1&quot;
 * text: your own text. Note it can contain newlines which will be interpreted as multiline text.
-* style: a style hash
 * options: html attributes to be inserted
 
+
+Available options
+-----------------
+
+# Style needs to be a hash - see the 'Styles' heading below
+{:style =&gt; {}}
+
+# Hover option is for sprites, the styles passed in override
+# the styles that were passed in for :style.
+{:hover =&gt; {}}
+
+# The html style needs to be a hash
+# The html class needs to be a array of classNames
+{:html =&gt; {:style =&gt; {}, :class =&gt; []}}
+
+# Tag needs to be symbol (default is :a)
+{:tag =&gt; :p}
+
+# Transparent needs to be a boolean - 
+# this defaults to false 
+{:transparent =&gt; true}
+
 Styles
 ------
 
 The style has has several options and the default style is: 
 
-    DEFAULT_STYLE = { 
-      :background =&gt; &quot;transparent&quot;,
-      :font =&gt; {:size=&gt;18, :color =&gt; &quot;#000&quot;, :font =&gt; &quot;arial&quot;, :stretch =&gt; &quot;normal&quot;},
-      :stroke =&gt; {:width =&gt; 0, :color =&gt; &quot;#000&quot;, :inner =&gt; true },
-      :shadow =&gt; {:color =&gt; &quot;#000&quot;, :opacity =&gt; 0.6, :top =&gt; 2, :left =&gt; 2, :blur =&gt; 5.0, :render =&gt; false },
-      :rotate =&gt; 0,
-      :spacing =&gt; {:letter =&gt; 0, :word =&gt; 0}
+  { 
+    :background =&gt; &quot;transparent&quot;,
+    :font       =&gt; {
+      :size     =&gt; 18, 
+      :color    =&gt; &quot;#000&quot;, 
+      :font     =&gt; &quot;arial&quot;, 
+      :stretch  =&gt; &quot;normal&quot;
+    },
+    :stroke =&gt; {
+      :width    =&gt; 0, 
+      :color    =&gt; &quot;#000&quot;, 
+      :inner    =&gt; true 
+    },
+    :spacing    =&gt; {
+      :letter   =&gt; 0, 
+      :word     =&gt; 0
+    },
+    :rotate =&gt; 0,
+    :shadow =&gt; {
+      :color =&gt; &quot;#000&quot;, 
+      :opacity =&gt; 0.6, 
+      :top =&gt; 2, 
+      :left =&gt; 2, 
+      :blur =&gt; 5.0, 
+      :render =&gt; false 
     }
+  }
 
 The style that's passed in will be merged over the top of this. 
 
 Internet Explorer
 -----
 
-If the background is transparent, Saucy will automatically output a tag with CSS that IE will interpret and use it's AlphaFilter properly.
-
-* Bonus: you can output any pngs as transparent with the following helper, no javascript needed! :
-
-&lt;%= transparent_png(filename) %&gt;
+Saucy will apply an AlphaFilter if you pass in the transparent option as true.
 
+ :transparent =&gt; true
 
 Fonts
 -----
 
 Fonts are loaded from the /plugins/saucy/fonts directory.
 
+Sprites
+-------
+
+If you're using sprites you need to have the following styles:
+
+  &lt;style type=&quot;text/css&quot; media=&quot;screen&quot;&gt;
+    .saucySprite:hover {
+      background-position: 0 0 !important;
+    }
+  &lt;/style&gt;
+
+If you're using tags other than the 'a' tag you'll need to apply this hover pseudo-class with JavaScript,
+as IE 6 only support the hover pseudo-class for 'a' tags.
+
+You need to pass in a :hover option which is in the same format as the :style option.
+The :hover option overrides the :style option (you don't need to pass in all the styles again).
 
 Try out
 -------
 
 * In your controller
 
-&lt;pre&gt;
-def saucy
-    @stroked = { :stroke =&gt; { :color =&gt; &quot;red&quot;, :width =&gt; 1 }, :font =&gt; { :size =&gt; 100, :color =&gt; &quot;#fff&quot; }, :spacing =&gt; {:letter =&gt; 100 }  }
-    @thick_stroked = { :stroke =&gt; { :color =&gt; &quot;red&quot;, :width =&gt; 20, :inner =&gt; 1 }, :font =&gt; { :size =&gt; 100, :color =&gt; &quot;#fff&quot; }  }
-    @bauhaus = { :font =&gt; { :size =&gt; 100, :font =&gt; &quot;bauhausl.ttf&quot;  }  }
-    @shadow = { :background =&gt; &quot;transparent&quot;, :font =&gt; { :size =&gt; 100, :font =&gt; &quot;basket.ttf&quot;, :color =&gt; &quot;#fff&quot; }, :shadow =&gt; { :render =&gt; true, :top =&gt; 5, :left =&gt; 5 }  }
-    @rotate = { :rotate =&gt; -15, :font =&gt; { :size =&gt; 100, :font =&gt; &quot;bauhausl.ttf&quot;, :color =&gt; &quot;red&quot;, :stretch =&gt; &quot;condensed&quot; } }
-end
-&lt;/pre&gt;
-
+  def saucy
+    @stroked = { 
+      :rotate =&gt; -10, 
+      :stroke =&gt; { 
+        :color =&gt; &quot;red&quot;, 
+        :width =&gt; 1 
+      }, 
+      :font =&gt; { 
+        :size =&gt; 100, 
+        :color =&gt; &quot;#fff&quot; 
+      }, 
+      :spacing =&gt; {
+        :letter =&gt; 100 
+      }  
+    }
+  
+    @thick_stroked = { 
+      :stroke =&gt; { 
+        :color =&gt; &quot;red&quot;, 
+        :width =&gt; 20, 
+        :inner =&gt; 1 
+      }, 
+      :font =&gt; { 
+        :size =&gt; 100, 
+        :color =&gt; &quot;#fff&quot; 
+        }, 
+      :rotate =&gt; 10, 
+      :shadow =&gt; { 
+        :render =&gt; true, 
+        :top =&gt; 5, 
+        :left =&gt; 5 
+        }   
+      }
+  
+    @bauhaus = { 
+      :font =&gt; { 
+        :size =&gt; 100, 
+        :font =&gt; &quot;bauhausl.ttf&quot;  
+        }  
+      }
+  end
+  
 * In saucy.html.erb
 
-&lt;pre&gt;
-  &lt;style&gt;
-    body {background: url(http://www.parkerfox.co.uk/images/bg.png) }
-  &lt;/style&gt;
-  &lt;%= saucy_tag &quot;p&quot;, &quot;default - no style&quot;, {} %&gt;
-  &lt;%= saucy_tag &quot;p&quot;, &quot;mutli\nline\nbauhaus&quot;, @bauhaus  %&gt;
-  &lt;%= saucy_tag &quot;p&quot;, &quot;stroked!!&quot;, @stroked, {:class=&gt;&quot;myclass&quot;} %&gt;
-  &lt;%= saucy_tag &quot;p&quot;, &quot;stroked!!&quot;, @thick_stroked, {:class=&gt;&quot;myclass&quot;} %&gt;
-  &lt;p&gt;Lorem ispsum&lt;/p&gt;
-
-  &lt;%= saucy_tag &quot;h2&quot;, &quot;h2 tag&quot;, @bauhaus, {:id=&gt;&quot;myid&quot;} %&gt;
-  &lt;p&gt;Lorem ispsum&lt;/p&gt;
-  &lt;%= saucy_tag &quot;p&quot;, &quot;lets rotate!&quot;, @rotate %&gt;
-  &lt;%= saucy_tag &quot;p&quot;, &quot;shadow&quot;, @shadow %&gt;
-
-  &lt;a href='/'&gt;
-    &lt;%= saucy_tag &quot;p&quot;, &quot;rotate the lettters&quot;, {:font =&gt; { :rotate =&gt; -90, :size =&gt; 40}, :rotate =&gt; 90 } %&gt;
-  &lt;/a&gt;
-&lt;/pre&gt;
+  &lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;
+    &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
+  &lt;html&gt;
+    &lt;head&gt;
+      &lt;title&gt;Saucy&lt;/title&gt;
+      &lt;%= javascript_include_tag :defaults %&gt;
+      &lt;style type=&quot;text/css&quot;&gt;
+        .saucySprite:hover {
+          background-position: 0 0 !important;
+        }
+      &lt;/style&gt;
+    &lt;/head&gt;
+    &lt;body&gt;
+      &lt;%= saucy_tag &quot;default - no style&quot; %&gt;
+      &lt;%= saucy_tag &quot;mutli\nline\nbauhaus&quot;, :style =&gt; @bauhaus  %&gt;
+      &lt;%= saucy_tag &quot;stroked!!&quot;, :style =&gt; @stroked, :html =&gt; {:class=&gt; [&quot;myclass&quot;]} %&gt;
+      &lt;%= saucy_tag &quot;thick stroked!!&quot;, :style =&gt; @thick_stroked, :html =&gt; {:class =&gt; [&quot;myclass2&quot;]} %&gt;
+
+      &lt;p&gt;Different tag&lt;/p&gt;
+
+      &lt;%= saucy_tag &quot;h2 tag&quot;, :style =&gt; @bauhaus, :tag =&gt; :h2, :html =&gt; {:id =&gt; &quot;myid&quot;} %&gt;
+
+      &lt;p&gt;Sprites&lt;/p&gt;
+
+      &lt;%= saucy_tag(&quot;I am a red/blue sprite&quot;, 
+                      :style =&gt; {:font =&gt; {:color =&gt; 'red'}}, 
+                      :hover =&gt; {:font =&gt; {:color =&gt; 'blue'}}
+                    ) %&gt;
+
+      &lt;%= saucy_tag(&quot;thick stroked sprite!!&quot;, 
+                      :style =&gt; @thick_stroked, 
+                      :hover =&gt; {:font =&gt; {:color =&gt; 'blue'}},
+                      :html =&gt; {:class =&gt; [&quot;myclass2&quot;]}
+                    ) %&gt;
+    &lt;/body&gt;
+  &lt;/html&gt;
\ No newline at end of file</diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,2 @@
 require &quot;saucy&quot;
-ActionView::Base.send(:include, Saucy::SaucyHelper)
-
-Saucy.cache_image_sizes
-
+ActionView::Base.send(:include, Saucy::Helper)
\ No newline at end of file</diff>
      <filename>init.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,29 +1,6 @@
+require &quot;RMagick&quot; 
 
 module Saucy
-  OUTPUT_DIR = &quot;/saucy&quot;
-  ABS_OUTPUT_DIR = &quot;#{RAILS_ROOT}/public/#{OUTPUT_DIR}&quot;      
-  
-  def self.png_dimensions file
-    IO.read(file)[0x10..0x18].unpack('NN')
-  end
-
-  def self.get_png_size filename
-    size = Rails.cache.read(&quot;Saucy:&quot; + filename)
-      
-    if(!size)
-      size = Saucy.png_dimensions(&quot;#{RAILS_ROOT}/public&quot; + filename)
-      Rails.cache.write(&quot;Saucy:&quot; + filename, size)
-    end
-    size
-  end
-
-  def self.cache_image_sizes 
-    Dir.entries(ABS_OUTPUT_DIR).select {|f| f.match(/.png$/)}.each do |image|
-       get_png_size(&quot;#{OUTPUT_DIR}/#{image}&quot;)
-    end
-  end
-end
-
-require &quot;saucy_render&quot;
-require &quot;saucy_helper&quot;
-
+  OUTPUT_DIR      = &quot;/saucy&quot;
+  ABS_OUTPUT_DIR  = File.join(Rails.public_path, OUTPUT_DIR)
+end
\ No newline at end of file</diff>
      <filename>lib/saucy.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>install.rb</filename>
    </removed>
    <removed>
      <filename>lib/saucy_helper.rb</filename>
    </removed>
    <removed>
      <filename>lib/saucy_render.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>27300eaa879eba10078b26036fcf56a7283e68cd</id>
    </parent>
  </parents>
  <author>
    <name>weepy</name>
    <email>jonahfox@gmail.com</email>
  </author>
  <url>http://github.com/weepy/saucy/commit/0977826a81f3e8e3abf2cc5316f9885365a882bd</url>
  <id>0977826a81f3e8e3abf2cc5316f9885365a882bd</id>
  <committed-date>2008-12-04T10:15:11-08:00</committed-date>
  <authored-date>2008-12-04T10:15:11-08:00</authored-date>
  <message>merged maccman's changes. also added shadow and rotation support</message>
  <tree>4f43a64249d003890df729cc2fe8286cc1dcdb1d</tree>
  <committer>
    <name>weepy</name>
    <email>jonahfox@gmail.com</email>
  </committer>
</commit>
