Sha256: 75e609f3313c6faf666f8dc48d88cd1d646f189a3db410d34ba5c93bd23d13d1
Contents?: true
Size: 937 Bytes
Versions: 1
Compression:
Stored size: 937 Bytes
Contents
require "juicer/dependency_resolver/dependency_resolver" module Juicer # Resolves @import statements in CSS files and builds a list of all # files, in order. # class CssDependencyResolver < DependencyResolver # Regexp borrowed from similar project: # http://github.com/cgriego/front-end-blender/tree/master/lib/front_end_architect/blender.rb @@import_pattern = /^\s*@import(?: url\(| )(['"]?)([^\?'"\)\s]+)(\?(?:[^'"\)]+)?)?\1\)?(?:[^?;]+)?;?/im private def parse(line, imported_file = nil) return $2 if line =~ @@import_pattern # At first sight of actual CSS rules we abort (TODO: This does not take # into account the fact that rules may be commented out and that more # imports may follow) throw :done if imported_file && line =~ %r{/*} throw :done if line =~ /^[\.\#a-zA-Z\:]/ end def extension ".css" end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
ktheory-juicer-1.0.0.ktheory1 | lib/juicer/dependency_resolver/css_dependency_resolver.rb |