Permalink
Browse files

0.8.0 - 11 August 2009 Minor Version Bump - There is a small potentia…

…lly breaking change see section on treatment of X-properties below

  * Unknown Components

  Starting with version 0.8.0 RiCal will parse calendars and components which contain nonstandard components.

  For example, there was a short-lived proposal to extend RFC2445 with a new VVENUE component which would hold structured information about the location of an event.  This proposal was never accepted and was withdrawn, but there is icalendar data in the wild which contains VVENUE components.

  Prior to version 0.8.0, RiCal would raise an exception if unknown component types were encountered.  Starting with version 0.8.0 RiCal will 'parse' such components and create instances of NonStandard component to represent them.  Since the actual format of unknown components is not known by RiCal, the NonStandard component will simply save the data lines between the BEGIN:xxx and END:xxx lines, (where xxx is the non-standard component name, e.g. VVENUE).  If the calendar is re-exported the original lines will be replayed.

  * Change to treatment of X-properties

  RFC2445 allows 'non-standard' or experimental properties which property-names beginning with X.  RiCal always supported parsing these.

  The standard properties are specified as to how many times they can occur within a particular component.  For singly occurring properties RiCal returns a single property object, while for properties which can occur multiple times RiCal returns an array of property objects.

  While implementing NonStandard properties, I realized that X-properties were being assumed to be singly occurring. But this isn't necessarily true.  So starting with 0.8.0 the X-properties are represented by an array of property objects.

  THIS MAY BREAK SOME APPLICATIONS, but the adaptation should be easy.
  • Loading branch information...
