Permalink
Browse files

Added Buffer#to_smartypants.

  • Loading branch information...
1 parent 6e43b77 commit 794d843b4589c79cf41516c6d4392e74a63d5835 @postmodern committed May 12, 2011
Showing with 11 additions and 1 deletion.
  1. +11 −1 lib/ffi/upskirt/buffer.rb
View
@@ -1,4 +1,4 @@
-require 'ffi'
+require 'ffi/upskirt/upskirt'
module FFI
module Upskirt
@@ -10,6 +10,16 @@ class Buffer < FFI::Struct
:unit, :size_t,
:ref, :int
+ def to_smartypants
+ smart_buffer = Upskirt.bufnew(128)
+
+ Upskirt.upshtml_smartypants(smart_buffer,self)
+ result = smart_buffer.data.get_string(0,smart_buffer.size)
+
+ smart_buffer.free
+ return result
+ end
+
end
end
end

0 comments on commit 794d843

Please sign in to comment.