Skip to content

Commit

Permalink
force change managment datetimes to zulu time
Browse files Browse the repository at this point in the history
  • Loading branch information
rubyredrick committed Apr 15, 2010
1 parent 77aa811 commit c948343
Show file tree
Hide file tree
Showing 14 changed files with 280 additions and 242 deletions.
16 changes: 8 additions & 8 deletions lib/ri_cal/properties/alarm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -332,49 +332,49 @@ def attach_property_from_string(line) # :nodoc:
end

def export_properties_to(export_stream) #:nodoc:
export_prop_to(export_stream, "ACTION", @action_property)
export_prop_to(export_stream, "ATTENDEE", @attendee_property)
export_prop_to(export_stream, "DURATION", @duration_property)
export_prop_to(export_stream, "ATTENDEE", @attendee_property)
export_prop_to(export_stream, "TRIGGER", @trigger_property)
export_prop_to(export_stream, "DESCRIPTION", @description_property)
export_prop_to(export_stream, "SUMMARY", @summary_property)
export_prop_to(export_stream, "REPEAT", @repeat_property)
export_prop_to(export_stream, "ATTACH", @attach_property)
export_prop_to(export_stream, "ACTION", @action_property)
end

def ==(o) #:nodoc:
if o.class == self.class
(action_property == o.action_property) &&
(attendee_property == o.attendee_property) &&
(duration_property == o.duration_property) &&
(attendee_property == o.attendee_property) &&
(trigger_property == o.trigger_property) &&
(description_property == o.description_property) &&
(summary_property == o.summary_property) &&
(repeat_property == o.repeat_property) &&
(attach_property == o.attach_property)
(attach_property == o.attach_property) &&
(action_property == o.action_property)
else
super
end
end

def initialize_copy(o) #:nodoc:
super
action_property = action_property && action_property.dup
attendee_property = attendee_property && attendee_property.dup
duration_property = duration_property && duration_property.dup
attendee_property = attendee_property && attendee_property.dup
trigger_property = trigger_property && trigger_property.dup
description_property = description_property && description_property.dup
summary_property = summary_property && summary_property.dup
repeat_property = repeat_property && repeat_property.dup
attach_property = attach_property && attach_property.dup
action_property = action_property && action_property.dup
end

def add_date_times_to(required_timezones) #:nodoc:
end

module ClassMethods #:nodoc:
def property_parser #:nodoc:
{"ACTION"=>:action_property_from_string, "ATTACH"=>:attach_property_from_string, "REPEAT"=>:repeat_property_from_string, "SUMMARY"=>:summary_property_from_string, "TRIGGER"=>:trigger_property_from_string, "ATTENDEE"=>:attendee_property_from_string, "DURATION"=>:duration_property_from_string, "DESCRIPTION"=>:description_property_from_string}
{"ACTION"=>:action_property_from_string, "REPEAT"=>:repeat_property_from_string, "ATTENDEE"=>:attendee_property_from_string, "TRIGGER"=>:trigger_property_from_string, "ATTACH"=>:attach_property_from_string, "SUMMARY"=>:summary_property_from_string, "DESCRIPTION"=>:description_property_from_string, "DURATION"=>:duration_property_from_string}
end
end

Expand Down
6 changes: 3 additions & 3 deletions lib/ri_cal/properties/calendar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,16 @@ def version_property_from_string(line) # :nodoc:


def export_properties_to(export_stream) #:nodoc:
export_prop_to(export_stream, "PRODID", @prodid_property)
export_prop_to(export_stream, "CALSCALE", @calscale_property)
export_prop_to(export_stream, "PRODID", @prodid_property)
export_prop_to(export_stream, "VERSION", @version_property)
export_prop_to(export_stream, "METHOD", @method_property)
end

def ==(o) #:nodoc:
if o.class == self.class
(prodid_property == o.prodid_property) &&
(calscale_property == o.calscale_property) &&
(prodid_property == o.prodid_property) &&
(version_property == o.version_property) &&
(method_property == o.method_property)
else
Expand All @@ -137,8 +137,8 @@ def ==(o) #:nodoc:

def initialize_copy(o) #:nodoc:
super
prodid_property = prodid_property && prodid_property.dup
calscale_property = calscale_property && calscale_property.dup
prodid_property = prodid_property && prodid_property.dup
version_property = version_property && version_property.dup
method_property = method_property && method_property.dup
end
Expand Down
127 changes: 62 additions & 65 deletions lib/ri_cal/properties/event.rb

Large diffs are not rendered by default.

39 changes: 19 additions & 20 deletions lib/ri_cal/properties/freebusy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def duration_property_from_string(line) # :nodoc:


# return the the DTSTAMP property
# which will be an instances of RiCal::PropertyValueDateTime
# which will be an instances of RiCal::PropertyValueZuluDateTime
#
# [purpose (from RFC 2445)]
# This property indicates the date/time that the instance of the iCalendar object was created.
Expand All @@ -151,24 +151,24 @@ def dtstamp_property
end

# set the DTSTAMP property
# property value should be an instance of RiCal::PropertyValueDateTime
# property value should be an instance of RiCal::PropertyValueZuluDateTime
def dtstamp_property=(property_value)
@dtstamp_property = property_value ? property_value.for_parent(self) : nil
@dtstamp_property = property_value
end

