def parse(data = nil)
data ||= @raw_data
css_out = []
data.strip_side_space!.strip_space!
data.split('}').each_with_index do |assignments, index|
tags, styles = assignments.split('{').map{|a| a.strip_side_space!}
tags.strip_selector_space!
tags.gsub!(/\./, ".#{namespace}") unless namespace.blank?
rules = []
styles.split(';').each do |key_val_pair|
unless key_val_pair.nil?
property, value = key_val_pair.split(':').map{|kv| kv.strip_side_space!}
break unless property && value
rules << "#{property}:#{value};"
end
end
css_out << {:tags => tags, :rules => rules.to_s, :idx => index} unless tags.blank? || rules.to_s.blank?
end
css_out
end