ri_cal 0.7.7 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +22 -0
- data/Manifest.txt +1 -0
- data/README.txt +18 -0
- data/lib/ri_cal.rb +1 -1
- data/lib/ri_cal/component.rb +9 -7
- data/lib/ri_cal/component/calendar.rb +6 -1
- data/lib/ri_cal/component/non_standard.rb +35 -0
- data/lib/ri_cal/parser.rb +17 -13
- data/ri_cal.gemspec +3 -3
- data/spec/ri_cal/bugreports_spec.rb +71 -7
- data/spec/ri_cal/component_spec.rb +1 -1
- data/spec/ri_cal/parser_spec.rb +17 -12
- metadata +3 -2
data/History.txt
CHANGED
@@ -1,3 +1,25 @@
|
|
1
|
+
=== 0.8.0 - 11 August 2009
|
2
|
+
|
3
|
+
Minor Version Bump - There is a small potentially breaking change see section on treatment of X-properties below
|
4
|
+
|
5
|
+
* Unknown Components
|
6
|
+
|
7
|
+
Starting with version 0.8.0 RiCal will parse calendars and components which contain nonstandard components.
|
8
|
+
|
9
|
+
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.
|
10
|
+
|
11
|
+
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.
|
12
|
+
|
13
|
+
* Change to treatment of X-properties
|
14
|
+
|
15
|
+
RFC2445 allows 'non-standard' or experimental properties which property-names beginning with X. RiCal always supported parsing these.
|
16
|
+
|
17
|
+
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.
|
18
|
+
|
19
|
+
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.
|
20
|
+
|
21
|
+
THIS MAY BREAK SOME APPLICATIONS, but the adaptation should be easy.
|
22
|
+
|
1
23
|
=== 0.7.7 - 6 August 2009
|
2
24
|
- No changes other than a version number bump. github seems to have failed to notice the commit of v0.7.6
|
3
25
|
and didn't build the gem. Hopefully it will notice this one.
|
data/Manifest.txt
CHANGED
@@ -24,6 +24,7 @@ lib/ri_cal/component/calendar.rb
|
|
24
24
|
lib/ri_cal/component/event.rb
|
25
25
|
lib/ri_cal/component/freebusy.rb
|
26
26
|
lib/ri_cal/component/journal.rb
|
27
|
+
lib/ri_cal/component/non_standard.rb
|
27
28
|
lib/ri_cal/component/t_z_info_timezone.rb
|
28
29
|
lib/ri_cal/component/timezone.rb
|
29
30
|
lib/ri_cal/component/timezone/daylight_period.rb
|
data/README.txt
CHANGED
@@ -339,6 +339,24 @@ or another Enumerable method (RiCal::OccurrenceEnumerator includes Enumerable),
|
|
339
339
|
#....
|
340
340
|
end
|
341
341
|
|
342
|
+
=== Unknown Components
|
343
|
+
|
344
|
+
Starting with version 0.8.0 RiCal will parse calendars and components which contain nonstandard components.
|
345
|
+
|
346
|
+
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.
|
347
|
+
|
348
|
+
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.
|
349
|
+
|
350
|
+
=== Change to treatment of X-properties
|
351
|
+
|
352
|
+
RFC2445 allows 'non-standard' or experimental properties which property-names beginning with X. RiCal always supported parsing these.
|
353
|
+
|
354
|
+
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.
|
355
|
+
|
356
|
+
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.
|
357
|
+
|
358
|
+
THIS MAY BREAK SOME APPLICATIONS, but the adaptation should be easy.
|
359
|
+
|
342
360
|
== REQUIREMENTS:
|
343
361
|
|
344
362
|
* RiCal requires that an implementation of TZInfo::Timezone. This requirement may be satisfied by either the TzInfo gem,
|
data/lib/ri_cal.rb
CHANGED
@@ -14,7 +14,7 @@ module RiCal
|
|
14
14
|
autoload :OccurrenceEnumerator, "#{my_dir}/ri_cal/occurrence_enumerator.rb"
|
15
15
|
|
16
16
|
# :stopdoc:
|
17
|
-
VERSION = '0.
|
17
|
+
VERSION = '0.8.0'
|
18
18
|
LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
|
19
19
|
PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR
|
20
20
|
|
data/lib/ri_cal/component.rb
CHANGED
@@ -34,7 +34,7 @@ module RiCal
|
|
34
34
|
|
35
35
|
attr_accessor :imported #:nodoc:
|
36
36
|
|
37
|
-
def initialize(parent=nil, &init_block) #:nodoc:
|
37
|
+
def initialize(parent=nil, entity_name = nil, &init_block) #:nodoc:
|
38
38
|
@parent = parent
|
39
39
|
if block_given?
|
40
40
|
if init_block.arity == 1
|
@@ -81,8 +81,8 @@ module RiCal
|
|
81
81
|
{}
|
82
82
|
end
|
83
83
|
|
84
|
-
def self.from_parser(parser, parent) #:nodoc:
|
85
|
-
entity = self.new(parent)
|
84
|
+
def self.from_parser(parser, parent, entity_name) #:nodoc:
|
85
|
+
entity = self.new(parent, entity_name)
|
86
86
|
entity.imported = true
|
87
87
|
line = parser.next_separated_line
|
88
88
|
while parser.still_in(entity_name, line)
|
@@ -142,12 +142,12 @@ module RiCal
|
|
142
142
|
# return a hash of any extended properties, (i.e. those with a property name starting with "X-"
|
143
143
|
# representing an extension to the RFC 2445 specification)
|
144
144
|
def x_properties
|
145
|
-
@x_properties ||= {}
|
145
|
+
@x_properties ||= Hash.new {|h,k| h[k] = []}
|
146
146
|
end
|
147
147
|
|
148
148
|
# Add a n extended property
|
149
149
|
def add_x_property(name, prop)
|
150
|
-
x_properties[name]
|
150
|
+
x_properties[name] << prop
|
151
151
|
end
|
152
152
|
|
153
153
|
def method_missing(selector, *args, &b) #:nodoc:
|
@@ -200,8 +200,10 @@ module RiCal
|
|
200
200
|
end
|
201
201
|
|
202
202
|
def export_x_properties_to(export_stream) #:nodoc:
|
203
|
-
x_properties.each do |name,
|
204
|
-
|
203
|
+
x_properties.each do |name, props|
|
204
|
+
props.each do | prop |
|
205
|
+
export_stream.puts("#{name}:#{prop}")
|
206
|
+
end
|
205
207
|
end
|
206
208
|
end
|
207
209
|
|
@@ -9,7 +9,7 @@ module RiCal
|
|
9
9
|
include RiCal::Properties::Calendar
|
10
10
|
attr_reader :tz_source #:nodoc:
|
11
11
|
|
12
|
-
def initialize(parent=nil, &init_block) #:nodoc:
|
12
|
+
def initialize(parent=nil,entity_name = nil, &init_block) #:nodoc:
|
13
13
|
@tz_source = 'TZINFO' # Until otherwise told
|
14
14
|
super
|
15
15
|
end
|
@@ -239,6 +239,11 @@ module RiCal
|
|
239
239
|
export_subcomponent_to(export_stream, todos)
|
240
240
|
export_subcomponent_to(export_stream, journals)
|
241
241
|
export_subcomponent_to(export_stream, freebusys)
|
242
|
+
subcomponents.each do |key, value|
|
243
|
+
unless %{VEVENT VTODO VJOURNAL VFREEBUSYS}.include?(key)
|
244
|
+
export_subcomponent_to(export_stream, value)
|
245
|
+
end
|
246
|
+
end
|
242
247
|
export_stream.puts("END:VCALENDAR")
|
243
248
|
if to
|
244
249
|
nil
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), %w[.. properties alarm.rb])
|
2
|
+
|
3
|
+
module RiCal
|
4
|
+
|
5
|
+
class Component
|
6
|
+
#- ©2009 Rick DeNatale, All rights reserved. Refer to the file README.txt for the license
|
7
|
+
#
|
8
|
+
# An NonStandard component represents a component (or subcomponent) not listed in RFC2445.
|
9
|
+
# For example some icalendar data contains VVENUE components, a proposed extension to RFC2445
|
10
|
+
# which was dropped.
|
11
|
+
class NonStandard < Component
|
12
|
+
attr_reader :entity_name
|
13
|
+
|
14
|
+
def initialize(parent, entity_name)
|
15
|
+
super(parent)
|
16
|
+
@entity_name = entity_name
|
17
|
+
@source_lines = []
|
18
|
+
end
|
19
|
+
|
20
|
+
def process_line(parser, line) #:nodoc:
|
21
|
+
if line[:name] == "BEGIN"
|
22
|
+
parse_subcomponent(parser, line)
|
23
|
+
else
|
24
|
+
@source_lines << parser.last_line_str
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def export_properties_to(stream)
|
29
|
+
@source_lines.each do |line|
|
30
|
+
stream.puts(line)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
data/lib/ri_cal/parser.rb
CHANGED
@@ -3,6 +3,7 @@ module RiCal
|
|
3
3
|
#- All rights reserved. Refer to the file README.txt for the license
|
4
4
|
#
|
5
5
|
class Parser # :nodoc:
|
6
|
+
attr_reader :last_line_str #:nodoc:
|
6
7
|
def next_line #:nodoc:
|
7
8
|
result = nil
|
8
9
|
begin
|
@@ -59,11 +60,12 @@ module RiCal
|
|
59
60
|
def separate_line(string) #:nodoc:
|
60
61
|
match = string.match(/^([^;:]*)(.*)$/)
|
61
62
|
name = match[1]
|
63
|
+
@last_line_str = string
|
62
64
|
params, value = *Parser.params_and_value(match[2])
|
63
65
|
{
|
64
66
|
:name => name,
|
65
67
|
:params => params,
|
66
|
-
:value => value
|
68
|
+
:value => value,
|
67
69
|
}
|
68
70
|
end
|
69
71
|
|
@@ -97,7 +99,8 @@ module RiCal
|
|
97
99
|
result = []
|
98
100
|
while start_line = next_line
|
99
101
|
@parent_stack = []
|
100
|
-
|
102
|
+
component = parse_one(start_line, nil)
|
103
|
+
result << component if component
|
101
104
|
end
|
102
105
|
result
|
103
106
|
end
|
@@ -112,27 +115,28 @@ module RiCal
|
|
112
115
|
first_line = separate_line(start)
|
113
116
|
end
|
114
117
|
invalid unless first_line[:name] == "BEGIN"
|
115
|
-
|
118
|
+
entity_name = first_line[:value]
|
119
|
+
result = case entity_name
|
116
120
|
when "VCALENDAR"
|
117
|
-
RiCal::Component::Calendar.from_parser(self, parent_component)
|
121
|
+
RiCal::Component::Calendar.from_parser(self, parent_component, entity_name)
|
118
122
|
when "VEVENT"
|
119
|
-
RiCal::Component::Event.from_parser(self, parent_component)
|
123
|
+
RiCal::Component::Event.from_parser(self, parent_component, entity_name)
|
120
124
|
when "VTODO"
|
121
|
-
RiCal::Component::Todo.from_parser(self, parent_component)
|
125
|
+
RiCal::Component::Todo.from_parser(self, parent_component, entity_name)
|
122
126
|
when "VJOURNAL"
|
123
|
-
RiCal::Component::Journal.from_parser(self, parent_component)
|
127
|
+
RiCal::Component::Journal.from_parser(self, parent_component, entity_name)
|
124
128
|
when "VFREEBUSY"
|
125
|
-
RiCal::Component::Freebusy.from_parser(self, parent_component)
|
129
|
+
RiCal::Component::Freebusy.from_parser(self, parent_component, entity_name)
|
126
130
|
when "VTIMEZONE"
|
127
|
-
RiCal::Component::Timezone.from_parser(self, parent_component)
|
131
|
+
RiCal::Component::Timezone.from_parser(self, parent_component, entity_name)
|
128
132
|
when "VALARM"
|
129
|
-
RiCal::Component::Alarm.from_parser(self, parent_component)
|
133
|
+
RiCal::Component::Alarm.from_parser(self, parent_component, entity_name)
|
130
134
|
when "DAYLIGHT"
|
131
|
-
RiCal::Component::Timezone::DaylightPeriod.from_parser(self, parent_component)
|
135
|
+
RiCal::Component::Timezone::DaylightPeriod.from_parser(self, parent_component, entity_name)
|
132
136
|
when "STANDARD"
|
133
|
-
RiCal::Component::Timezone::StandardPeriod.from_parser(self, parent_component)
|
137
|
+
RiCal::Component::Timezone::StandardPeriod.from_parser(self, parent_component, entity_name)
|
134
138
|
else
|
135
|
-
|
139
|
+
RiCal::Component::NonStandard.from_parser(self, parent_component, entity_name)
|
136
140
|
end
|
137
141
|
@parent_stack.pop
|
138
142
|
result
|
data/ri_cal.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{ri_cal}
|
5
|
-
s.version = "0.
|
5
|
+
s.version = "0.8.0"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["author=Rick DeNatale"]
|
9
|
-
s.date = %q{2009-08-
|
9
|
+
s.date = %q{2009-08-11}
|
10
10
|
s.default_executable = %q{ri_cal}
|
11
11
|
s.description = %q{A new Ruby implementation of RFC2445 iCalendar.
|
12
12
|
|
@@ -19,7 +19,7 @@ A Google group for discussion of this library has been set up http://groups.goog
|
|
19
19
|
s.email = ["rick.denatale@gmail.com"]
|
20
20
|
s.executables = ["ri_cal"]
|
21
21
|
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"]
|
22
|
-
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"]
|
22
|
+
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"]
|
23
23
|
s.homepage = %q{http://ri-cal.rubyforge.org/}
|
24
24
|
s.rdoc_options = ["--main", "README.txt"]
|
25
25
|
s.require_paths = ["lib"]
|
@@ -16,7 +16,7 @@ X-WR-CALDESC:TO ADD EVENTS INVITE THIS ADDRESS\;\npf44opfb12hherild7h2pl11b
|
|
16
16
|
4@group.calendar.google.com\n\nThis is a public calendar to know what's com
|
17
17
|
ing up all around the country in the technology industry.\n\nIncludes digit
|
18
18
|
al\, internet\, web\, enterprise\, software\, hardware\, and it's various f
|
19
|
-
lavours. \n\nFeel free to add real events. Keep it real.
|
19
|
+
lavours. \n\nFeel free to add real events. Keep it real.
|
20
20
|
BEGIN:VTIMEZONE
|
21
21
|
TZID:Australia/Perth
|
22
22
|
X-LIC-LOCATION:Australia/Perth
|
@@ -90,7 +90,7 @@ describe "http://rick_denatale.lighthouseapp.com/projects/30941/tickets/18" do
|
|
90
90
|
alarm.action = 'AUDIO'
|
91
91
|
end
|
92
92
|
end
|
93
|
-
|
93
|
+
|
94
94
|
lambda {event.export}.should_not raise_error
|
95
95
|
end
|
96
96
|
end
|
@@ -127,10 +127,10 @@ DESCRIPTION:Some event
|
|
127
127
|
END:VEVENT
|
128
128
|
END:VCALENDAR
|
129
129
|
ENDCAL
|
130
|
-
|
130
|
+
|
131
131
|
@event = cals.first.events.first
|
132
132
|
end
|
133
|
-
|
133
|
+
|
134
134
|
it "not raise an error accessing DTSTART" do
|
135
135
|
lambda {@event.dtstart}.should_not raise_error
|
136
136
|
end
|
@@ -154,13 +154,77 @@ FREEBUSY;FBTYPE=BUSY-TENTATIVE:20090711T050000Z/20090712T050000Z
|
|
154
154
|
END:VFREEBUSY
|
155
155
|
END:VCALENDAR
|
156
156
|
ENDCAL
|
157
|
-
@free_busy = cal.first.freebusys.first
|
157
|
+
@free_busy = cal.first.freebusys.first
|
158
158
|
end
|
159
|
-
|
159
|
+
|
160
160
|
it "should have two periods" do
|
161
161
|
@free_busy.freebusy.map {|fb| fb.to_s}.should == [
|
162
162
|
";FBTYPE=BUSY:20090705T200417Z/20090707T050000Z",
|
163
163
|
";FBTYPE=BUSY-TENTATIVE:20090711T050000Z/20090712T050000Z"
|
164
164
|
]
|
165
|
-
end
|
165
|
+
end
|
166
|
+
end
|
167
|
+
|
168
|
+
describe "a calendar including vvenue" do
|
169
|
+
before(:each) do
|
170
|
+
@cal_string = <<ENDCAL
|
171
|
+
BEGIN:VCALENDAR
|
172
|
+
VERSION:2.0
|
173
|
+
X-WR-CALNAME:Upcoming Event: Film in the Park
|
174
|
+
PRODID:-//Upcoming.org/Upcoming ICS//EN
|
175
|
+
CALSCALE:GREGORIAN
|
176
|
+
METHOD:PUBLISH
|
177
|
+
BEGIN:VEVENT
|
178
|
+
DTSTART:20090807T201500
|
179
|
+
DTEND:20090807T220000
|
180
|
+
RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20090822T000000
|
181
|
+
GEO:-104.997;39.546
|
182
|
+
TRANSP:TRANSPARENT
|
183
|
+
SUMMARY:Film in the Park
|
184
|
+
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!
|
185
|
+
URL;VALUE=URI:http://upcoming.yahoo.com/event/3082410/
|
186
|
+
UID:http://upcoming.yahoo.com/event/3082410/
|
187
|
+
DTSTAMP:20090716T103006
|
188
|
+
LAST-UPDATED:20090716T103006
|
189
|
+
CATEGORIES:Family
|
190
|
+
ORGANIZER;CN=mepling95:X-ADDR:http://upcoming.yahoo.com/user/637615/
|
191
|
+
LOCATION;VENUE-UID="http://upcoming.yahoo.com/venue/130821/":Civic Green Park @ 9370 Ridgeline Boulevard\, Highlands Ranch\, Colorado 80126 US
|
192
|
+
END:VEVENT
|
193
|
+
BEGIN:VVENUE
|
194
|
+
X-VVENUE-INFO:http://evdb.com/docs/ical-venue/drft-norris-ical-venue.html
|
195
|
+
NAME:Civic Green Park
|
196
|
+
ADDRESS:9370 Ridgeline Boulevard
|
197
|
+
CITY:Highlands Ranch
|
198
|
+
REGION;X-ABBREV=co:Colorado
|
199
|
+
COUNTRY;X-ABBREV=us:United States
|
200
|
+
POSTALCODE:80126
|
201
|
+
GEO:39.546;-104.997
|
202
|
+
URL;X-LABEL=Venue Info:http://www.hrmafestival.org
|
203
|
+
END:VVENUE
|
204
|
+
END:VCALENDAR
|
205
|
+
ENDCAL
|
206
|
+
|
207
|
+
@venue_str = <<ENDVENUE
|
208
|
+
BEGIN:VVENUE
|
209
|
+
X-VVENUE-INFO:http://evdb.com/docs/ical-venue/drft-norris-ical-venue.html
|
210
|
+
NAME:Civic Green Park
|
211
|
+
ADDRESS:9370 Ridgeline Boulevard
|
212
|
+
CITY:Highlands Ranch
|
213
|
+
REGION;X-ABBREV=co:Colorado
|
214
|
+
COUNTRY;X-ABBREV=us:United States
|
215
|
+
POSTALCODE:80126
|
216
|
+
GEO:39.546;-104.997
|
217
|
+
URL;X-LABEL=Venue Info:http://www.hrmafestival.org
|
218
|
+
END:VVENUE
|
219
|
+
ENDVENUE
|
220
|
+
end
|
221
|
+
|
222
|
+
it "should parse without error" do
|
223
|
+
lambda {RiCal.parse_string(@cal_string)}.should_not raise_error
|
224
|
+
end
|
225
|
+
|
226
|
+
it "should export correctly" do
|
227
|
+
export = RiCal.parse_string(@cal_string).first.export
|
228
|
+
export.should include(@venue_str)
|
229
|
+
end
|
166
230
|
end
|
@@ -188,7 +188,7 @@ describe RiCal::Component do
|
|
188
188
|
end
|
189
189
|
|
190
190
|
it 'should have an x_wr_calname property with the value "My Personal Calendar"' do
|
191
|
-
@it.x_wr_calname.should == "My Personal Calendar"
|
191
|
+
@it.x_wr_calname.first.should == "My Personal Calendar"
|
192
192
|
end
|
193
193
|
|
194
194
|
context "event with a long description and a dsl built recurence rule" do
|
data/spec/ri_cal/parser_spec.rb
CHANGED
@@ -126,7 +126,7 @@ describe RiCal::Parser do
|
|
126
126
|
describe "parsing an event" do
|
127
127
|
it "should parse an event" do
|
128
128
|
parser = RiCal::Parser.new(StringIO.new("BEGIN:VEVENT"))
|
129
|
-
RiCal::Component::Event.should_receive(:from_parser).with(parser, nil)
|
129
|
+
RiCal::Component::Event.should_receive(:from_parser).with(parser, nil, "VEVENT")
|
130
130
|
parser.parse
|
131
131
|
end
|
132
132
|
|
@@ -249,7 +249,7 @@ describe RiCal::Parser do
|
|
249
249
|
|
250
250
|
it "should parse a calendar" do
|
251
251
|
parser = RiCal::Parser.new(StringIO.new("BEGIN:VCALENDAR"))
|
252
|
-
RiCal::Component::Calendar.should_receive(:from_parser).with(parser, nil)
|
252
|
+
RiCal::Component::Calendar.should_receive(:from_parser).with(parser, nil, "VCALENDAR")
|
253
253
|
parser.parse
|
254
254
|
end
|
255
255
|
|
@@ -280,49 +280,54 @@ describe RiCal::Parser do
|
|
280
280
|
before(:each) do
|
281
281
|
@x_props = RiCal::Parser.parse(StringIO.new("BEGIN:VCALENDAR\nX-PROP;X-FOO=Y:BAR\nEND:VCALENDAR")).first.x_properties
|
282
282
|
@x_prop = @x_props["X-PROP"]
|
283
|
-
end
|
283
|
+
end
|
284
|
+
|
285
|
+
it "should be an array of length 1" do
|
286
|
+
@x_prop.should be_kind_of(Array)
|
287
|
+
@x_prop.length.should == 1
|
288
|
+
end
|
284
289
|
|
285
|
-
it "should
|
286
|
-
@x_prop.should be_kind_of(RiCal::PropertyValue::Text)
|
290
|
+
it "should have a PropertyValue::Text element" do
|
291
|
+
@x_prop.first.should be_kind_of(RiCal::PropertyValue::Text)
|
287
292
|
end
|
288
293
|
|
289
294
|
it "should have the right value" do
|
290
|
-
@x_prop.value.should == "BAR"
|
295
|
+
@x_prop.first.value.should == "BAR"
|
291
296
|
end
|
292
297
|
|
293
298
|
it "should have the right parameters" do
|
294
|
-
@x_prop.params.should == {"X-FOO" => "Y"}
|
299
|
+
@x_prop.first.params.should == {"X-FOO" => "Y"}
|
295
300
|
end
|
296
301
|
end
|
297
302
|
end
|
298
303
|
|
299
304
|
it "should parse a to-do" do
|
300
305
|
parser = RiCal::Parser.new(StringIO.new("BEGIN:VTODO"))
|
301
|
-
RiCal::Component::Todo.should_receive(:from_parser).with(parser, nil)
|
306
|
+
RiCal::Component::Todo.should_receive(:from_parser).with(parser, nil, "VTODO")
|
302
307
|
parser.parse
|
303
308
|
end
|
304
309
|
|
305
310
|
it "should parse a journal entry" do
|
306
311
|
parser = RiCal::Parser.new(StringIO.new("BEGIN:VJOURNAL"))
|
307
|
-
RiCal::Component::Journal.should_receive(:from_parser).with(parser, nil)
|
312
|
+
RiCal::Component::Journal.should_receive(:from_parser).with(parser, nil, "VJOURNAL")
|
308
313
|
parser.parse
|
309
314
|
end
|
310
315
|
|
311
316
|
it "should parse a free/busy component" do
|
312
317
|
parser = RiCal::Parser.new(StringIO.new("BEGIN:VFREEBUSY"))
|
313
|
-
RiCal::Component::Freebusy.should_receive(:from_parser).with(parser, nil)
|
318
|
+
RiCal::Component::Freebusy.should_receive(:from_parser).with(parser, nil, "VFREEBUSY")
|
314
319
|
parser.parse
|
315
320
|
end
|
316
321
|
|
317
322
|
it "should parse a timezone component" do
|
318
323
|
parser = RiCal::Parser.new(StringIO.new("BEGIN:VTIMEZONE"))
|
319
|
-
RiCal::Component::Timezone.should_receive(:from_parser).with(parser, nil)
|
324
|
+
RiCal::Component::Timezone.should_receive(:from_parser).with(parser, nil, "VTIMEZONE")
|
320
325
|
parser.parse
|
321
326
|
end
|
322
327
|
|
323
328
|
it "should parse an alarm component" do
|
324
329
|
parser = RiCal::Parser.new(StringIO.new("BEGIN:VALARM"))
|
325
|
-
RiCal::Component::Alarm.should_receive(:from_parser).with(parser, nil)
|
330
|
+
RiCal::Component::Alarm.should_receive(:from_parser).with(parser, nil, "VALARM")
|
326
331
|
parser.parse
|
327
332
|
end
|
328
333
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ri_cal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- author=Rick DeNatale
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-08-
|
12
|
+
date: 2009-08-11 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -92,6 +92,7 @@ files:
|
|
92
92
|
- lib/ri_cal/component/event.rb
|
93
93
|
- lib/ri_cal/component/freebusy.rb
|
94
94
|
- lib/ri_cal/component/journal.rb
|
95
|
+
- lib/ri_cal/component/non_standard.rb
|
95
96
|
- lib/ri_cal/component/t_z_info_timezone.rb
|
96
97
|
- lib/ri_cal/component/timezone.rb
|
97
98
|
- lib/ri_cal/component/timezone/daylight_period.rb
|