I'm running compress.rb on a WindowsXP machine with ruby installed via
rubyinstaller.  I've created a custom settings.yml file and running
compres.rb and getting the following results, as can be seen, the css
rules are getting completely mucked up by being wrapped in square
brackets and quotes with commas separating them.  Is this an issue
with running ruby under windows? The offendings seem to be in lib
\blueprint\semantic_class_names.rb beween lines 30-55 (appended
below).  But I don't know enough ruby to quickly fix this problem, in
the meantime, I'm manually cleaning up the generated CSS which is a
PITA.

 settings.yml:

  semantic_classes:
    "#author": ".container, .showgrid"
    "#author-profile": "div.span-16, .span-16, .border"
    "#author-photo": "div.span-7, .span-7"
    "#author-meta": "div.span-9, .span-9, .last"
    "#adspace-1": "div.span-8, .span-8, .last"


screen.css:

/* semantic class names */
#author {["width:950px;margin:0 auto;", "background:url(src/
grid.png);", "display:block;"]}
#author-profile {["float:left;margin-right:10px;", "width:630px;"]}
#author-photo {["float:left;margin-right:10px;", "width:270px;"]}
#author-meta {["margin-right:0;padding-right:0;", "float:left;margin-
right:10px;", "margin-right:0;", "width:350px;"]}
#adspace-1 {["margin-right:0;padding-right:0;", "float:left;margin-
right:10px;", "margin-right:0;", "width:310px;"]}


semantic_class_names.rb:


      # iterates through each class assignment ('#footer' => '.span-24
div.span-24', '#header' => '.span-24 div.span-24')
      assignments.each do |semantic_class, blueprint_classes|
        # gathers all BP classes we're going to be mimicing
        blueprint_classes = blueprint_classes.split(/,|\s/).find_all {|
c| !c.blank? }.flatten.map {|c| c.strip }
        classes = []
        # loop through each BP class, grabbing the full hash
(containing tags, index, and CSS rules)
        blueprint_classes.each do |bp_class|
          match = bp_class.include?('.') ? bp_class.gsub(".", ".#
{self.namespace}") : ".#{self.namespace}#{bp_class}"
          classes << blueprint_assignments.find_all {|line| line
[:tags] =~ Regexp.new(/^([\w\.\-\:]+, ?)*#{match}(, ?[\w\.\-\:]+)*
$/) }.uniq
        end

        # clean up the array
        classes = classes.flatten.uniq

        # set the semantic class to the rules gathered in classes,
sorted by index
        # this way, the styles will be applied in the correct order
from top of file to bottom
        output_css[semantic_class] = "#{classes.sort_by {|i| i
[:idx]}.map {|i| i[:rules]}}"
      end

      # return the css in proper format
      css = ""
      output_css.each do |tags, rules|
        css += "#{tags} {#{rules}}\n"
      end
      css

-- 
You received this message because you are subscribed to the Google Groups 
"Blueprint CSS" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/blueprintcss?hl=en.

Reply via email to