# File lib/blueprint/css_parser.rb, line 26
    def parse(data = nil)
      data ||= @raw_data
    
      # wrapper array holding hashes of css tags/rules
      css_out = []
      # clear initial spaces
      data.strip_side_space!.strip_space!
    
      # split on end of assignments
      data.split('}').each_with_index do |assignments, index|
        # split again to separate tags from rules
        tags, styles = assignments.split('{').map{|a| a.strip_side_space!}
      
        # clean up tags and apply namespaces as needed
        tags.strip_selector_space!
        tags.gsub!(/\./, ".#{namespace}") unless namespace.blank?
      
        # split on semicolon to iterate through each rule
        rules = []
        styles.split(';').each do |key_val_pair|
          unless key_val_pair.nil?
            # split by property/val and append to rules array with correct declaration
            property, value = key_val_pair.split(':').map{|kv| kv.strip_side_space!}
            break unless property && value
            rules << "#{property}:#{value};"
          end
        end
        # now keeps track of index as hashes don't keep track of position (which will be fixed in Ruby 1.9)
        css_out << {:tags => tags, :rules => rules.to_s, :idx => index} unless tags.blank? || rules.to_s.blank?
      end
      css_out
    end