Brian LeRoux
2007-Oct-21 01:35 UTC
[iCalendar-devel] getting a method missing for ''summary'' -- help w/ remote ical!
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
Jeff Rose
2007-Nov-30 11:15 UTC
[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
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
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