ri_cal 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,8 @@
1
+ === 0.7.1 - 6 July 2007
2
+ * fixed http://rick_denatale.lighthouseapp.com/projects/30941/tickets/15
3
+ duration validation issues
4
+ * fixed http://rick_denatale.lighthouseapp.com/projects/30941/tickets/16
5
+ event finish_time loses timezone info when event has a dtstart and duration
1
6
  === 0.7.0 - 29 June 2009
2
7
  * fixed http://rick_denatale.lighthouseapp.com/projects/30941/tickets/14
3
8
  component without recurrence properties should enumerate just itself only if it is within the period between starting and before
@@ -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.0'
17
+ VERSION = '0.7.1'
18
18
  LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
19
19
  PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR
20
20
 
@@ -306,7 +306,7 @@ module RiCal
306
306
  end
307
307
 
308
308
  alias_method :to_ri_cal_ruby_value, :to_datetime
309
- alias_method :to_finish_time, :to_datetime
309
+ alias_method :to_finish_time, :ruby_value
310
310
 
311
311
  def to_zulu_time
312
312
  utc.to_datetime
@@ -62,7 +62,7 @@ module RiCal
62
62
  end
63
63
 
64
64
  def self.valid_string?(string) #:nodoc:
65
- string =~ /^[+-]?P((\d+)[DHMSW])+$/
65
+ string =~ /^[+-]?P((\d+D)(T((\d+)[HMS])+)?)|(T((\d+)[HMS])+)|(\d+W)$/
66
66
  end
67
67
 
68
68
  def days # :nodoc:
@@ -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.0"
5
+ s.version = "0.7.1"
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-06-29}
9
+ s.date = %q{2009-07-06}
10
10
  s.default_executable = %q{ri_cal}
11
11
  s.description = %q{A new Ruby implementation of RFC2445 iCalendar.
12
12
 
@@ -39,11 +39,18 @@ describe RiCal::Component::Event do
39
39
  it "should be the end time for an event with a datetime dtstart and a duration" do
40
40
  @it = RiCal.Event do |evt|
41
41
  evt.dtstart = "20090704T120000Z"
42
- evt.duration = "P1H30M"
42
+ evt.duration = "PT1H30M"
43
43
  end
44
44
  @it.finish_time.should == DateTime.parse("20090704T133000Z")
45
45
  end
46
46
 
47
+ it "should uset the timezone of dtstart when event has a duration" do
48
+ @it = RiCal.Event do |evt|
49
+ evt.dtstart = "TZID=Australia/Sydney:20090712T200000"
50
+ evt.duration = "PT1H"
51
+ end
52
+ @it.finish_time.should == DateTime.parse("2009-07-12T21:00:00+10:00")
53
+ end
47
54
  end
48
55
 
49
56
  context ".before_range?" do
@@ -317,7 +324,7 @@ describe RiCal::Component::Event do
317
324
  context "with no dtend" do
318
325
  context "and a duration" do
319
326
  it "should be the dtstart plus the duration" do
320
- @event.duration = "+P1H"
327
+ @event.duration = "+PT1H"
321
328
  @event.finish_time.should == DateTime.civil(2009,5,25,16,19,0,0)
322
329
  end
323
330
  end
@@ -394,7 +401,7 @@ describe RiCal::Component::Event do
394
401
  context "with no dtend" do
395
402
  context "and a duration" do
396
403
  it "should be the dtstart plus the duration" do
397
- @event.duration = "+P1H"
404
+ @event.duration = "+PT1H"
398
405
  @event.zulu_occurrence_range_finish_time.should == DateTime.civil(2009,5,25,20 ,19,0,0)
399
406
  end
400
407
  end
@@ -489,12 +496,12 @@ describe RiCal::Component::Event do
489
496
  end
490
497
 
491
498
  it "should reset the dtend property if the duration property is set" do
492
- @it.duration_property = "P1H".to_ri_cal_duration_value
499
+ @it.duration_property = "PT1H".to_ri_cal_duration_value
493
500
  @it.dtend_property.should be_nil
494
501
  end
495
502
 
496
503
  it "should reset the dtend property if the duration ruby value is set" do
497
- @it.duration = "P1H".to_ri_cal_duration_value
504
+ @it.duration = "PT1H".to_ri_cal_duration_value
498
505
  @it.dtend_property.should be_nil
499
506
  end
500
507
  end
@@ -35,7 +35,7 @@ describe RiCal::Component::Todo do
35
35
  context "with no due" do
36
36
  context "and a duration" do
37
37
  before(:each) do
38
- @todo.duration = "+P1H"
38
+ @todo.duration = "+PT1H"
39
39
  end
40
40
 
41
41
  it "should be the dtstart plus the duration" do
@@ -100,12 +100,12 @@ describe RiCal::Component::Todo do
100
100
  end
101
101
 
102
102
  it "should reset the due property if the duration property is set" do
103
- @it.duration_property = "P1H".to_ri_cal_duration_value
103
+ @it.duration_property = "PT1H".to_ri_cal_duration_value
104
104
  @it.due_property.should be_nil
105
105
  end
106
106
 
107
107
  it "should reset the duration property if the dtend ruby value is set" do
108
- @it.duration = "P1H"
108
+ @it.duration = "PT1H"
109
109
  @it.due_property.should == nil
110
110
  end
111
111
  end
@@ -21,7 +21,7 @@ describe RiCal::CoreExtensions::String::Conversions do
21
21
  context "#to_ri_cal_duration_value" do
22
22
 
23
23
  it "should produce a Duration property for a valid RFC 2445 duration string" do
24
- "P1H".to_ri_cal_duration_value.should == RiCal::PropertyValue::Duration.new(nil, :value => "P1H")
24
+ "PT1H".to_ri_cal_duration_value.should == RiCal::PropertyValue::Duration.new(nil, :value => "PT1H")
25
25
  end
26
26
 
27
27
  it "should raise an InvalidPropertyValue error if the string is not a valid RFC 2445 datetime string" do
@@ -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/P1H".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/P1H")
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
@@ -157,7 +157,7 @@ describe RiCal::Parser do
157
157
  describe_property("VEVENT", "DTSTART", {"X-FOO" => "BAR"}, "19970714T235959Z", RiCal::PropertyValue::DateTime)
158
158
 
159
159
  #RFC 2445 section 4.8.2.5 DURATION p94
160
- describe_property("VEVENT", "DURATION", {"X-FOO" => "BAR"}, "P1H", RiCal::PropertyValue::Duration)
160
+ describe_property("VEVENT", "DURATION", {"X-FOO" => "BAR"}, "PT1H", RiCal::PropertyValue::Duration)
161
161
 
162
162
  #RFC 2445 section 4.8.2.6 FREEBUSY does not apply to Events
163
163
 
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.7.0
4
+ version: 0.7.1
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-06-29 00:00:00 -04:00
12
+ date: 2009-07-06 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency