Skip to content

Instantly share code, notes, and snippets.

@tenderlove
Created November 19, 2010 23:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tenderlove/707386 to your computer and use it in GitHub Desktop.
Save tenderlove/707386 to your computer and use it in GitHub Desktop.
module Tidy
extend FFI::Library
ffi_lib "libtidy.dylib"
attach_function :tidyFileExists, [:string], :int
attach_function :tidyCreate, [], :pointer
attach_function :tidyParseString, [:pointer, :string], :int
attach_function :tidySaveStdout, [:pointer], :int
end
tdoc = Tidy.tidyCreate
Tidy.tidyParseString tdoc, "<title>Foo</title"
Tidy.tidySaveStdout tdoc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment