Sha256: 87d937fedc1cf7ccd745f8911cd767256f0bbc1281f3aca629678286af058f67

Contents?: true

Size: 613 Bytes

Versions: 8

Compression:

Stored size: 613 Bytes

Contents

module Distil

  COMPRESSOR= File.expand_path("#{VENDOR_DIR}/yuicompressor-2.4.2.jar")
    
  module Minified
    
    def filename
      minified_name
    end
    
    def external_files
      []
    end
    
    def write_output
      return if up_to_date
      @up_to_date= true
      
    	# Run the Y!UI Compressor
    	system "java -jar #{COMPRESSOR} #{concatenated_name} -o #{filename}"
    	
    	if 'css'==extension
    		buffer= File.read(filename)
    		File.open(filename, "w") { |f|
    		  f.write(buffer.gsub(/\}/,"}\n").gsub(/.*@import url\(\".*\"\);/,''))
  		  }
      end 
    end
  
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
distil-0.12.0 lib/distil/product/minified.rb
distil-0.11.8 lib/distil/product/minified.rb
distil-0.11.6 lib/distil/product/minified.rb
distil-0.11.5 lib/distil/product/minified.rb
distil-0.11.4 lib/distil/product/minified.rb
distil-0.11.3 lib/distil/product/minified.rb
distil-0.11.1 lib/distil/product/minified.rb
distil-0.11.0 lib/distil/product/minified.rb