Created
February 21, 2009 19:29
-
-
Save LeifW/68152 to your computer and use it in GitHub Desktop.
This file contains 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 characters
require 'libical' | |
array = MemoryPointer.new(:int,10) | |
LibIcal.icalrecur_expand_recurrence("FREQ=YEARLY;BYDAY=SU,WE",Time.now.to_i,10,array) | |
times = array.read_array_of_int(10).map {|s| Time.at(s)} | |
times.each {|s| puts s} |
This file contains 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 characters
require 'rubygems' | |
require 'ffi' | |
module LibIcal | |
extend FFI::Library | |
ffi_lib "/usr/lib/libical.so" | |
#attach_function :icaltime_from_timet_with_zone [:int, :int, :pointer], :pointer | |
attach_function :icalrecur_expand_recurrence, [:string, :int, :int, :pointer], :int | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment