Class: Polites::Nanoc::ExtractFileFilter

Inherits:
Nanoc::Filter
  • Object
show all
Defined in:
lib/polites/nanoc/extract_file_filter.rb

Overview

Nanoc binary filter to extract files from a zip file to a given output file. This allows a single Polites file to be linked to multiple Nanoc items, which are extracted when needed during the compilation process.

Instance Method Summary collapse

Instance Method Details

#run(filename, _params = {}) ⇒ Object



14
15
16
17
18
# File 'lib/polites/nanoc/extract_file_filter.rb', line 14

def run(filename, _params = {})
  File.open(filename) do |f|
    f.extract_to(@item[:subpath], output_filename)
  end
end