Sha256: 4de206aa750f9f1019539456f4820b35043e1316df4c43483342c12365ce7572
Contents?: true
Size: 503 Bytes
Versions: 44
Compression:
Stored size: 503 Bytes
Contents
class Subject def initialize(out=STDOUT) calendar_file = File.open(File.join(File.dirname(__FILE__), *%w[ical.ics]), 'r') @calendar = RiCal.parse(calendar_file).first @cutoff = Date.parse("20100531") @out = out end def run cutoff = @cutoff @calendar.events.each do |event| event.occurrences(:before => cutoff).each do |instance| @out.puts "Event #{instance.uid.slice(0..5)}, starting #{instance.dtstart}, ending #{instance.dtend}" end end end end
Version data entries
44 entries across 44 versions & 9 rubygems