rubyredrick-ri_cal 0.7.4 → 0.7.5

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,36 +1,43 @@
1
+ === 0.7.5 - 3 August 2009
2
+ - fixed http://rick_denatale.lighthouseapp.com/projects/30941/tickets/19
3
+ Microsoft ical exports double quote tzid values in parameters, which caused a failure to find VTIMEZONES
4
+ This exposed an issue with parameter parsing. Did the simplest thing which could work which was to
5
+ strip the quotes. Need to BOLO for other pathological cases showing up in future, which may require
6
+ smarter parameter parsing.
7
+
1
8
  === 0.7.4 - 21 July 2009
2
- * fixed http://rick_denatale.lighthouseapp.com/projects/30941/tickets/17
9
+ - fixed http://rick_denatale.lighthouseapp.com/projects/30941/tickets/17
3
10
  Problem with Alarm trigger property value
4
- * fixed http://rick_denatale.lighthouseapp.com/projects/30941/tickets/18
11
+ - fixed http://rick_denatale.lighthouseapp.com/projects/30941/tickets/18
5
12
  Problem with exporting components with sub-components
6
13
  === 0.7.3 - 13 July 2009
7
14
  Added pointers to rdoc in README
8
15
  === 0.7.2 - 6 July 2009
9
16
  updated to use newest versions of newgem and hoe, in order to make run-code-run work again
10
17
  === 0.7.1 - 6 July 2009
11
- * fixed http://rick_denatale.lighthouseapp.com/projects/30941/tickets/15
18
+ - fixed http://rick_denatale.lighthouseapp.com/projects/30941/tickets/15
12
19
  duration validation issues
13
- * fixed http://rick_denatale.lighthouseapp.com/projects/30941/tickets/16
20
+ - fixed http://rick_denatale.lighthouseapp.com/projects/30941/tickets/16
14
21
  event finish_time loses timezone info when event has a dtstart and duration
15
22
  === 0.7.0 - 29 June 2009
16
- * fixed http://rick_denatale.lighthouseapp.com/projects/30941/tickets/14
23
+ - fixed http://rick_denatale.lighthouseapp.com/projects/30941/tickets/14
17
24
  component without recurrence properties should enumerate just itself only if it is within the period between starting and before
18
- * added the :overlapping option to OccurrenceEnumerator#occurrences - Allows the enumeration of occurrences which are either partiall or completely within a timespan given by a pair of Dates/Times/DateTimes
19
- * Fixed some Ruby 1.9 incompatibilities
20
- * Added some new rake tasks to run specs under multi-ruby
25
+ - added the :overlapping option to OccurrenceEnumerator#occurrences - Allows the enumeration of occurrences which are either partiall or completely within a timespan given by a pair of Dates/Times/DateTimes
26
+ - Fixed some Ruby 1.9 incompatibilities
27
+ - Added some new rake tasks to run specs under multi-ruby
21
28
  === 0.6.3 - 14 June 2009
22
- * Fixed http://rick_denatale.lighthouseapp.com/projects/30941-ri_cal/tickets/13
29
+ - Fixed http://rick_denatale.lighthouseapp.com/projects/30941-ri_cal/tickets/13
23
30
  tzinfotimezones-with-no-transitions-fail-on-export
24
31
  === 0.6.2 - 11 June 2009
25
- * Fixed http://rick_denatale.lighthouseapp.com/projects/30941-ri_cal/tickets/12
32
+ - Fixed http://rick_denatale.lighthouseapp.com/projects/30941-ri_cal/tickets/12
26
33
  export-failure-for-unbounded-tzinfo-timezone
27
34
  === 0.6.1 - 6 June 2009
28
- * Fixed problem with file which loads activesupport for the rake spec:with_activesupport task, it now
35
+ - Fixed problem with file which loads activesupport for the rake spec:with_activesupport task, it now
29
36
  requires >=2.2 instead of <=2.2 - Thanks to Paul Scott-Murphy for finding this.
30
37
  === 0.6.0 - 5 June 2009
31
38
  Time for a minor version bump.
32
- * Improved overall enumeration performance bypassing most of the effects of the poor performance of Ruby's DateTime class.
33
- * Added a framework for performance monitoring during development.
39
+ - Improved overall enumeration performance bypassing most of the effects of the poor performance of Ruby's DateTime class.
40
+ - Added a framework for performance monitoring during development.
34
41
  - New performance directory with subdirs for code to be monitored for performance (subjects)
35
42
  - New script files:
