Permalink
Browse files

support location setting in icalendars

  • Loading branch information...
1 parent 6753a36 commit 57b54a019942f19e3c2b24b79d3c5a94d4b89bdd @ralph ralph committed with Nov 19, 2009
Showing with 19 additions and 0 deletions.
  1. +9 −0 lib/vpim/property/location.rb
  2. +1 −0 lib/vpim/vevent.rb
  3. +9 −0 test/test_ical.rb
@@ -29,9 +29,18 @@ def geo
end
prop
end
+ end
+ end
+ # add a location property to (v)events. This is specified in the RFC 2445
+ module Set
+ module Location
+ def location(value)
+ set_text 'LOCATION', value
+ end
end
end
+
end
end
View
@@ -135,6 +135,7 @@ def dtend
class Maker
include Vpim::Icalendar::Set::Util #:nodoc:
include Vpim::Icalendar::Set::Common
+ include Vpim::Icalendar::Set::Location
# The event that changes are being made to.
attr_reader :event
View
@@ -421,6 +421,15 @@ def test_location
assert_equal(cal.events.last.location, nil)
end
+ def test_set_location
+ vc = Icalendar.create2 do |vc|
+ vc.add_event do |m|
+ m.location("bien located")
+ end
+ end
+ assert_match(/LOCATION:bien located/, vc.to_s)
+ end
+
def test_event_maker_w_rrule
vc = Icalendar.create2 do |vc|

0 comments on commit 57b54a0

Please sign in to comment.