Skip to content

Instantly share code, notes, and snippets.

@denisdefreyne
Created July 28, 2011 21:05
Show Gist options
  • Save denisdefreyne/1112555 to your computer and use it in GitHub Desktop.
Save denisdefreyne/1112555 to your computer and use it in GitHub Desktop.
class ToTextFilter < ::Nanoc3::Filter
identifier :to_text
type :binary => :text
def run(filename, params={})
File.read(filename)
end
end
class ToBinaryFilter < ::Nanoc3::Filter
identifier :to_binary
type :text => :binary
def run(content, params={})
IO.open(output_filename, 'w') { |io| io.write(content) }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment