Sha256: 059206d849e0b435661c0c94ff9245663e1f4bd17cc4b23457767f446c1e3b0d

Contents?: true

Size: 1.17 KB

Versions: 14

Compression:

Stored size: 1.17 KB

Contents

module Distil
  
  class CssProduct < Product
    content_type "css"
    variants [RELEASE_VARIANT, DEBUG_VARIANT]

    def build_debug
      File.open(output_path, "w") { |output|

        output.puts notice_comment
        output_files= []
        
        libraries.each { |l|
          f= project.file_from_path(l.file_for(content_type, language, variant))
          output_files << f if f
        }

        output_files += files
        
        output_files.each { |f|
          output.puts "@import url(\"#{f.relative_path}\");"
        }
        
      }
    end

    def build_release
      File.open(output_path, "w") { |output|

        output.puts notice_comment

        output_files= []
        
        libraries.each { |l|
          f= project.file_from_path(l.file_for(content_type, language, variant))
          output_files << f if f
        }

        output_files += files
        
        output_files.each { |f|
          content= f.rewrite_content_relative_to_path(nil)
          next if !content || content.empty?

          output.puts "/* #{f.relative_path} */"
          output.puts content
          output.puts ""
        }
        
      }
    end
    
  end
  
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
distil-0.14.5.a lib/distil/product/css-product.rb
distil-0.14.4 lib/distil/product/css-product.rb
distil-0.14.3 lib/distil/product/css-product.rb
distil-0.14.2 lib/distil/product/css-product.rb
distil-0.14.2.a lib/distil/product/css-product.rb
distil-0.14.1 lib/distil/product/css-product.rb
distil-0.14.1.a lib/distil/product/css-product.rb
distil-0.14.0 lib/distil/product/css-product.rb
distil-0.14.0.i lib/distil/product/css-product.rb
distil-0.14.0.h lib/distil/product/css-product.rb
distil-0.14.0.g lib/distil/product/css-product.rb
distil-0.14.0.d lib/distil/product/css-product.rb
distil-0.14.0.c lib/distil/product/css-product.rb
distil-0.14.0.b lib/distil/product/css-product.rb