1 parent 52efb38 commit 128d820037b2a2fc3d5c0fdb545d6e00b916ce0d @rubyredrick rubyredrick committed Aug 11, 2009
View
22 History.txt
@@ -1,3 +1,25 @@
+=== 0.8.0 - 11 August 2009
+
+ Minor Version Bump - There is a small potentially breaking change see section on treatment of X-properties below
+
+ * Unknown Components
+
+ Starting with version 0.8.0 RiCal will parse calendars and components which contain nonstandard components.
+
+ For example, there was a short-lived proposal to extend RFC2445 with a new VVENUE component which would hold structured information about the location of an event. This proposal was never accepted and was withdrawn, but there is icalendar data in the wild which contains VVENUE components.
+
+ Prior to version 0.8.0, RiCal would raise an exception if unknown component types were encountered. Starting with version 0.8.0 RiCal will 'parse' such components and create instances of NonStandard component to represent them. Since the actual format of unknown components is not known by RiCal, the NonStandard component will simply save the data lines between the BEGIN:xxx and END:xxx lines, (where xxx is the non-standard component name, e.g. VVENUE). If the calendar is re-exported the original lines will be replayed.
+
+ * Change to treatment of X-properties
+
+ RFC2445 allows 'non-standard' or experimental properties which property-names beginning with X. RiCal always supported parsing these.
+
+ The standard properties are specified as to how many times they can occur within a particular component. For singly occurring properties RiCal returns a single property object, while for properties which can occur multiple times RiCal returns an array of property objects.
+
+ While implementing NonStandard properties, I realized that X-properties were being assumed to be singly occurring. But this isn't necessarily true. So starting with 0.8.0 the X-properties are represented by an array of property objects.
+
+ THIS MAY BREAK SOME APPLICATIONS, but the adaptation should be easy.
+
=== 0.7.7 - 6 August 2009
- No changes other than a version number bump. github seems to have failed to notice the commit of v0.7.6
and didn't build the gem. Hopefully it will notice this one.
View
1 Manifest.txt
@@ -24,6 +24,7 @@ lib/ri_cal/component/calendar.rb
lib/ri_cal/component/event.rb
lib/ri_cal/component/freebusy.rb
lib/ri_cal/component/journal.rb
+lib/ri_cal/component/non_standard.rb
lib/ri_cal/component/t_z_info_timezone.rb
lib/ri_cal/component/timezone.rb
lib/ri_cal/component/timezone/daylight_period.rb
View
18 README.txt
@@ -339,6 +339,24 @@ or another Enumerable method (RiCal::OccurrenceEnumerator includes Enumerable),
#....
end
+=== Unknown Components
+
+Starting with version 0.8.0 RiCal will parse calendars and components which contain nonstandard components.
+
+For example, there was a short-lived proposal to extend RFC2445 with a new VVENUE component which would hold structured information about the location of an event. This proposal was never accepted and was withdrawn, but there is icalendar data in the wild which contains VVENUE components.
+
+Prior to version 0.8.0, RiCal would raise an exception if unknown component types were encountered. Starting with version 0.8.0 RiCal will 'parse' such components and create instances of NonStandard component to represent them. Since the actual format of unknown components is not known by RiCal, the NonStandard component will simply save the data lines between the BEGIN:xxx and END:xxx lines, (where xxx is the non-standard component name, e.g. VVENUE). If the calendar is re-exported the original lines will be replayed.
+
+=== Change to treatment of X-properties
+
+RFC2445 allows 'non-standard' or experimental properties which property-names beginning with X. RiCal always supported parsing these.
+
+The standard properties are specified as to how many times they can occur within a particular component. For singly occurring properties RiCal returns a single property object, while for properties which can occur multiple times RiCal returns an array of property objects.
+
+While implementing NonStandard properties, I realized that X-properties were being assumed to be singly occurring. But this isn't necessarily true. So starting with 0.8.0 the X-properties are represented by an array of property objects.
+
+THIS MAY BREAK SOME APPLICATIONS, but the adaptation should be easy.
+
== REQUIREMENTS:
* RiCal requires that an implementation of TZInfo::Timezone. This requirement may be satisfied by either the TzInfo gem,
View
2 lib/ri_cal.rb
@@ -14,7 +14,7 @@ module RiCal
autoload :OccurrenceEnumerator, "#{my_dir}/ri_cal/occurrence_enumerator.rb"
# :stopdoc:
- VERSION = '0.7.7'
+ VERSION = '0.8.0'
LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR
View
16 lib/ri_cal/component.rb
@@ -34,7 +34,7 @@ def method_missing(selector, *args, &init_block) #:nodoc:
attr_accessor :imported #:nodoc:
- def initialize(parent=nil, &init_block) #:nodoc:
+ def initialize(parent=nil, entity_name = nil, &init_block) #:nodoc:
@parent = parent
if block_given?
if init_block.arity == 1
@@ -81,8 +81,8 @@ def subcomponent_class #:nodoc:
{}
end
- def self.from_parser(parser, parent) #:nodoc:
- entity = self.new(parent)
+ def self.from_parser(parser, parent, entity_name) #:nodoc:
+ entity = self.new(parent, entity_name)
entity.imported = true
line = parser.next_separated_line
while parser.still_in(entity_name, line)
@@ -142,12 +142,12 @@ def process_line(parser, line) #:nodoc:
# return a hash of any extended properties, (i.e. those with a property name starting with "X-"
# representing an extension to the RFC 2445 specification)
def x_properties
- @x_properties ||= {}
+ @x_properties ||= Hash.new {|h,k| h[k] = []}
end
# Add a n extended property
def add_x_property(name, prop)
- x_properties[name] = prop
+ x_properties[name] << prop
end
def method_missing(selector, *args, &b) #:nodoc:
@@ -200,8 +200,10 @@ def export_prop_to(export_stream, name, prop) #:nodoc:
end
def export_x_properties_to(export_stream) #:nodoc:
- x_properties.each do |name, prop|
- export_stream.puts("#{name}:#{prop}")
+ x_properties.each do |name, props|
+ props.each do | prop |
+ export_stream.puts("#{name}:#{prop}")
+ end
end
end
View
7 lib/ri_cal/component/calendar.rb
@@ -9,7 +9,7 @@ class Calendar < Component
include RiCal::Properties::Calendar
attr_reader :tz_source #:nodoc:
- def initialize(parent=nil, &init_block) #:nodoc:
+ def initialize(parent=nil,entity_name = nil, &init_block) #:nodoc:
@tz_source = 'TZINFO' # Until otherwise told
super
end
@@ -239,6 +239,11 @@ def export(to=nil)
export_subcomponent_to(export_stream, todos)
export_subcomponent_to(export_stream, journals)
export_subcomponent_to(export_stream, freebusys)
+ subcomponents.each do |key, value|
+ unless %{VEVENT VTODO VJOURNAL VFREEBUSYS}.include?(key)
+ export_subcomponent_to(export_stream, value)
+ end
+ end
export_stream.puts("END:VCALENDAR")
if to
nil
View
35 lib/ri_cal/component/non_standard.rb
@@ -0,0 +1,35 @@
+require File.join(File.dirname(__FILE__), %w[.. properties alarm.rb])
+
+module RiCal
+
+ class Component
+ #- ©2009 Rick DeNatale, All rights reserved. Refer to the file README.txt for the license
+ #
+ # An NonStandard component represents a component (or subcomponent) not listed in RFC2445.
+ # For example some icalendar data contains VVENUE components, a proposed extension to RFC2445
+ # which was dropped.
+ class NonStandard < Component
+ attr_reader :entity_name
+
+ def initialize(parent, entity_name)
+ super(parent)
+ @entity_name = entity_name
+ @source_lines = []
+ end
+
+ def process_line(parser, line) #:nodoc:
+ if line[:name] == "BEGIN"
+ parse_subcomponent(parser, line)
+ else
+ @source_lines << parser.last_line_str
+ end
+ end
+
+ def export_properties_to(stream)
+ @source_lines.each do |line|
+ stream.puts(line)
+ end
+ end
+ end
+ end
+end
View
30 lib/ri_cal/parser.rb
@@ -3,6 +3,7 @@ module RiCal
#- All rights reserved. Refer to the file README.txt for the license
#
class Parser # :nodoc:
+ attr_reader :last_line_str #:nodoc:
def next_line #:nodoc:
result = nil
begin
@@ -59,11 +60,12 @@ def self.params_and_value(string, optional_initial_semi = false) #:nodoc:
def separate_line(string) #:nodoc:
match = string.match(/^([^;:]*)(.*)$/)
name = match[1]
+ @last_line_str = string
params, value = *Parser.params_and_value(match[2])
{
:name => name,
:params => params,
- :value => value
+ :value => value,
}
end
@@ -97,7 +99,8 @@ def parse #:nodoc:
result = []
while start_line = next_line
@parent_stack = []
- result << parse_one(start_line, nil)
+ component = parse_one(start_line, nil)
+ result << component if component
end
result
end
@@ -112,27 +115,28 @@ def parse_one(start, parent_component) #:nodoc:
first_line = separate_line(start)
end
invalid unless first_line[:name] == "BEGIN"
- result = case first_line[:value]
+ entity_name = first_line[:value]
+ result = case entity_name
when "VCALENDAR"
- RiCal::Component::Calendar.from_parser(self, parent_component)
+ RiCal::Component::Calendar.from_parser(self, parent_component, entity_name)
when "VEVENT"
- RiCal::Component::Event.from_parser(self, parent_component)
+ RiCal::Component::Event.from_parser(self, parent_component, entity_name)
when "VTODO"
- RiCal::Component::Todo.from_parser(self, parent_component)
+ RiCal::Component::Todo.from_parser(self, parent_component, entity_name)
when "VJOURNAL"
- RiCal::Component::Journal.from_parser(self, parent_component)
+ RiCal::Component::Journal.from_parser(self, parent_component, entity_name)
when "VFREEBUSY"
- RiCal::Component::Freebusy.from_parser(self, parent_component)
+ RiCal::Component::Freebusy.from_parser(self, parent_component, entity_name)
when "VTIMEZONE"
- RiCal::Component::Timezone.from_parser(self, parent_component)
+ RiCal::Component::Timezone.from_parser(self, parent_component, entity_name)
when "VALARM"
- RiCal::Component::Alarm.from_parser(self, parent_component)
+ RiCal::Component::Alarm.from_parser(self, parent_component, entity_name)
when "DAYLIGHT"
- RiCal::Component::Timezone::DaylightPeriod.from_parser(self, parent_component)
+ RiCal::Component::Timezone::DaylightPeriod.from_parser(self, parent_component, entity_name)
when "STANDARD"
- RiCal::Component::Timezone::StandardPeriod.from_parser(self, parent_component)
+ RiCal::Component::Timezone::StandardPeriod.from_parser(self, parent_component, entity_name)
else
- invalid
+ RiCal::Component::NonStandard.from_parser(self, parent_component, entity_name)
end
@parent_stack.pop
result
View
6 ri_cal.gemspec
@@ -2,11 +2,11 @@
Gem::Specification.new do |s|
s.name = %q{ri_cal}
- s.version = "0.7.7"
+ s.version = "0.8.0"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["author=Rick DeNatale"]
- s.date = %q{2009-08-06}
+ s.date = %q{2009-08-11}
s.default_executable = %q{ri_cal}
s.description = %q{A new Ruby implementation of RFC2445 iCalendar.
@@ -19,7 +19,7 @@ A Google group for discussion of this library has been set up http://groups.goog
s.email = ["rick.denatale@gmail.com"]
s.executables = ["ri_cal"]
s.extra_rdoc_files = ["History.txt", "Manifest.txt", "README.txt", "copyrights.txt", "docs/draft-ietf-calsify-2446bis-08.txt", "docs/draft-ietf-calsify-rfc2445bis-09.txt", "docs/incrementers.txt"]
- s.files = ["History.txt", "Manifest.txt", "README.txt", "Rakefile", "bin/ri_cal", "component_attributes/alarm.yml", "component_attributes/calendar.yml", "component_attributes/component_property_defs.yml", "component_attributes/event.yml", "component_attributes/freebusy.yml", "component_attributes/journal.yml", "component_attributes/timezone.yml", "component_attributes/timezone_period.yml", "component_attributes/todo.yml", "copyrights.txt", "docs/draft-ietf-calsify-2446bis-08.txt", "docs/draft-ietf-calsify-rfc2445bis-09.txt", "docs/incrementers.txt", "docs/rfc2445.pdf", "lib/ri_cal.rb", "lib/ri_cal/component.rb", "lib/ri_cal/component/alarm.rb", "lib/ri_cal/component/calendar.rb", "lib/ri_cal/component/event.rb", "lib/ri_cal/component/freebusy.rb", "lib/ri_cal/component/journal.rb", "lib/ri_cal/component/t_z_info_timezone.rb", "lib/ri_cal/component/timezone.rb", "lib/ri_cal/component/timezone/daylight_period.rb", "lib/ri_cal/component/timezone/standard_period.rb", "lib/ri_cal/component/timezone/timezone_period.rb", "lib/ri_cal/component/todo.rb", "lib/ri_cal/core_extensions.rb", "lib/ri_cal/core_extensions/array.rb", "lib/ri_cal/core_extensions/array/conversions.rb", "lib/ri_cal/core_extensions/date.rb", "lib/ri_cal/core_extensions/date/conversions.rb", "lib/ri_cal/core_extensions/date_time.rb", "lib/ri_cal/core_extensions/date_time/conversions.rb", "lib/ri_cal/core_extensions/object.rb", "lib/ri_cal/core_extensions/object/conversions.rb", "lib/ri_cal/core_extensions/string.rb", "lib/ri_cal/core_extensions/string/conversions.rb", "lib/ri_cal/core_extensions/time.rb", "lib/ri_cal/core_extensions/time/calculations.rb", "lib/ri_cal/core_extensions/time/conversions.rb", "lib/ri_cal/core_extensions/time/tzid_access.rb", "lib/ri_cal/core_extensions/time/week_day_predicates.rb", "lib/ri_cal/fast_date_time.rb", "lib/ri_cal/floating_timezone.rb", "lib/ri_cal/invalid_property_value.rb", "lib/ri_cal/invalid_timezone_identifer.rb", "lib/ri_cal/occurrence_enumerator.rb", "lib/ri_cal/occurrence_period.rb", "lib/ri_cal/parser.rb", "lib/ri_cal/properties/alarm.rb", "lib/ri_cal/properties/calendar.rb", "lib/ri_cal/properties/event.rb", "lib/ri_cal/properties/freebusy.rb", "lib/ri_cal/properties/journal.rb", "lib/ri_cal/properties/timezone.rb", "lib/ri_cal/properties/timezone_period.rb", "lib/ri_cal/properties/todo.rb", "lib/ri_cal/property_value.rb", "lib/ri_cal/property_value/array.rb", "lib/ri_cal/property_value/cal_address.rb", "lib/ri_cal/property_value/date.rb", "lib/ri_cal/property_value/date_time.rb", "lib/ri_cal/property_value/date_time/additive_methods.rb", "lib/ri_cal/property_value/date_time/time_machine.rb", "lib/ri_cal/property_value/date_time/timezone_support.rb", "lib/ri_cal/property_value/duration.rb", "lib/ri_cal/property_value/geo.rb", "lib/ri_cal/property_value/integer.rb", "lib/ri_cal/property_value/occurrence_list.rb", "lib/ri_cal/property_value/period.rb", "lib/ri_cal/property_value/recurrence_rule.rb", "lib/ri_cal/property_value/recurrence_rule/enumeration_support_methods.rb", "lib/ri_cal/property_value/recurrence_rule/enumerator.rb", "lib/ri_cal/property_value/recurrence_rule/initialization_methods.rb", "lib/ri_cal/property_value/recurrence_rule/negative_setpos_enumerator.rb", "lib/ri_cal/property_value/recurrence_rule/numbered_span.rb", "lib/ri_cal/property_value/recurrence_rule/occurence_incrementer.rb", "lib/ri_cal/property_value/recurrence_rule/recurring_day.rb", "lib/ri_cal/property_value/recurrence_rule/recurring_month_day.rb", "lib/ri_cal/property_value/recurrence_rule/recurring_numbered_week.rb", "lib/ri_cal/property_value/recurrence_rule/recurring_year_day.rb", "lib/ri_cal/property_value/recurrence_rule/validations.rb", "lib/ri_cal/property_value/text.rb", "lib/ri_cal/property_value/uri.rb", "lib/ri_cal/property_value/utc_offset.rb", "lib/ri_cal/required_timezones.rb", "performance/paris_eastern/subject.rb", "performance/penultimate_weekday/subject.rb", "performance/psm_big_enum/ical.ics", "performance/psm_big_enum/subject.rb", "performance/utah_cycling/subject.rb", "ri_cal.gemspec", "sample_ical_files/from_ical_dot_app/test1.ics", "script/benchmark_subject", "script/console", "script/destroy", "script/generate", "script/profile_subject", "script/txt2html", "spec/ri_cal/bugreports_spec.rb", "spec/ri_cal/component/alarm_spec.rb", "spec/ri_cal/component/calendar_spec.rb", "spec/ri_cal/component/event_spec.rb", "spec/ri_cal/component/freebusy_spec.rb", "spec/ri_cal/component/journal_spec.rb", "spec/ri_cal/component/t_z_info_timezone_spec.rb", "spec/ri_cal/component/timezone_spec.rb", "spec/ri_cal/component/todo_spec.rb", "spec/ri_cal/component_spec.rb", "spec/ri_cal/core_extensions/string/conversions_spec.rb", "spec/ri_cal/core_extensions/time/calculations_spec.rb", "spec/ri_cal/core_extensions/time/week_day_predicates_spec.rb", "spec/ri_cal/fast_date_time_spec.rb", "spec/ri_cal/occurrence_enumerator_spec.rb", "spec/ri_cal/parser_spec.rb", "spec/ri_cal/property_value/date_spec.rb", "spec/ri_cal/property_value/date_time_spec.rb", "spec/ri_cal/property_value/duration_spec.rb", "spec/ri_cal/property_value/occurrence_list_spec.rb", "spec/ri_cal/property_value/period_spec.rb", "spec/ri_cal/property_value/recurrence_rule/recurring_year_day_spec.rb", "spec/ri_cal/property_value/recurrence_rule_spec.rb", "spec/ri_cal/property_value/text_spec.rb", "spec/ri_cal/property_value/utc_offset_spec.rb", "spec/ri_cal/property_value_spec.rb", "spec/ri_cal/required_timezones_spec.rb", "spec/ri_cal_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "tasks/gem_loader/load_active_support.rb", "tasks/gem_loader/load_tzinfo_gem.rb", "tasks/ri_cal.rake", "tasks/spec.rake"]
+ s.files = ["History.txt", "Manifest.txt", "README.txt", "Rakefile", "bin/ri_cal", "component_attributes/alarm.yml", "component_attributes/calendar.yml", "component_attributes/component_property_defs.yml", "component_attributes/event.yml", "component_attributes/freebusy.yml", "component_attributes/journal.yml", "component_attributes/timezone.yml", "component_attributes/timezone_period.yml", "component_attributes/todo.yml", "copyrights.txt", "docs/draft-ietf-calsify-2446bis-08.txt", "docs/draft-ietf-calsify-rfc2445bis-09.txt", "docs/incrementers.txt", "docs/rfc2445.pdf", "lib/ri_cal.rb", "lib/ri_cal/component.rb", "lib/ri_cal/component/alarm.rb", "lib/ri_cal/component/calendar.rb", "lib/ri_cal/component/event.rb", "lib/ri_cal/component/freebusy.rb", "lib/ri_cal/component/journal.rb", "lib/ri_cal/component/non_standard.rb", "lib/ri_cal/component/t_z_info_timezone.rb", "lib/ri_cal/component/timezone.rb", "lib/ri_cal/component/timezone/daylight_period.rb", "lib/ri_cal/component/timezone/standard_period.rb", "lib/ri_cal/component/timezone/timezone_period.rb", "lib/ri_cal/component/todo.rb", "lib/ri_cal/core_extensions.rb", "lib/ri_cal/core_extensions/array.rb", "lib/ri_cal/core_extensions/array/conversions.rb", "lib/ri_cal/core_extensions/date.rb", "lib/ri_cal/core_extensions/date/conversions.rb", "lib/ri_cal/core_extensions/date_time.rb", "lib/ri_cal/core_extensions/date_time/conversions.rb", "lib/ri_cal/core_extensions/object.rb", "lib/ri_cal/core_extensions/object/conversions.rb", "lib/ri_cal/core_extensions/string.rb", "lib/ri_cal/core_extensions/string/conversions.rb", "lib/ri_cal/core_extensions/time.rb", "lib/ri_cal/core_extensions/time/calculations.rb", "lib/ri_cal/core_extensions/time/conversions.rb", "lib/ri_cal/core_extensions/time/tzid_access.rb", "lib/ri_cal/core_extensions/time/week_day_predicates.rb", "lib/ri_cal/fast_date_time.rb", "lib/ri_cal/floating_timezone.rb", "lib/ri_cal/invalid_property_value.rb", "lib/ri_cal/invalid_timezone_identifer.rb", "lib/ri_cal/occurrence_enumerator.rb", "lib/ri_cal/occurrence_period.rb", "lib/ri_cal/parser.rb", "lib/ri_cal/properties/alarm.rb", "lib/ri_cal/properties/calendar.rb", "lib/ri_cal/properties/event.rb", "lib/ri_cal/properties/freebusy.rb", "lib/ri_cal/properties/journal.rb", "lib/ri_cal/properties/timezone.rb", "lib/ri_cal/properties/timezone_period.rb", "lib/ri_cal/properties/todo.rb", "lib/ri_cal/property_value.rb", "lib/ri_cal/property_value/array.rb", "lib/ri_cal/property_value/cal_address.rb", "lib/ri_cal/property_value/date.rb", "lib/ri_cal/property_value/date_time.rb", "lib/ri_cal/property_value/date_time/additive_methods.rb", "lib/ri_cal/property_value/date_time/time_machine.rb", "lib/ri_cal/property_value/date_time/timezone_support.rb", "lib/ri_cal/property_value/duration.rb", "lib/ri_cal/property_value/geo.rb", "lib/ri_cal/property_value/integer.rb", "lib/ri_cal/property_value/occurrence_list.rb", "lib/ri_cal/property_value/period.rb", "lib/ri_cal/property_value/recurrence_rule.rb", "lib/ri_cal/property_value/recurrence_rule/enumeration_support_methods.rb", "lib/ri_cal/property_value/recurrence_rule/enumerator.rb", "lib/ri_cal/property_value/recurrence_rule/initialization_methods.rb", "lib/ri_cal/property_value/recurrence_rule/negative_setpos_enumerator.rb", "lib/ri_cal/property_value/recurrence_rule/numbered_span.rb", "lib/ri_cal/property_value/recurrence_rule/occurence_incrementer.rb", "lib/ri_cal/property_value/recurrence_rule/recurring_day.rb", "lib/ri_cal/property_value/recurrence_rule/recurring_month_day.rb", "lib/ri_cal/property_value/recurrence_rule/recurring_numbered_week.rb", "lib/ri_cal/property_value/recurrence_rule/recurring_year_day.rb", "lib/ri_cal/property_value/recurrence_rule/validations.rb", "lib/ri_cal/property_value/text.rb", "lib/ri_cal/property_value/uri.rb", "lib/ri_cal/property_value/utc_offset.rb", "lib/ri_cal/required_timezones.rb", "performance/paris_eastern/subject.rb", "performance/penultimate_weekday/subject.rb", "performance/psm_big_enum/ical.ics", "performance/psm_big_enum/subject.rb", "performance/utah_cycling/subject.rb", "ri_cal.gemspec", "sample_ical_files/from_ical_dot_app/test1.ics", "script/benchmark_subject", "script/console", "script/destroy", "script/generate", "script/profile_subject", "script/txt2html", "spec/ri_cal/bugreports_spec.rb", "spec/ri_cal/component/alarm_spec.rb", "spec/ri_cal/component/calendar_spec.rb", "spec/ri_cal/component/event_spec.rb", "spec/ri_cal/component/freebusy_spec.rb", "spec/ri_cal/component/journal_spec.rb", "spec/ri_cal/component/t_z_info_timezone_spec.rb", "spec/ri_cal/component/timezone_spec.rb", "spec/ri_cal/component/todo_spec.rb", "spec/ri_cal/component_spec.rb", "spec/ri_cal/core_extensions/string/conversions_spec.rb", "spec/ri_cal/core_extensions/time/calculations_spec.rb", "spec/ri_cal/core_extensions/time/week_day_predicates_spec.rb", "spec/ri_cal/fast_date_time_spec.rb", "spec/ri_cal/occurrence_enumerator_spec.rb", "spec/ri_cal/parser_spec.rb", "spec/ri_cal/property_value/date_spec.rb", "spec/ri_cal/property_value/date_time_spec.rb", "spec/ri_cal/property_value/duration_spec.rb", "spec/ri_cal/property_value/occurrence_list_spec.rb", "spec/ri_cal/property_value/period_spec.rb", "spec/ri_cal/property_value/recurrence_rule/recurring_year_day_spec.rb", "spec/ri_cal/property_value/recurrence_rule_spec.rb", "spec/ri_cal/property_value/text_spec.rb", "spec/ri_cal/property_value/utc_offset_spec.rb", "spec/ri_cal/property_value_spec.rb", "spec/ri_cal/required_timezones_spec.rb", "spec/ri_cal_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "tasks/gem_loader/load_active_support.rb", "tasks/gem_loader/load_tzinfo_gem.rb", "tasks/ri_cal.rake", "tasks/spec.rake"]
s.homepage = %q{http://ri-cal.rubyforge.org/}
s.rdoc_options = ["--main", "README.txt"]
s.require_paths = ["lib"]
View
78 spec/ri_cal/bugreports_spec.rb
@@ -16,7 +16,7 @@
4@group.calendar.google.com\n\nThis is a public calendar to know what's com
ing up all around the country in the technology industry.\n\nIncludes digit
al\, internet\, web\, enterprise\, software\, hardware\, and it's various f
- lavours. \n\nFeel free to add real events. Keep it real.
+ lavours. \n\nFeel free to add real events. Keep it real.
BEGIN:VTIMEZONE
TZID:Australia/Perth
X-LIC-LOCATION:Australia/Perth
@@ -90,7 +90,7 @@
alarm.action = 'AUDIO'
end
end
-
+
lambda {event.export}.should_not raise_error
end
end
@@ -127,10 +127,10 @@
END:VEVENT
END:VCALENDAR
ENDCAL
-
+
@event = cals.first.events.first
end
-
+
it "not raise an error accessing DTSTART" do
lambda {@event.dtstart}.should_not raise_error
end
@@ -154,13 +154,77 @@
END:VFREEBUSY
END:VCALENDAR
ENDCAL
- @free_busy = cal.first.freebusys.first
+ @free_busy = cal.first.freebusys.first
end
-
+
it "should have two periods" do
@free_busy.freebusy.map {|fb| fb.to_s}.should == [
";FBTYPE=BUSY:20090705T200417Z/20090707T050000Z",
";FBTYPE=BUSY-TENTATIVE:20090711T050000Z/20090712T050000Z"
]
- end
+ end
+end
+
+describe "a calendar including vvenue" do
+ before(:each) do
+ @cal_string = <<ENDCAL
+BEGIN:VCALENDAR
+VERSION:2.0
+X-WR-CALNAME:Upcoming Event: Film in the Park
+PRODID:-//Upcoming.org/Upcoming ICS//EN
+CALSCALE:GREGORIAN
+METHOD:PUBLISH
+BEGIN:VEVENT
+DTSTART:20090807T201500
+DTEND:20090807T220000
+RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20090822T000000
+GEO:-104.997;39.546
+TRANSP:TRANSPARENT
+SUMMARY:Film in the Park
+DESCRIPTION: [Full details at http://upcoming.yahoo.com/event/3082410/ ] Plan to join the HRCA family summer tradition! Bring a blanket and enjoy great FREE family movies! Mark the dates now!
+URL;VALUE=URI:http://upcoming.yahoo.com/event/3082410/
+UID:http://upcoming.yahoo.com/event/3082410/
+DTSTAMP:20090716T103006
+LAST-UPDATED:20090716T103006
+CATEGORIES:Family
+ORGANIZER;CN=mepling95:X-ADDR:http://upcoming.yahoo.com/user/637615/
+LOCATION;VENUE-UID="http://upcoming.yahoo.com/venue/130821/":Civic Green Park @ 9370 Ridgeline Boulevard\, Highlands Ranch\, Colorado 80126 US
+END:VEVENT
+BEGIN:VVENUE
+X-VVENUE-INFO:http://evdb.com/docs/ical-venue/drft-norris-ical-venue.html
+NAME:Civic Green Park
+ADDRESS:9370 Ridgeline Boulevard
+CITY:Highlands Ranch
+REGION;X-ABBREV=co:Colorado
+COUNTRY;X-ABBREV=us:United States
+POSTALCODE:80126
+GEO:39.546;-104.997
+URL;X-LABEL=Venue Info:http://www.hrmafestival.org
+END:VVENUE
+END:VCALENDAR
+ENDCAL
+
+ @venue_str = <<ENDVENUE
+BEGIN:VVENUE
+X-VVENUE-INFO:http://evdb.com/docs/ical-venue/drft-norris-ical-venue.html
+NAME:Civic Green Park
+ADDRESS:9370 Ridgeline Boulevard
+CITY:Highlands Ranch
+REGION;X-ABBREV=co:Colorado
+COUNTRY;X-ABBREV=us:United States
+POSTALCODE:80126
+GEO:39.546;-104.997
+URL;X-LABEL=Venue Info:http://www.hrmafestival.org
+END:VVENUE
+ENDVENUE
+ end
+
+ it "should parse without error" do
+ lambda {RiCal.parse_string(@cal_string)}.should_not raise_error
+ end
+
+ it "should export correctly" do
+ export = RiCal.parse_string(@cal_string).first.export
+ export.should include(@venue_str)
+ end
end
View
2 spec/ri_cal/component_spec.rb
@@ -188,7 +188,7 @@
end
it 'should have an x_wr_calname property with the value "My Personal Calendar"' do
- @it.x_wr_calname.should == "My Personal Calendar"
+ @it.x_wr_calname.first.should == "My Personal Calendar"
end
context "event with a long description and a dsl built recurence rule" do
View
29 spec/ri_cal/parser_spec.rb
@@ -126,7 +126,7 @@ def self.describe_named_property(entity_name, prop_text, prop_name, params, valu
describe "parsing an event" do
it "should parse an event" do
parser = RiCal::Parser.new(StringIO.new("BEGIN:VEVENT"))
- RiCal::Component::Event.should_receive(:from_parser).with(parser, nil)
+ RiCal::Component::Event.should_receive(:from_parser).with(parser, nil, "VEVENT")
parser.parse
end
@@ -249,7 +249,7 @@ def self.describe_named_property(entity_name, prop_text, prop_name, params, valu
it "should parse a calendar" do
parser = RiCal::Parser.new(StringIO.new("BEGIN:VCALENDAR"))
- RiCal::Component::Calendar.should_receive(:from_parser).with(parser, nil)
+ RiCal::Component::Calendar.should_receive(:from_parser).with(parser, nil, "VCALENDAR")
parser.parse
end
@@ -280,49 +280,54 @@ def self.describe_named_property(entity_name, prop_text, prop_name, params, valu
before(:each) do
@x_props = RiCal::Parser.parse(StringIO.new("BEGIN:VCALENDAR\nX-PROP;X-FOO=Y:BAR\nEND:VCALENDAR")).first.x_properties
@x_prop = @x_props["X-PROP"]
- end
+ end
+
+ it "should be an array of length 1" do
+ @x_prop.should be_kind_of(Array)
+ @x_prop.length.should == 1
+ end
- it "should be a PropertyValue::Text" do
- @x_prop.should be_kind_of(RiCal::PropertyValue::Text)
+ it "should have a PropertyValue::Text element" do
+ @x_prop.first.should be_kind_of(RiCal::PropertyValue::Text)
end
it "should have the right value" do
- @x_prop.value.should == "BAR"
+ @x_prop.first.value.should == "BAR"
end
it "should have the right parameters" do
- @x_prop.params.should == {"X-FOO" => "Y"}
+ @x_prop.first.params.should == {"X-FOO" => "Y"}
end
end
end
it "should parse a to-do" do
parser = RiCal::Parser.new(StringIO.new("BEGIN:VTODO"))
- RiCal::Component::Todo.should_receive(:from_parser).with(parser, nil)
+ RiCal::Component::Todo.should_receive(:from_parser).with(parser, nil, "VTODO")
parser.parse
end
it "should parse a journal entry" do
parser = RiCal::Parser.new(StringIO.new("BEGIN:VJOURNAL"))
- RiCal::Component::Journal.should_receive(:from_parser).with(parser, nil)
+ RiCal::Component::Journal.should_receive(:from_parser).with(parser, nil, "VJOURNAL")
parser.parse
end
it "should parse a free/busy component" do
parser = RiCal::Parser.new(StringIO.new("BEGIN:VFREEBUSY"))
- RiCal::Component::Freebusy.should_receive(:from_parser).with(parser, nil)
+ RiCal::Component::Freebusy.should_receive(:from_parser).with(parser, nil, "VFREEBUSY")
parser.parse
end
it "should parse a timezone component" do
parser = RiCal::Parser.new(StringIO.new("BEGIN:VTIMEZONE"))
- RiCal::Component::Timezone.should_receive(:from_parser).with(parser, nil)
+ RiCal::Component::Timezone.should_receive(:from_parser).with(parser, nil, "VTIMEZONE")
parser.parse
end
it "should parse an alarm component" do
parser = RiCal::Parser.new(StringIO.new("BEGIN:VALARM"))
- RiCal::Component::Alarm.should_receive(:from_parser).with(parser, nil)
+ RiCal::Component::Alarm.should_receive(:from_parser).with(parser, nil, "VALARM")
parser.parse
end
end
View
2 website/index.html
@@ -34,7 +34,7 @@
<div class="sidebar">
<div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/ri-cal"; return false'>
<p>Get Version</p>
- <a href="http://rubyforge.org/projects/ri-cal" class="numbers">0.7.6</a>
+ <a href="http://rubyforge.org/projects/ri-cal" class="numbers">0.8.0</a>
<p>
<a href='http://www.pledgie.com/campaigns/4360'><img alt='Click here to lend your support to: ri_cal and make a donation at www.pledgie.com !' src='http://www.pledgie.com/campaigns/4360.png?skin_name=chrome' border='0' /></a>
</p>

0 comments on commit 128d820

Please sign in to comment.