36
43
  script/benchmark_subject runs a ruby benchmark on one performance subject
@@ -39,61 +46,60 @@
39
46
  performance:benchmark runs benchmarks against all subjects in the performance directory and produces a consolidated output file in performance_data/benchmarks.out
40
47
  performance:profile runs script/profile_subject against all subjects in the performance directory.
41
48
  === 0.5.3 - 1 June, 2009
42
- * Improved performance of time zone enumeration, TimeZonePeriod now caches occurrences
43
- * Added a profiling directory which contains ruby programs which benchmark and/or profile performance
49
+ - Improved performance of time zone enumeration, TimeZonePeriod now caches occurrences
50
+ - Added a profiling directory which contains ruby programs which benchmark and/or profile performance
44
51
  === 0.5.2
45
- * Fixed http://rick_denatale.lighthouseapp.com/projects/30941/tickets/11
52
+ - Fixed http://rick_denatale.lighthouseapp.com/projects/30941/tickets/11
46
53
  Export folding is not UTF-8 Safe
47
54
  === 0.5.1
48
- * Fixed README to acknowledge release on RubyForge
55
+ - Fixed README to acknowledge release on RubyForge
49
56
  === 0.5.0 rubyforge release candidate Tue May 26 10:26:43 2009 -0400
50
- * Added OccurrenceEnumerator#zulu_occurrence_range
57
+ - Added OccurrenceEnumerator#zulu_occurrence_range
51
58
  === 0.0.11 Sat May 23 18:24:57 2009 -0400
52
- * Fixed http://rick_denatale.lighthouseapp.com/projects/30941/tickets/5
53
- * Fixed http://rick_denatale.lighthouseapp.com/projects/30941/tickets/9
59
+ - Fixed http://rick_denatale.lighthouseapp.com/projects/30941/tickets/5
60
+ - Fixed http://rick_denatale.lighthouseapp.com/projects/30941/tickets/9
54
61
  === 0.0.10
55
- * Fixed http://rick_denatale.lighthouseapp.com/projects/30941/tickets/8
62
+ - Fixed http://rick_denatale.lighthouseapp.com/projects/30941/tickets/8
56
63
  === 0.0.9
57
- * Fixed http://rick_denatale.lighthouseapp.com/projects/30941/tickets/4
64
+ - Fixed http://rick_denatale.lighthouseapp.com/projects/30941/tickets/4
58
65
  Missing comparison methods in PropertyValue::Date
59
- * Fixed http://rick_denatale.lighthouseapp.com/projects/30941/tickets/6
66
+ - Fixed http://rick_denatale.lighthouseapp.com/projects/30941/tickets/6
60
67
  Type of dtstart and dtend (DATE or DATETIME) now preserved on enumeration
61
68
  === 0.0.8
62
- * Fixed http://rick_denatale.lighthouseapp.com/projects/30941-ri_cal/tickets/1
69
+ - Fixed http://rick_denatale.lighthouseapp.com/projects/30941-ri_cal/tickets/1
63
70
  EXDATE and RDATE now pick up the timezone from DateTime, Time, and TimeWithZone values
64
- * Fixed http://rick_denatale.lighthouseapp.com/projects/30941/tickets/2
71
+ - Fixed http://rick_denatale.lighthouseapp.com/projects/30941/tickets/2
65
72
  Missing arithmetic methods in PropertyValue::Date
66
- * Fixed http://rick_denatale.lighthouseapp.com/projects/30941/tickets/3
73
+ - Fixed http://rick_denatale.lighthouseapp.com/projects/30941/tickets/3
67
74
  Components with no recurrence rules or rdate properties failed on enumeration, they now
68
75
  will enumerate a single occurrence
69
76
  === 0.0.7
70
- * Fixed a bug relating to properly recognizing ActiveRecord::TimeWithZone
71
- * DATETIME propertyvalues will now return an instance of TimeWithZone instead of DateTime when
77
+ - Fixed a bug relating to properly recognizing ActiveRecord::TimeWithZone
78
+ - DATETIME propertyvalues will now return an instance of TimeWithZone instead of DateTime when
72
79
  activesupport is present, and it is appropriate. See the README for details
73
80
  === 0.0.6
74
- * Added rake tasks to run specs with either the tzinfo gem or activesupport (<=2.2)
75
- * Default rake task now runs both of these
81
+ - Added rake tasks to run specs with either the tzinfo gem or activesupport (<=2.2)
82
+ - Default rake task now runs both of these
76
83
  === 0.0.5
