Class: Distil::HtmlProduct

Inherits:
Product
  • Object
show all
Defined in:
lib/distil/product/html-product.rb

Instance Attribute Summary

Attributes inherited from Product

#assets, #files, #language, #libraries, #project, #variant

Instance Method Summary collapse

Methods inherited from Product

#clean, #filename, #gzip, #gzip_filename, #handles_file?, #include_file, #initialize, #minimise, #minimised_filename, #notice_comment, #output_path, #up_to_date?

Constructor Details

This class inherits a constructor from Distil::Product

Instance Method Details

#buildObject



7
8
9
10
11
12
13
14
15
16
# File 'lib/distil/product/html-product.rb', line 7

def build
  folder= File.dirname(output_path)
  FileUtils.mkdir_p(folder)
  
  files.each { |f|
    product_path= File.join(folder, File.basename(f))
    FileUtils.rm product_path if File.exists? product_path
    File.symlink f.path_relative_to(folder), product_path
  }
end