Sha256: ab89f4e63fe4a50fb1d74bd93135a5c778468c57584676a883c9c1a57de705f7
Contents?: true
Size: 577 Bytes
Versions: 42
Compression:
Stored size: 577 Bytes
Contents
#!/usr/bin/env ruby ## Need this so we can require the library from the samples directory $:.unshift(File.dirname(__FILE__) + '/../lib') require 'icalendar' require 'date' # Open a file or string to parse cal_file = File.open("../test/life.ics") # Parser returns an array of calendars because a single file # can have multiple calendar objects. cals = Icalendar::parse(cal_file) cal = cals.first # Now you can access the cal object in just the same way I created it event = cal.events.first puts "start date-time: " + event.dtstart.to_s puts "summary: " + event.summary
Version data entries
42 entries across 42 versions & 4 rubygems