<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>misc/dan.cssy</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,14 +1,20 @@
 require 'properties'
 require 'tags'
 
-# Markaby-ish way to declare CSS
+# A CSS generator with a Ruby syntax.  You can call her Cssy, for short.
 class Cassandra
   
+  # Clear out unneeded methods
   METHODS = %w( class instance_eval send __send__ __id__ )
   instance_methods.each { |m| undef_method( m ) unless METHODS.include? m }
   
   attr_reader :data
   
+  # Create a new instance of Cssy, optionally with a base selector
+  # 
+  #   css = Cssy.new
+  #   
+  #   header = Cssy.new(&quot;div#header&quot;)
   def initialize(sel=nil)
     @data = []
     @selectors = [ sel ]
@@ -19,10 +25,21 @@ class Cassandra
     @state = :closed_block
   end
   
+  # Create a new instance and process the supplied block, returning the instance.
+  # 
+  #   css = Cssy.process do
+  #     ul do
+  #       li { list_style :none }
+  #     end
+  #   end
   def self.process(*args,&amp;block)
     self.new.process(*args,&amp;block)
   end
   
+  # Process the supplied block (storing the result internally as an array in @data).  
+  # Returns the Cssy instance.
+  # 
+  # If no block is given, join all arguments with &quot;\n&quot; and eval the result.  Dubious utility.
   def process(*args, &amp;block)
     if block
       instance_eval(&amp;block)
@@ -32,42 +49,51 @@ class Cassandra
     self
   end
   
+  # Output CSS as a string
   def to_s
     @data.map do |sel|
       properties = sel.last.join(&quot;\n  &quot;)
       &quot;#{sel.first} {\n  #{properties}\n}\n&quot;
     end.join
   end
-
-
-
-  # Pushes an empty array on the properties stack and registers
-  # that array (against the current selector) in @data
-  def new_property_set
-    @properties.push []
-    @data &lt;&lt; [@selectors[-1], @properties[-1] ]
-  end
-
-
+  
   # Declare a CSS selector using a block.  May be chained and nested.
+  # 
+  #   selector &quot;a:visited&quot; do
+  #     color :gray
+  #   end
   def selector(sel)
     if block_given?
-      open_block(sel)
+      open(sel)
       yield
-      closed_block
+      close
     else
       chain(sel)
     end
     self
   end
   
-  # Catch unknown methods and treat them as CSS class or id selectors.
+  alias :s :selector
+  
+  # Add a property declaration for the current selector.
+  # 
+  #   property &quot;margin-bottom&quot;, &quot;42px&quot; 
+  #
+  def property(css_attr, *args)
+    @properties[-1] &lt;&lt; &quot;#{css_attr}: #{args.join(' ')};&quot;
+  end
+
+  # Catch unknown methods and treat them as CSS class or id selectors.  This may
+  # go away in future releases.
+  # 
+  #   monkey { padding &quot;24px&quot; }
+  # 
   def method_missing(name, &amp;block)
     sel = selectify(name)
     if block_given?
-      open_block(sel)
+      open(sel)
       yield
-      closed_block
+      close
     else
       chain(sel)
     end
@@ -80,6 +106,7 @@ class Cassandra
     matches ? &quot;##{matches[1]}&quot; : &quot;.#{method_name}&quot;
   end
 
+  private
 
   # define tag methods that delegate to selector
   methods =  HTML_TAGS.map do |tag|
@@ -96,18 +123,20 @@ class Cassandra
       css_attr = method_name.gsub('_', '-')
       property(css_attr, args)
     end
-  end
-
-  # Add a property declaration string to the current selector's properties array.
-  def property(css_attr, *args)
-    @properties[-1] &lt;&lt; &quot;#{css_attr}: #{args.join(' ')};&quot;
+  end  
+  
+  # Pushes an empty array on the properties stack and registers
+  # that array (against the current selector) in @data
+  def new_property_set
+    @properties.push []
+    @data &lt;&lt; [@selectors[-1], @properties[-1] ]
   end
   
   ##  State transitions
   
   # Push the accumulated selector and a new property array onto the
   # tops of their respected stacks
-  def open_block(new_selector)
+  def open(new_selector)
     case @state
     when :closed_block, :open_block
       combined_selector = [@selectors[-1], new_selector].compact.join(&quot; &quot;)
@@ -117,7 +146,7 @@ class Cassandra
       @selectors[-1] = &quot;#{@selectors[-1]}#{new_selector}&quot;
       new_property_set
     else
-      raise &quot;You can't get to :open_block from #{@state.inspect}&quot;
+      raise &quot;#open not available when state is #{@state.inspect}&quot;
     end
     
     @state = :open_block
@@ -128,11 +157,11 @@ class Cassandra
     case @state
     when :closed_block, :open_block
       combined_selector = [@selectors[-1], new_selector].compact.join(&quot; &quot;)