77
- * Fixed a bug in occurrence enumeration reported by paulsm on github
84
+ - Fixed a bug in occurrence enumeration reported by paulsm on github
78
85
  === 0.0.4
79
- * Fixed a bug in imported timezones reported by paulsm on github
86
+ - Fixed a bug in imported timezones reported by paulsm on github
80
87
  === 0.0.3
81
- * Added tzid method to Ruby Time and DateTime instances, and to ActiveRecord::TimeWithZone if it is defined this method is used to determine the desired
88
+ - Added tzid method to Ruby Time and DateTime instances, and to ActiveRecord::TimeWithZone if it is defined this method is used to determine the desired
82
89
  timezone when an instance of one of these classes is given as the value of a datetime property. If the tzid is nil then the default tzid is used,
83
90
  if it is set to :floating then the property will be a floating time.
84
- * Removed the ability to pass an array with a tzid string and a date-time since the above made it unnecessary
85
- * The ruby datetime property returned from the ruby_value method on the DateTime property will return an instance of ::DateTime with:
86
- ** The proper utc offset
87
- ** The tzid set to the right tzid
88
- * Made exdate/rdate building possible
89
- * Added a default_tzid attribute to the Calendar component, if this attribute is not set for a particular calendar it will delegate to the default set
91
+ - Removed the ability to pass an array with a tzid string and a date-time since the above made it unnecessary
92
+ - The ruby datetime property returned from the ruby_value method on the DateTime property will return an instance of ::DateTime with:
93
+ -- The proper utc offset
94
+ -- The tzid set to the right tzid
95
+ - Made exdate/rdate building possible
96
+ - Added a default_tzid attribute to the Calendar component, if this attribute is not set for a particular calendar it will delegate to the default set
90
97
  for the DateTime property class.
91
- * Added fix patches from
92
- ** http://github.com/kjwierenga/ri_cal
93
- ** http://github.com/wesmaldonado/ri_cal
98
+ - Added fix patches from
99
+ -- http://github.com/kjwierenga/ri_cal
100
+ -- http://github.com/wesmaldonado/ri_cal
94
101
 
95
102
  === 0.0.2
96
- * Fixed gemspec
103
+ - Fixed gemspec
97
104
  == 0.0.1
98
-
99
- * Initial public release
105
+ - Initial public release
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.7.4'
17
+ VERSION = '0.7.5'
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/parser.rb CHANGED
@@ -24,7 +24,10 @@ module RiCal
24
24
  string.split(";").inject({}) { |result, val|
25
25
  m = /^(.+)=(.+)$/.match(val)
26
26
  raise "Invalid parameter value #{val.inspect}" unless m
27
- result[m[1]] = m[2]
27
+ #TODO - The gsub below is a simplest fix for http://rick_denatale.lighthouseapp.com/projects/30941/tickets/19
28
+ # it may need further examination if more pathological cases show up.
29
+ param_val = m[2].sub(/^\"(.*)\"$/, '\1')
30
+ result[m[1]] = param_val
28
31
  result
29
32
  }
30
33
  else
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.7.4"
5
+ s.version = "0.7.5"
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-07-21}
9
+ s.date = %q{2009-08-03}
10
10
  s.default_executable = %q{ri_cal}
