From jeff at rosejn.net Mon Oct 10 08:03:11 2005 From: jeff at rosejn.net (Jeff Rose) Date: Mon, 10 Oct 2005 14:03:11 +0200 Subject: [iCalendar-devel] new version and advice Message-ID: <1128945792.8549.48.camel@localhost.localdomain> Hello everyone, Well, after finally getting moved into my new digs I've gotten back to hacking on the icalendar library. I think I've fixed all of the bugs that have been reported so far, and I added true support for timezones, including its sub-components STANDARD and DAYLIGHT. Additionally I did a bit of refactoring to clean up the internals a bit, and I think the property parameter functionality on the back-end is ready. The main problem now is that I'm not sure how to give people access to the property parameters. If anyone has an idea on a clean way to do this it would be great! Here, code is worth at least a couple hundred words... # Standard stuff... cal = Icalendar::Calendar.new cal.event do user_id = "joe-bob at somewhere.net" timestamp = DateTime.now start = Date.new(2005, 04, 29) end = Date.new(2005, 04, 28) # First, the simple case for properties with a single instance... --- # It could work something like this with a hash summary = "Meeting with the man.", {'LANGUAGE' => 'us-EN'} # Or like this with just a string (maybe more flexible for # weird/custom stuff). This requires more knowledge about the # specification, but anyone using parameters is probably referencing # it anyway... summary = "Meeting with the man.", "LANGUAGE=us-EN" ~~~ # And then to retrieve these I guess it would have to be explicit mySummary = event.summary myParams = event.summary_params # Otherwise it would have to return a hash or an array, which would # make things more difficult for the general case without parameters. mySummary = event.summary[:value] myParams = event.summary[:params] --- # Now the hard thing is figuring out what to do for properties # which can occur multiple times, like attendee... # It could still use hashes to set add_attendee 'mailto:joe at company.com', {'ROLE' => 'REQ-PARTICIPANT', 'PARTSTAT' => 'TENTATIVE'} # Or maybe strings add_attendee 'mailto:bob at company.com', 'ROLE=REQ-PARTICIPANT', 'PARTSTAT=ACCEPTED' ~~~ # But how should retrieval work since this is an array of attendees? # Maybe by default it could return just an array of values, but if # you as for it with parameters it would give you an array of hashes. myAttendees = event.attendees # => ['mailto:joe at company.com', 'mailto:bob at company.com'] myAttendeesParams = event.attendees_with_params #=> [{:value => 'mailto:joe at company.com', 'ROLE' => 'REQ-PARTICIPANT', 'PARTSTAT' => 'ACCEPTED'}, {:value => 'mailto:bob at company.com'... etc.}] klass = "PRIVATE" end What do you think? Any ideas or suggestions would be appreciated. -Jeff From daniel at itxl.nl Fri Oct 28 12:21:28 2005 From: daniel at itxl.nl (Daniel Wijnands) Date: Fri, 28 Oct 2005 18:21:28 +0200 Subject: [iCalendar-devel] add undefined error Message-ID: <778B080E-DD9D-4165-AF95-A80220CAC3FA@itxl.nl> Hello, I had to change the example a little bit, i use the ruby gem package So the first lines become : 3 require 'rubygems' 4 require_gem 'icalendar' 5 require 'date' but when i run the script i get : create_cal.rb:20: undefined method `add' for # (NoMethodError) The method with event = cal.event works fine. Another problem is that i can find no documentation on todo's and the other features. Also i can't seem to get an all day event in ical apple mac os x Thanks a lot Daniel From jeff at rosejn.net Sun Oct 30 18:41:05 2005 From: jeff at rosejn.net (Jeff Rose) Date: Mon, 31 Oct 2005 00:41:05 +0100 Subject: [iCalendar-devel] new version out the door In-Reply-To: <778B080E-DD9D-4165-AF95-A80220CAC3FA@itxl.nl> References: <778B080E-DD9D-4165-AF95-A80220CAC3FA@itxl.nl> Message-ID: <1130715665.8926.28.camel@localhost.localdomain> Just wanted to let everyone know that I posted a new version of the icalendar library this evening. (Actually I posted two because I forgot to check-in the updated unit tests before 0.96.1) This release has support for custom properties defined with the 'x-' prefix, and I added some missing properties for timezones so hopefully they work for everyone now. I found that some properties were conflicting with built-in methods in ruby, so now there is a convention: conflicting property names have an 'ip_"(ical property) prefix. In addition, the website should now have some more documentation on the property methods. I've found that documenting and meta-programming do not jive with each other. I think ruby needs some form of meta-documenting so you can dynamically generate documentation. This might be some type of instructions in the comments that tell rdoc how to generate the documentation when it finds a certain symbol name? Not sure yet... Thanks for the help, and please send in any issues you have or documentation you'd really like to see. Wouldn't it be nice if rdoc could actually generate a wiki site so you could more easily add docs? Although that might be hard to keep synced with the project unless you could feed the documentation back into the source code... I guess this could be hard. -Jeff