/ Published in: Other

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
# compiles all the css files into one huge string # this is useful when running with less # USAGE : all_css.open # => opens the string in less allowing you to search def all_css css_files = Dir.glob File.join(RAILS_ROOT, "public/stylesheets/","*.css") css_content = "" css_files.each {|file| css_content << IO.read(file)} css_content.instance_eval do # opens with less command def open system('echo "' << self << '"|less') end end css_content end
Comments
