Skip to content

Commit

Permalink
Added Buffer#to_smartypants.
Browse files Browse the repository at this point in the history
  • Loading branch information
postmodern committed May 12, 2011
1 parent 6e43b77 commit 794d843
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/ffi/upskirt/buffer.rb
@@ -1,4 +1,4 @@
require 'ffi'
require 'ffi/upskirt/upskirt'

module FFI
module Upskirt
Expand All @@ -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.