-      @selectors.push( combined_selector)
+      @selectors.push combined_selector
     when :chain
       @selectors[-1] = &quot;#{@selectors[-1]}#{new_selector}&quot;
     else
-      raise &quot;You can't get to :chain from #{@state.inspect}&quot;
+      raise &quot;#chain not available when state is #{@state.inspect}&quot;
     end
     
     @state = :chain
@@ -140,21 +169,17 @@ class Cassandra
 
   # Pop the selector string and property array for the closing block
   # off of their respective stacks
-  def closed_block
+  def close
     case @state
     when :open_block, :closed_block
       @selectors.pop
       @properties.pop
     else
-      raise &quot;You can't get to :closed_block from #{@state.inspect}&quot;
+      raise &quot;#close not available when state is #{@state.inspect}&quot;
     end
     
     @state = :closed_block
   end
-
-
-  
-  
 end
 
 Cssy = Cassy = Cassandra</diff>
      <filename>lib/cassandra.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,13 @@
+@default = &quot;#212F54&quot;
+
 body { background_color &quot;#F8F7F1&quot;}
 div.content! { 
   width &quot;700px&quot;; margin &quot;25px auto&quot;
   
+  h1 { color @default }
+  
   a { 
-    color &quot;#212F54&quot;;
+    color @default;
     text_decoration :none
     font_weight :bold
   }</diff>
      <filename>site/basic.cssy</filename>
    </modified>
    <modified>
      <diff>@@ -1,12 +1,15 @@
-@css = Cssy.new
-@css.process do
+x = Cssy.new.process do
+
+  @default = &quot;#212F54&quot;
 
   body { background_color &quot;#F8F7F1&quot;}
   div.content! { 
     width &quot;700px&quot;; margin &quot;25px auto&quot;
 
+    h1 { color @default }
+
     a { 
-      color &quot;#212F54&quot;;
+      color @default;
       text_decoration :none
       font_weight :bold
     }
@@ -16,4 +19,4 @@
   
 end
 
-@css.to_s
\ No newline at end of file
+puts x.data.inspect
\ No newline at end of file</diff>
      <filename>site/basic.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,7 @@ convertor = Syntax::Convertors::HTML.for_syntax &quot;ruby&quot;
 
 html do 
   head do
-    title &quot;Cassandra: A CSS generator with a pure-Ruby syntax&quot;
+    title &quot;Cassandra: A CSS generator with a Ruby syntax&quot;
     link :rel =&gt; 'stylesheet', :type =&gt; 'text/css', :href =&gt; &quot;basic.css&quot;
     link :rel =&gt; 'stylesheet', :type =&gt; 'text/css', :href =&gt; &quot;ruby.css&quot;
   end
@@ -14,6 +14,7 @@ html do
         convertor.convert( File.read( &quot;site/basic.rb&quot; ) ).to_s
       end
       ul.links! do
+        li { a &quot;GitHub&quot;, :href =&gt; &quot;http://github.com/automatthew/cassandra&quot; }
         li { a &quot;RDocs&quot;, :href =&gt; &quot;/rdoc&quot; }
         li { a &quot;Developer&quot;, :href =&gt; &quot;http://www.automatthew.com&quot; }
       end</diff>
      <filename>site/index.mab</filename>
    </modified>
    <modified>
      <diff>@@ -4,7 +4,7 @@ div do
   # this is a property on div
   background :red
   
-  selector('ul li') do
+  s('ul li') do
     color('green')
   end
   
@@ -12,7 +12,7 @@ div do
     color('aqua')
   end
   
-  selector('.smurf').house do
+  s('.smurf').house do
     height('256px')
   end
   
@@ -29,6 +29,6 @@ gargamel do
   margin(&quot;0px&quot;)
 end
 
-selector('.outer.middle.inner') do
+s('.outer.middle.inner') do
   top(&quot;34px&quot;)
 end
\ No newline at end of file</diff>
      <filename>test/fiddle.cssy</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>test/dan.cssy</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>56f8573a09e24a3ad33111655bdb3dfb6e110811</id>
    </parent>
  </parents>
  <author>
    <name>Matthew King</name>
    <email>automatthew@gmail.com</email>
  </author>
  <url>http://github.com/automatthew/cassandra/commit/ef264a2d9c58e89bdfc8b771d819c0d1ad3871c9</url>
  <id>ef264a2d9c58e89bdfc8b771d819c0d1ad3871c9</id>
  <committed-date>2008-09-16T07:41:08-07:00</committed-date>
  <authored-date>2008-09-16T07:41:08-07:00</authored-date>
  <message>docs and cleanup</message>
  <tree>9ac820a9f4dca9bcbf24ef865b1acf67ba99b5ab</tree>
  <committer>
    <name>Matthew King</name>
    <email>automatthew@gmail.com</email>
  </committer>
</commit>
