rubyredrick-ri_cal 0.7.5 → 0.7.7

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,38 +1,44 @@
1
+ === 0.7.7 - 6 August 2009
2
+ - No changes other than a version number bump. github seems to have failed to notice the commit of v0.7.6
3
+ and didn't build the gem. Hopefully it will notice this one.
4
+ === 0.7.6 - 6 August 2009
5
+ - Fixes http://rick_denatale.lighthouseapp.com/projects/30941/tickets/20
6
+ RiCal::PropertyValue::Period was returning a nil ruby value.
1
7
  === 0.7.5 - 3 August 2009
2
- - fixed http://rick_denatale.lighthouseapp.com/projects/30941/tickets/19
8
+ - Fixes http://rick_denatale.lighthouseapp.com/projects/30941/tickets/19
3
9
  Microsoft ical exports double quote tzid values in parameters, which caused a failure to find VTIMEZONES
4
10
  This exposed an issue with parameter parsing. Did the simplest thing which could work which was to
5
11
  strip the quotes. Need to BOLO for other pathological cases showing up in future, which may require
6
12
  smarter parameter parsing.
7
13
 
8
14
  === 0.7.4 - 21 July 2009
9
- - fixed http://rick_denatale.lighthouseapp.com/projects/30941/tickets/17
15
+ - Fixes http://rick_denatale.lighthouseapp.com/projects/30941/tickets/17
10
16
  Problem with Alarm trigger property value
11
- - fixed http://rick_denatale.lighthouseapp.com/projects/30941/tickets/18
17
+ - Fixes http://rick_denatale.lighthouseapp.com/projects/30941/tickets/18
12
18
  Problem with exporting components with sub-components
13
19
  === 0.7.3 - 13 July 2009
14
20
  Added pointers to rdoc in README
15
21
  === 0.7.2 - 6 July 2009
16
22
  updated to use newest versions of newgem and hoe, in order to make run-code-run work again
17
23
  === 0.7.1 - 6 July 2009
18
- - fixed http://rick_denatale.lighthouseapp.com/projects/30941/tickets/15
24
+ - Fixes http://rick_denatale.lighthouseapp.com/projects/30941/tickets/15
19
25
  duration validation issues
20
- - fixed http://rick_denatale.lighthouseapp.com/projects/30941/tickets/16
26
+ - Fixes http://rick_denatale.lighthouseapp.com/projects/30941/tickets/16
21
27
  event finish_time loses timezone info when event has a dtstart and duration
22
28
  === 0.7.0 - 29 June 2009
23
- - fixed http://rick_denatale.lighthouseapp.com/projects/30941/tickets/14
29
+ - Fixes http://rick_denatale.lighthouseapp.com/projects/30941/tickets/14
24
30
  component without recurrence properties should enumerate just itself only if it is within the period between starting and before
25
31
  - 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
32
+ - Fixes some Ruby 1.9 incompatibilities
27
33
  - Added some new rake tasks to run specs under multi-ruby
28
34
  === 0.6.3 - 14 June 2009
29
- - Fixed http://rick_denatale.lighthouseapp.com/projects/30941-ri_cal/tickets/13
35
+ - Fixes http://rick_denatale.lighthouseapp.com/projects/30941-ri_cal/tickets/13
30
36
  tzinfotimezones-with-no-transitions-fail-on-export
31
37
  === 0.6.2 - 11 June 2009
32
- - Fixed http://rick_denatale.lighthouseapp.com/projects/30941-ri_cal/tickets/12
38
+ - Fixes http://rick_denatale.lighthouseapp.com/projects/30941-ri_cal/tickets/12
33
39
  export-failure-for-unbounded-tzinfo-timezone
34
40
  === 0.6.1 - 6 June 2009
35
- - Fixed problem with file which loads activesupport for the rake spec:with_activesupport task, it now
41
+ - Fixes problem with file which loads activesupport for the rake spec:with_activesupport task, it now
36
42
  requires >=2.2 instead of <=2.2 - Thanks to Paul Scott-Murphy for finding this.
37
43
  === 0.6.0 - 5 June 2009
38
44
  Time for a minor version bump.
@@ -49,41 +55,41 @@
49
55
  - Improved performance of time zone enumeration, TimeZonePeriod now caches occurrences
50
56
  - Added a profiling directory which contains ruby programs which benchmark and/or profile performance
51
57
  === 0.5.2
52
- - Fixed http://rick_denatale.lighthouseapp.com/projects/30941/tickets/11
58
+ - Fixes http://rick_denatale.lighthouseapp.com/projects/30941/tickets/11
53
59
  Export folding is not UTF-8 Safe
