Created
November 9, 2011 15:25
Revisions
-
pk created this gist
Nov 9, 2011 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ module PK module Filter class Juice < Nanoc3::Filter identifier :juice type :text def run(content, params={}) input_filename = File.join('content', @item.path) output_filename = File.absolute_path(File.join('tmp', "#{@item.path}")) system('juicer', 'merge', '--force', '-o', output_filename, input_filename) minified = File.open(output_filename, 'r') { |f| f.read } end end end end