Jeff,
Hmmm...no it never came through yesterday, I looked through my Junk folder too.
We greylist here but I don''t think that is the problem.
Anyway....that cleared things up for me...thanks. I added the array brackets []
around the RRULE entry and it works now. Tested it with
"add_recurrence_rule" and that worked too. Both of these worked for
me...
recurrence_rules
["FREQ=WEEKLY;UNTIL=#{endDate.strftime(fmt=''%Y%m%d'')};INTERVAL=1;BYDAY=#{days}"]
or
add_recurrence_rule
"FREQ=WEEKLY;UNTIL=#{endDate.strftime(fmt=''%Y%m%d'')};INTERVAL=1;BYDAY=#{days}"
It''s adding some extra backslashes to the RRULE line in the resulting
ICS file for some reason. Seems to be happening whenever it runs into a
semicolon or comma in the original string.
RRULE:FREQ=WEEKLY\;UNTIL=20080509\;INTERVAL=1\;BYDAY=TU\,TH
Something I need to do with the punctuation....or will this be ok?
Thanks,
Matt
----- Original Message -----
From: "Jeff Rose" <rosejn at gmail.com>
To: "iCalendar developers & users" <icalendar-devel at
rubyforge.org>, MR-Mencel at wiu.edu
Sent: Wednesday, December 12, 2007 12:20:28 PM (GMT-0600) America/Chicago
Subject: Re: [iCalendar-devel] How To Set Recurrence?
Did you not get my response yesterday?
In iCal events you can have two different types of properties, those
that can only have a single occurrence, like dtstart, and those that can
have multiple occurrences, like comment, category, recurrence_rule. For
any of the multiple occurrence properties you can either assign them all
at once using an array (categories = [a, b, c]), or you can add/remove
single instances separately (add_category a). Check out the
component_test.rb in the unit tests to see an example using the comment
property.
peace,
Jeff
Matt Mencel wrote:> This list is pretty quiet....just checking to see if anyone is awake... :)
>
> Matt
>
> ----- Original Message -----
> From: "Matt Mencel" <MR-Mencel at wiu.edu>
> To: icalendar-devel at rubyforge.org
> Sent: Tuesday, December 11, 2007 4:22:28 PM (GMT-0600) America/Chicago
> Subject: [iCalendar-devel] How To Set Recurrence?
>
> I am trying to create an iCal event entry with recurrence...based on the
samples I''ve got a block like this...
>
> cal.event do
> dtstart Date.new(startDate.year(), startDate.month(),
startDate.day())
> dtend Date.new(endDate.year(), endDate.month(), endDate.day())
> summary "#{program} #{number}"
> description "Course Details:
> COURSE: #{name} - #{courseTitle}
> INSTRUCTOR: #{instructor}"
> klass "PUBLIC"
> location "#{location}"
> uid "#{user.uid}#{program}#{number}#{starnum}"
> recurrence_rules
"RRULE:FREQ=WEEKLY;UNTIL=20071225;INTERVAL=1;BYDAY=TU,TH"
> end
>
> But it returns the following error...
>
> component.rb:208:in `recurrence_rules='': recurrence_rules is a
multi-property that must be an array! Use the add_[property] method to add
single entries. (ArgumentError)
>
>
> I tried a couple different ways of using add_component with
recurrence_rules, but I haven''t been able to figure it out yet. How do
you add recurrence to an event?
>
> Another thing I''m curious about, I tried using
"category" to add an event category, but it gave me the
NoMethodError....so I guess that''s not a valid event option?
>
> Thanks,
> Matt
>
>
>
>
>
> ----- Original Message -----
> From: "Jeff Rose" <jeff at rosejn.net>
> To: "brian leroux" <brian.leroux at westcoastlogic.com>,
"iCalendar developers & users" <icalendar-devel at
rubyforge.org>
> Sent: Friday, November 30, 2007 5:15:18 AM (GMT-0600) America/Chicago
> Subject: Re: [iCalendar-devel] getting a method missing for
''summary'' -- help w/ remote ical!
>
> Hi Brian,
> I think the best way to debug things is if you can post an example
> calendar to the list which breaks the library. By looking at your stack
> trace it seems to be a bad calendar to me. I could be mistaken though.
> (It looks like it''s trying to parse a FreeBusy component when it
runs
> into a summary property. FreeBusy''s don''t have a
summary, so that would
> be a bogus entry.) Either way, it would be good to figure out
what''s
> going on, and maybe the library should do a better job of continuing on
> past bad calendar properties and/or components. Not sure what I think
> about that though...
>
> -Jeff
>
> Brian LeRoux wrote:
>> Any help greatly appreciated! Showing rather than explaining below
>> (url changed):
>>
>>
>> irb(main):002:0> require ''rubygems''
>> => true
>>
>> irb(main):003:0> require ''net/http''
>> => true
>>
>> irb(main):004:0> url = URI.parse
''http://www.somewebsite/basic.ics''
>> => #<URI::HTTP:0x271618
URL:http:/mygooglecalendar.com/public/basic.ics>
>>
>> irb(main):005:0> req = Net::HTTP::Get.new(url.path)
>> => #<Net::HTTP::Get GET>
>>
>> irb(main):006:0> res = Net::HTTP.start(url.host, url.port) {|http|
>> http.request(req) }
>> => #<Net::HTTPOK 200 OK readbody=true>
>>
>> irb(main):007:0> require ''icalendar''
>> => true
>>
>> irb(main):008:0> Icalendar.parse res.body
>>
>> NoMethodError: Method Name: summary
>> from
/opt/local/lib/ruby/gems/1.8/gems/icalendar-1.0.1/lib/icalendar/component.rb:413:in
>> `method_missing''
>> from
/opt/local/lib/ruby/gems/1.8/gems/icalendar-1.0.1/lib/icalendar/parser.rb:179:in
>> `send''
>> from
/opt/local/lib/ruby/gems/1.8/gems/icalendar-1.0.1/lib/icalendar/parser.rb:179:in
>> `parse_component''
>> from
/opt/local/lib/ruby/gems/1.8/gems/icalendar-1.0.1/lib/icalendar/parser.rb:139:in
>> `parse_component''
>> from
/opt/local/lib/ruby/gems/1.8/gems/icalendar-1.0.1/lib/icalendar/parser.rb:101:in
>> `parse''
>> from
/opt/local/lib/ruby/gems/1.8/gems/icalendar-1.0.1/lib/icalendar/parser.rb:16:in
>> `parse''
>> from (irb):8
>> from /opt/local/lib/ruby/1.8/time.rb:53
>> _______________________________________________
>> icalendar-devel mailing list
>> icalendar-devel at rubyforge.org
>> http://rubyforge.org/mailman/listinfo/icalendar-devel
>
> _______________________________________________
> icalendar-devel mailing list
> icalendar-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/icalendar-devel
>
> _______________________________________________
> icalendar-devel mailing list
> icalendar-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/icalendar-devel
>
> _______________________________________________
> icalendar-devel mailing list
> icalendar-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/icalendar-devel