54
60
  === 0.5.1
55
- - Fixed README to acknowledge release on RubyForge
61
+ - Fixes README to acknowledge release on RubyForge
56
62
  === 0.5.0 rubyforge release candidate Tue May 26 10:26:43 2009 -0400
57
63
  - Added OccurrenceEnumerator#zulu_occurrence_range
58
64
  === 0.0.11 Sat May 23 18:24:57 2009 -0400
59
- - Fixed http://rick_denatale.lighthouseapp.com/projects/30941/tickets/5
60
- - Fixed http://rick_denatale.lighthouseapp.com/projects/30941/tickets/9
65
+ - Fixes http://rick_denatale.lighthouseapp.com/projects/30941/tickets/5
66
+ - Fixes http://rick_denatale.lighthouseapp.com/projects/30941/tickets/9
61
67
  === 0.0.10
62
- - Fixed http://rick_denatale.lighthouseapp.com/projects/30941/tickets/8
68
+ - Fixes http://rick_denatale.lighthouseapp.com/projects/30941/tickets/8
63
69
  === 0.0.9
64
- - Fixed http://rick_denatale.lighthouseapp.com/projects/30941/tickets/4
70
+ - Fixes http://rick_denatale.lighthouseapp.com/projects/30941/tickets/4
65
71
  Missing comparison methods in PropertyValue::Date
66
- - Fixed http://rick_denatale.lighthouseapp.com/projects/30941/tickets/6
72
+ - Fixes http://rick_denatale.lighthouseapp.com/projects/30941/tickets/6
67
73
  Type of dtstart and dtend (DATE or DATETIME) now preserved on enumeration
68
74
  === 0.0.8
69
- - Fixed http://rick_denatale.lighthouseapp.com/projects/30941-ri_cal/tickets/1
75
+ - Fixes http://rick_denatale.lighthouseapp.com/projects/30941-ri_cal/tickets/1
70
76
  EXDATE and RDATE now pick up the timezone from DateTime, Time, and TimeWithZone values
71
- - Fixed http://rick_denatale.lighthouseapp.com/projects/30941/tickets/2
77
+ - Fixes http://rick_denatale.lighthouseapp.com/projects/30941/tickets/2
72
78
  Missing arithmetic methods in PropertyValue::Date
73
- - Fixed http://rick_denatale.lighthouseapp.com/projects/30941/tickets/3
79
+ - Fixes http://rick_denatale.lighthouseapp.com/projects/30941/tickets/3
74
80
  Components with no recurrence rules or rdate properties failed on enumeration, they now
75
81
  will enumerate a single occurrence
76
82
  === 0.0.7
77
- - Fixed a bug relating to properly recognizing ActiveRecord::TimeWithZone
83
+ - Fixes a bug relating to properly recognizing ActiveRecord::TimeWithZone
78
84
  - DATETIME propertyvalues will now return an instance of TimeWithZone instead of DateTime when
79
85
  activesupport is present, and it is appropriate. See the README for details
80
86
  === 0.0.6
81
87
  - Added rake tasks to run specs with either the tzinfo gem or activesupport (<=2.2)
82
88
  - Default rake task now runs both of these
83
89
  === 0.0.5
84
- - Fixed a bug in occurrence enumeration reported by paulsm on github
90
+ - Fixes a bug in occurrence enumeration reported by paulsm on github
85
91
  === 0.0.4
86
- - Fixed a bug in imported timezones reported by paulsm on github
92
+ - Fixes a bug in imported timezones reported by paulsm on github
87
93
  === 0.0.3
88
94
  - 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
89
95
  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,
@@ -100,6 +106,6 @@ for the DateTime property class.
100
106
  -- http://github.com/wesmaldonado/ri_cal
101
107
 
102
108
  === 0.0.2
103
- - Fixed gemspec
109
+ - Fixes gemspec
104
110
  == 0.0.1
105
111
  - 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.5'
17
+ VERSION = '0.7.7'
18
18
  LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
19
19
  PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR
20
20
 
@@ -26,8 +26,12 @@ module RiCal
26
26
  self.dtend = PropertyValue::DateTime.new(self, :value => terminator)
27
27
  self.duration = PropertyValue::Duration.from_datetimes(self, dtstart.to_datetime, dtend.to_datetime)
28
28
  end
29
+ @value = string
29
30
  end
30
31
 
32
+ def ruby_value
33
+ self
34
+ end
31
35
 
32
36
  def self.valid_string?(string) # :nodoc:
33
37
  return false unless string.include?("/")
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.5"
5
+ s.version = "0.7.7"
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-03}
9
+ s.date = %q{2009-08-06}
10
10
  s.default_executable = %q{ri_cal}