11
11
  s.description = %q{A new Ruby implementation of RFC2445 iCalendar.
12
12
 
@@ -93,4 +93,45 @@ describe "http://rick_denatale.lighthouseapp.com/projects/30941/tickets/18" do
93
93
 
94
94
  lambda {event.export}.should_not raise_error
95
95
  end
96
+ end
97
+
98
+ describe "http://rick_denatale.lighthouseapp.com/projects/30941/tickets/19" do
99
+ before(:each) do
100
+ cals = RiCal.parse_string(<<-ENDCAL)
101
+ BEGIN:VCALENDAR
102
+ METHOD:REQUEST
103
+ PRODID:Microsoft CDO for Microsoft Exchange
104
+ VERSION:2.0
105
+ BEGIN:VTIMEZONE
106
+ TZID:(GMT-05.00) Eastern Time (US & Canada)
107
+ X-MICROSOFT-CDO-TZID:10
108
+ BEGIN:STANDARD
109
+ DTSTART:16010101T020000
110
+ TZOFFSETFROM:-0400
111
+ TZOFFSETTO:-0500
112
+ RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=11;BYDAY=1SU
113
+ END:STANDARD
114
+ BEGIN:DAYLIGHT
115
+ DTSTART:16010101T020000
116
+ TZOFFSETFROM:-0500
117
+ TZOFFSETTO:-0400
118
+ RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=3;BYDAY=2SU
119
+ END:DAYLIGHT
120
+ END:VTIMEZONE
121
+ BEGIN:VEVENT
122
+ DTSTAMP:20090724T143205Z
123
+ DTSTART;TZID="(GMT-05.00) Eastern Time (US & Canada)":20090804T120000
124
+ SUMMARY:FW: ALL HANDS MEETING
125
+ DTEND;TZID="(GMT-05.00) Eastern Time (US & Canada)":20090804T133000
126
+ DESCRIPTION:Some event
127
+ END:VEVENT
128
+ END:VCALENDAR
129
+ ENDCAL
130
+
131
+ @event = cals.first.events.first
132
+ end
133
+
134
+ it "not raise an error accessing DTSTART" do
135
+ lambda {@event.dtstart}.should_not raise_error
136
+ end
96
137
  end
@@ -4,6 +4,26 @@ require File.join(File.dirname(__FILE__), %w[.. spec_helper])
4
4
 
5
5
  describe RiCal::Parser do
6
6
 
7
+ context ".separate_line" do
8
+ it "should work" do
9
+ RiCal::Parser.new.separate_line("DTSTART;TZID=America/New_York:20090804T120000").should == {
10
+ :name => "DTSTART",
11
+ :params => {"TZID" => "America/New_York"},
12
+ :value => "20090804T120000"
13
+ }
14
+ end
15
+ end
16
+
17
+ context ".params_and_value" do
18
+ it "should separate parameters and values" do
19
+ RiCal::Parser.params_and_value(";TZID=(GMT-05.00) Eastern Time (US & Canada):20090804T120000").should == [{"TZID" => "(GMT-05.00) Eastern Time (US & Canada)"}, "20090804T120000"]
20
+ end
21
+
22
+ it "should strip surrounding quotes" do
23
+ RiCal::Parser.params_and_value(";TZID=\"(GMT-05.00) Eastern Time (US & Canada)\":20090804T120000").should == [{"TZID" => "(GMT-05.00) Eastern Time (US & Canada)"}, "20090804T120000"]
24
+ end
25
+ end
26
+
7
27
  def self.describe_property(entity_name, prop_name, params, value, type = RiCal::PropertyValue::Text)
8
28
  describe_named_property(entity_name, prop_name, prop_name, params, value, false, type)
9
29
  end
@@ -16,6 +36,12 @@ describe RiCal::Parser do
16
36
  ruby_value_name = prop_name.tr("-", "_").downcase
17
37
  ruby_prop_name = "#{prop_text.tr('-', '_').downcase}_property"
18
38
  expected_ruby_value = type.convert(nil, value).ruby_value
39
+ expected_params = {}
40
+ params.each do |key, parm_value|
41
+ # strip surrounding quotes from values
42
+ expected_params[key] = parm_value.sub(/^\"(.*)\"$/, '\1')
43
+ end
44
+
19
45
  describe "#{prop_name} with value of #{value.inspect}" do
20
46
  parse_input = params.inject("BEGIN:#{entity_name.upcase}\n#{prop_text.upcase}") { |pi, assoc| "#{pi};#{assoc[0]}=#{assoc[1]}"}
21
47
  parse_input = "#{parse_input}:#{value.to_rfc2445_string}\nEND:#{entity_name.upcase}"
@@ -48,7 +74,7 @@ describe RiCal::Parser do
48
74
  end
49
75
 
50
76
  it "should have the right parameters" do
51
- params.each do | key, value |
77
+ expected_params.each do | key, value |
52
78
  @prop.params[key].should == value
53
79
  end
54
80
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubyredrick-ri_cal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.4
4
+ version: 0.7.5
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-07-21 00:00:00 -07:00
12
+ date: 2009-08-03 00:00:00 -07:00
13
13
  default_executable: ri_cal
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -199,6 +199,7 @@ files:
199
199
  - tasks/spec.rake
200
200
  has_rdoc: false
201
201
  homepage: http://ri-cal.rubyforge.org/
202
+ licenses:
202
203
  post_install_message:
203
204
  rdoc_options:
204
205
  - --main
@@ -220,7 +221,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
220
221
  requirements: []
221
222
 
222
223
  rubyforge_project: ri-cal
223
- rubygems_version: 1.2.0
224
+ rubygems_version: 1.3.5
224
225
  signing_key:
225
226
  specification_version: 3
226
227
  summary: A new Ruby implementation of RFC2445 iCalendar