# set the value of the DTSTAMP property
def dtstamp=(ruby_value)
self.dtstamp_property= RiCal::PropertyValue::DateTime.convert(self, ruby_value)
self.dtstamp_property= RiCal::PropertyValue::ZuluDateTime.convert(self, ruby_value)
end

# return the value of the DTSTAMP property
# which will be an instance of DateTime
# which will be an instance of ZuluDateTime
def dtstamp
dtstamp_property ? dtstamp_property.ruby_value : nil
end

def dtstamp_property_from_string(line) # :nodoc:
@dtstamp_property = RiCal::PropertyValue::DateTime.new(self, line)
@dtstamp_property = RiCal::PropertyValue::ZuluDateTime.new(self, line)
end


Expand Down Expand Up @@ -521,33 +521,33 @@ def request_status_property_from_string(line) # :nodoc:
end

def export_properties_to(export_stream) #:nodoc:
export_prop_to(export_stream, "REQUEST-STATUS", @request_status_property)
export_prop_to(export_stream, "DTSTAMP", @dtstamp_property)
export_prop_to(export_stream, "CONTACT", @contact_property)
export_prop_to(export_stream, "DURATION", @duration_property)
export_prop_to(export_stream, "DTEND", @dtend_property)
export_prop_to(export_stream, "DTSTART", @dtstart_property)
export_prop_to(export_stream, "CONTACT", @contact_property)
export_prop_to(export_stream, "DTSTAMP", @dtstamp_property)
export_prop_to(export_stream, "ATTENDEE", @attendee_property)
export_prop_to(export_stream, "UID", @uid_property)
export_prop_to(export_stream, "DURATION", @duration_property)
export_prop_to(export_stream, "URL", @url_property)
export_prop_to(export_stream, "ORGANIZER", @organizer_property)
export_prop_to(export_stream, "FREEBUSY", @freebusy_property)
export_prop_to(export_stream, "REQUEST-STATUS", @request_status_property)
export_prop_to(export_stream, "COMMENT", @comment_property)
end

def ==(o) #:nodoc:
if o.class == self.class
(request_status_property == o.request_status_property) &&
(dtstamp_property == o.dtstamp_property) &&
(contact_property == o.contact_property) &&
(duration_property == o.duration_property) &&
(dtend_property == o.dtend_property) &&
(dtstart_property == o.dtstart_property) &&
(contact_property == o.contact_property) &&
(dtstamp_property == o.dtstamp_property) &&
(attendee_property == o.attendee_property) &&
(uid_property == o.uid_property) &&
(duration_property == o.duration_property) &&
(url_property == o.url_property) &&
(organizer_property == o.organizer_property) &&
(freebusy_property == o.freebusy_property) &&
(request_status_property == o.request_status_property) &&
(comment_property == o.comment_property)
else
super
Expand All @@ -556,29 +556,28 @@ def ==(o) #:nodoc:

def initialize_copy(o) #:nodoc:
super
request_status_property = request_status_property && request_status_property.dup
dtstamp_property = dtstamp_property && dtstamp_property.dup
contact_property = contact_property && contact_property.dup
duration_property = duration_property && duration_property.dup
dtend_property = dtend_property && dtend_property.dup
dtstart_property = dtstart_property && dtstart_property.dup
contact_property = contact_property && contact_property.dup
dtstamp_property = dtstamp_property && dtstamp_property.dup
attendee_property = attendee_property && attendee_property.dup
uid_property = uid_property && uid_property.dup
duration_property = duration_property && duration_property.dup
url_property = url_property && url_property.dup
organizer_property = organizer_property && organizer_property.dup
freebusy_property = freebusy_property && freebusy_property.dup
request_status_property = request_status_property && request_status_property.dup
comment_property = comment_property && comment_property.dup
end

def add_date_times_to(required_timezones) #:nodoc:
add_property_date_times_to(required_timezones, dtstart_property)
add_property_date_times_to(required_timezones, dtend_property)
add_property_date_times_to(required_timezones, dtstamp_property)
end

module ClassMethods #:nodoc:
def property_parser #:nodoc:
{"DTEND"=>:dtend_property_from_string, "DTSTART"=>:dtstart_property_from_string, "DTSTAMP"=>:dtstamp_property_from_string, "URL"=>:url_property_from_string, "CONTACT"=>:contact_property_from_string, "UID"=>:uid_property_from_string, "ATTENDEE"=>:attendee_property_from_string, "ORGANIZER"=>:organizer_property_from_string, "REQUEST-STATUS"=>:request_status_property_from_string, "FREEBUSY"=>:freebusy_property_from_string, "COMMENT"=>:comment_property_from_string, "DURATION"=>:duration_property_from_string}
{"COMMENT"=>:comment_property_from_string, "DTEND"=>:dtend_property_from_string, "URL"=>:url_property_from_string, "CONTACT"=>:contact_property_from_string, "UID"=>:uid_property_from_string, "ATTENDEE"=>:attendee_property_from_string, "ORGANIZER"=>:organizer_property_from_string, "FREEBUSY"=>:freebusy_property_from_string, "REQUEST-STATUS"=>:request_status_property_from_string, "DURATION"=>:duration_property_from_string, "DTSTART"=>:dtstart_property_from_string, "DTSTAMP"=>:dtstamp_property_from_string}
end
end

Expand Down
Loading

0 comments on commit c948343

Please sign in to comment.