11
11
  s.description = %q{A new Ruby implementation of RFC2445 iCalendar.
12
12
 
@@ -134,4 +134,33 @@ ENDCAL
134
134
  it "not raise an error accessing DTSTART" do
135
135
  lambda {@event.dtstart}.should_not raise_error
136
136
  end
137
- end
137
+ end
138
+
139
+ describe "freebusy problem" do
140
+ before(:each) do
141
+ cal = RiCal.parse_string(<<ENDCAL)
142
+ BEGIN:VCALENDAR
143
+ METHOD:PUBLISH
144
+ VERSION:2.0
145
+ PRODID:Zimbra-Calendar-Provider
146
+ BEGIN:VFREEBUSY
147
+ ORGANIZER:mailto:bj-wagoner@wiu.edu
148
+ DTSTAMP:20090805T200417Z
149
+ DTSTART:20090705T200417Z
150
+ DTEND:20091006T200417Z
151
+ URL:https://zimbra9.wiu.edu/service/home/bjw101/calendar.ifb?null
152
+ FREEBUSY;FBTYPE=BUSY:20090705T200417Z/20090707T050000Z
153
+ FREEBUSY;FBTYPE=BUSY-TENTATIVE:20090711T050000Z/20090712T050000Z
154
+ END:VFREEBUSY
155
+ END:VCALENDAR
156
+ ENDCAL
157
+ @free_busy = cal.first.freebusys.first
158
+ end
159
+
160
+ it "should have two periods" do
161
+ @free_busy.freebusy.map {|fb| fb.to_s}.should == [
162
+ ";FBTYPE=BUSY:20090705T200417Z/20090707T050000Z",
163
+ ";FBTYPE=BUSY-TENTATIVE:20090711T050000Z/20090712T050000Z"
164
+ ]
165
+ end
166
+ end
@@ -68,7 +68,7 @@ describe RiCal::CoreExtensions::String::Conversions do
68
68
  end
69
69
 
70
70
  it "should produce a Period property for a valid RFC 2445 period string (time and duration format)" do
71
- "20090304T012345/PT1H".to_ri_cal_occurrence_list_value.should == RiCal::PropertyValue::Period.new(nil, :value => "20090304T012345/P1H")
71
+ "20090304T012345/PT1H".to_ri_cal_occurrence_list_value.should == RiCal::PropertyValue::Period.new(nil, :value => "20090304T012345/PT1H")
72
72
  end
73
73
 
74
74
  it "should raise an InvalidPropertyValue error if the string is not a valid RFC 2445 date or datetime string" do
@@ -13,7 +13,8 @@ describe RiCal::PropertyValue::Period do
13
13
 
14
14
  describe "with an explicit period" do
15
15
  before(:each) do
16
- @it = RiCal::PropertyValue::Period.new(nil, :value => "#{@start_dt.value}/#{@end_dt.value}")
16
+ @value_string = "#{@start_dt.value}/#{@end_dt.value}"
17
+ @it = RiCal::PropertyValue::Period.new(nil, :value => @value_string)
17
18
  end
18
19
 
19
20
  it "should have the correct dtstart value" do
@@ -27,11 +28,20 @@ describe RiCal::PropertyValue::Period do
27
28
  it "should have the correct duration value" do
28
29
  @it.duration.should == @duration
29
30
  end
31
+
32
+ it "should have the correct string value" do
33
+ @it.to_s.should == ":#{@value_string}"
34
+ end
35
+
36
+ it "should be its own ruby_value" do
37
+ @it.ruby_value.should == @it
38
+ end
30
39
  end
31
40
 
32
41
  describe "with a start time and period" do
33
42
  before(:each) do
34
- @it = RiCal::PropertyValue::Period.new(nil, :value => "#{@start_dt.value}/#{@duration.value}")
43
+ @value_string = "#{@start_dt.value}/#{@duration.value}"
44
+ @it = RiCal::PropertyValue::Period.new(nil, :value => @value_string)
35
45
  end
36
46
 
37
47
  it "should have the correct dtstart value" do
@@ -45,5 +55,9 @@ describe RiCal::PropertyValue::Period do
45
55
  it "should have the correct duration value" do
46
56
  @it.duration.should == @duration
47
57
  end
58
+
59
+ it "should have the correct string value" do
60
+ @it.to_s.should == ":#{@value_string}"
61
+ end
48
62
  end
49
63
  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.5
4
+ version: 0.7.7
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-03 00:00:00 -07:00
12
+ date: 2009-08-06 00:00:00 -07:00
13
13
  default_executable: ri_cal
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency