Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

version 0.5.0 rubyforge release candidate

  • Loading branch information...
commit 5d9f1cafcc79fca9b0ddf91af0f8a26ab2ad0b28 1 parent 481e97e
@rubyredrick authored
View
2  lib/ri_cal.rb
@@ -11,7 +11,7 @@ module RiCal
autoload :OccurrenceEnumerator, "#{my_dir}/ri_cal/occurrence_enumerator.rb"
# :stopdoc:
- VERSION = '0.0.11'
+ VERSION = '0.5.0'
LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR
View
32 lib/ri_cal/component/event.rb
@@ -29,24 +29,32 @@ def start_time
dtstart_property ? dtstart.to_datetime : nil
end
- def zulu_occurrence_range_start
- if dtstart_property
- start_time
- else
- nil
- end
- end
-
# Return a date_time representing the time at which the event starts
- def finish_time
+ def finish_property
if dtend_property
- dtend_property.to_finish_time
+ dtend_property
elsif duration_property
- (dtstart_property + duration_property).to_finish_time
+ (dtstart_property + duration_property)
else
- dtstart_property.to_finish_time
+ dtstart_property
end
end
+
+ # Return a date_time representing the time at which the event starts
+ def finish_time
+ prop = finish_property
+ prop ? prop.to_finish_time : nil
+ end
+
+ def zulu_occurrence_range_start_time
+ dtstart_property ? dtstart_property.to_zulu_occurrence_range_start_time : nil
+ end
+
+ def zulu_occurrence_range_finish_time
+ prop = finish_property
+ prop ? prop.to_zulu_occurrence_range_finish_time : nil
+ end
+
end
end
end
View
4 lib/ri_cal/component/todo.rb
@@ -24,14 +24,14 @@ def subcomponent_class #:nodoc:
# Return a date_time representing the time at which the todo should start
def start_time
- dtstart.to_datetime
+ dtstart_property ? dtstart.to_datetime : nil
end
# Return a date_time representing the time at which the todo is due
def finish_time
if due
due_property.to_finish_time
- elsif duration_property
+ elsif duration_property && dtstart_property
(dtstart_property + duration_property).to_finish_time
else
nil
View
4 lib/ri_cal/occurrence_enumerator.rb
@@ -180,9 +180,7 @@ def zulu_occurrence_range
first = occurrences(:count => 1).first
last = nil
end
- first_start = all.first.dtstart.utc.ruby_object
- last_end = all.last.dtend.utc.ruby_object
- [first.zulu_occurrence_range_start, last ? last.zulu_occurrence_range_end : nil]
+ [first.zulu_occurrence_range_start_time, last ? last.zulu_occurrence_range_finish_time : nil]
end
def set_occurrence_properties!(occurrence) # :nodoc:
View
16 lib/ri_cal/properties/event.rb
@@ -54,7 +54,7 @@ def created_property
# set the CREATED property
# property value should be an instance of RiCal::PropertyValueDateTime
def created_property=(property_value)
- @created_property = property_value.for_parent(self)
+ @created_property = property_value ? property_value.for_parent(self) : nil
end
# set the value of the CREATED property
@@ -120,7 +120,7 @@ def dtstart_property
# set the DTSTART property
# property value should be an instance of either RiCal::PropertyValue::DateTime or RiCal::PropertyValue::Date
def dtstart_property=(property_value)
- @dtstart_property = property_value.for_parent(self)
+ @dtstart_property = property_value ? property_value.for_parent(self) : nil
end
# set the value of the DTSTART property
@@ -186,7 +186,7 @@ def last_modified_property
# set the LAST-MODIFIED property
# property value should be an instance of RiCal::PropertyValueDateTime
def last_modified_property=(property_value)
- @last_modified_property = property_value.for_parent(self)
+ @last_modified_property = property_value ? property_value.for_parent(self) : nil
end
# set the value of the LAST-MODIFIED property
@@ -318,7 +318,7 @@ def dtstamp_property
# set the DTSTAMP property
# property value should be an instance of RiCal::PropertyValueDateTime
def dtstamp_property=(property_value)
- @dtstamp_property = property_value.for_parent(self)
+ @dtstamp_property = property_value ? property_value.for_parent(self) : nil
end
# set the value of the DTSTAMP property
@@ -549,7 +549,7 @@ def recurrence_id_property
# set the RECURRENCE-ID property
# property value should be an instance of either RiCal::PropertyValue::DateTime or RiCal::PropertyValue::Date
def recurrence_id_property=(property_value)
- @recurrence_id_property = property_value.for_parent(self)
+ @recurrence_id_property = property_value ? property_value.for_parent(self) : nil
end
# set the value of the RECURRENCE-ID property
@@ -582,7 +582,7 @@ def dtend_property
# set the DTEND property
# property value should be an instance of either RiCal::PropertyValue::DateTime or RiCal::PropertyValue::Date
def dtend_property=(property_value)
- @dtend_property = property_value.for_parent(self)
+ @dtend_property = property_value ? property_value.for_parent(self) : nil
@duration_property = nil
end
@@ -1039,8 +1039,8 @@ def rdates=(ruby_values)
# set the value of the RDATE property to a single value
# one instance of OccurrenceList may be passed to this method
- def rdate=(ruby_value)
- @rdate_property = [RiCal::PropertyValue::OccurrenceList.convert(self, ruby_value)]
+ def rdate=(*ruby_value)
+ @rdate_property = [RiCal::PropertyValue::OccurrenceList.convert(self, *ruby_value)]
end
# add one or more values to the RDATE property
View
6 lib/ri_cal/properties/freebusy.rb
@@ -54,7 +54,7 @@ def dtstart_property
# set the DTSTART property
# property value should be an instance of either RiCal::PropertyValue::DateTime or RiCal::PropertyValue::Date
def dtstart_property=(property_value)
- @dtstart_property = property_value.for_parent(self)
+ @dtstart_property = property_value ? property_value.for_parent(self) : nil
end
# set the value of the DTSTART property
@@ -87,7 +87,7 @@ def dtend_property
# set the DTEND property
# property value should be an instance of either RiCal::PropertyValue::DateTime or RiCal::PropertyValue::Date
def dtend_property=(property_value)
- @dtend_property = property_value.for_parent(self)
+ @dtend_property = property_value ? property_value.for_parent(self) : nil
end
# set the value of the DTEND property
@@ -153,7 +153,7 @@ def dtstamp_property
# set the DTSTAMP property
# property value should be an instance of RiCal::PropertyValueDateTime
def dtstamp_property=(property_value)
- @dtstamp_property = property_value.for_parent(self)
+ @dtstamp_property = property_value ? property_value.for_parent(self) : nil
end
# set the value of the DTSTAMP property
View
10 lib/ri_cal/properties/journal.rb
@@ -54,7 +54,7 @@ def created_property
# set the CREATED property
# property value should be an instance of RiCal::PropertyValueDateTime
def created_property=(property_value)
- @created_property = property_value.for_parent(self)
+ @created_property = property_value ? property_value.for_parent(self) : nil
end
# set the value of the CREATED property
@@ -120,7 +120,7 @@ def dtstart_property
# set the DTSTART property
# property value should be an instance of either RiCal::PropertyValue::DateTime or RiCal::PropertyValue::Date
def dtstart_property=(property_value)
- @dtstart_property = property_value.for_parent(self)
+ @dtstart_property = property_value ? property_value.for_parent(self) : nil
end
# set the value of the DTSTART property
@@ -153,7 +153,7 @@ def dtstamp_property
# set the DTSTAMP property
# property value should be an instance of RiCal::PropertyValueDateTime
def dtstamp_property=(property_value)
- @dtstamp_property = property_value.for_parent(self)
+ @dtstamp_property = property_value ? property_value.for_parent(self) : nil
end
# set the value of the DTSTAMP property
@@ -186,7 +186,7 @@ def last_modified_property
# set the LAST-MODIFIED property
# property value should be an instance of RiCal::PropertyValueDateTime
def last_modified_property=(property_value)
- @last_modified_property = property_value.for_parent(self)
+ @last_modified_property = property_value ? property_value.for_parent(self) : nil
end
# set the value of the LAST-MODIFIED property
@@ -252,7 +252,7 @@ def recurrence_id_property
# set the RECURRENCE-ID property
# property value should be an instance of either RiCal::PropertyValue::DateTime or RiCal::PropertyValue::Date
def recurrence_id_property=(property_value)
- @recurrence_id_property = property_value.for_parent(self)
+ @recurrence_id_property = property_value ? property_value.for_parent(self) : nil
end
# set the value of the RECURRENCE-ID property
View
2  lib/ri_cal/properties/timezone.rb
@@ -54,7 +54,7 @@ def last_modified_property
# set the LAST-MODIFIED property
# property value should be an instance of RiCal::PropertyValueDateTime
def last_modified_property=(property_value)
- @last_modified_property = property_value.for_parent(self)
+ @last_modified_property = property_value ? property_value.for_parent(self) : nil
end
# set the value of the LAST-MODIFIED property
View
2  lib/ri_cal/properties/timezone_period.rb
@@ -21,7 +21,7 @@ def dtstart_property
# set the DTSTART property
# property value should be an instance of either RiCal::PropertyValue::DateTime or RiCal::PropertyValue::Date
def dtstart_property=(property_value)
- @dtstart_property = property_value.for_parent(self)
+ @dtstart_property = property_value ? property_value.for_parent(self) : nil
end
# set the value of the DTSTART property
View
17 lib/ri_cal/properties/todo.rb
@@ -1,6 +1,7 @@
module RiCal
module Properties #:nodoc:
- #- ©2009 Rick DeNatale, All rights reserved. Refer to the file README.txt for the license
+ #- ©2009 Rick DeNatale
+ #- All rights reserved. Refer to the file README.txt for the license
#
# Properties::Todo provides property accessing methods for the Todo class
# This source file is generated by the rical:gen_propmodules rake tasks, DO NOT EDIT
@@ -53,7 +54,7 @@ def completed_property
# set the COMPLETED property
# property value should be an instance of RiCal::PropertyValueDateTime
def completed_property=(property_value)
- @completed_property = property_value.for_parent(self)
+ @completed_property = property_value ? property_value.for_parent(self) : nil
end
# set the value of the COMPLETED property
@@ -86,7 +87,7 @@ def created_property
# set the CREATED property
# property value should be an instance of RiCal::PropertyValueDateTime
def created_property=(property_value)
- @created_property = property_value.for_parent(self)
+ @created_property = property_value ? property_value.for_parent(self) : nil
end
# set the value of the CREATED property
@@ -152,7 +153,7 @@ def dtstamp_property
# set the DTSTAMP property
# property value should be an instance of RiCal::PropertyValueDateTime
def dtstamp_property=(property_value)
- @dtstamp_property = property_value.for_parent(self)
+ @dtstamp_property = property_value ? property_value.for_parent(self) : nil
end
# set the value of the DTSTAMP property
@@ -185,7 +186,7 @@ def dtstart_property
# set the DTSTART property
# property value should be an instance of either RiCal::PropertyValue::DateTime or RiCal::PropertyValue::Date
def dtstart_property=(property_value)
- @dtstart_property = property_value.for_parent(self)
+ @dtstart_property = property_value ? property_value.for_parent(self) : nil
end
# set the value of the DTSTART property
@@ -251,7 +252,7 @@ def last_modified_property
# set the LAST-MODIFIED property
# property value should be an instance of RiCal::PropertyValueDateTime
def last_modified_property=(property_value)
- @last_modified_property = property_value.for_parent(self)
+ @last_modified_property = property_value ? property_value.for_parent(self) : nil
end
# set the value of the LAST-MODIFIED property
@@ -416,7 +417,7 @@ def recurrence_id_property
# set the RECURRENCE-ID property
# property value should be an instance of either RiCal::PropertyValue::DateTime or RiCal::PropertyValue::Date
def recurrence_id_property=(property_value)
- @recurrence_id_property = property_value.for_parent(self)
+ @recurrence_id_property = property_value ? property_value.for_parent(self) : nil
end
# set the value of the RECURRENCE-ID property
@@ -614,7 +615,7 @@ def due_property
# set the DUE property
# property value should be an instance of either RiCal::PropertyValue::DateTime or RiCal::PropertyValue::Date
def due_property=(property_value)
- @due_property = property_value.for_parent(self)
+ @due_property = property_value ? property_value.for_parent(self) : nil
@duration_property = nil
end
View
8 lib/ri_cal/property_value/date.rb
@@ -151,6 +151,14 @@ def start_of_day?
true
end
+ def to_zulu_occurrence_range_start_time
+ to_ri_cal_date_time_value.to_zulu_occurrence_range_start_time
+ end
+
+ def to_zulu_occurrence_range_finish_time
+ to_ri_cal_date_time_value.end_of_day.to_zulu_occurrence_range_finish_time
+ end
+
def to_finish_time
to_ri_cal_date_time_value.end_of_day.to_datetime
end
View
29 lib/ri_cal/property_value/date_time.rb
@@ -291,7 +291,34 @@ def ruby_value
alias_method :to_ri_cal_ruby_value, :to_datetime
alias_method :to_finish_time, :to_datetime
-
+
+ def to_zulu_time
+ utc.to_datetime
+ end
+
+ # If a time is floating, then the utc of it's start time may actually be as early
+ # as 12 hours earlier if the occurrence is being viewed in a time zone just west
+ # of the International Date Line
+ def to_zulu_occurrence_range_start_time
+ if floating?
+ utc.advance(:hours => -12).to_datetime
+ else
+ to_zulu_time
+ end
+ end
+
+
+ # If a time is floating, then the utc of it's start time may actually be as early
+ # as 12 hours later if the occurrence is being viewed in a time zone just east
+ # of the International Date Line
+ def to_zulu_occurrence_range_finish_time
+ if floating?
+ utc.advance(:hours => 12).to_datetime
+ else
+ to_zulu_time
+ end
+ end
+
def add_date_times_to(required_timezones) #:nodoc:
required_timezones.add_datetime(self, tzid) if has_local_timezone?
end
View
2  lib/ri_cal/property_value/date_time/timezone_support.rb
@@ -67,7 +67,7 @@ def utc?
# Predicate indicating whether or not the instance represents a floating time
def floating?
- tzid == :floating
+ tzid.nil?
end
def has_valid_tzinfo_tzid? #:nodoc:
View
4 ri_cal.gemspec
@@ -2,11 +2,11 @@
Gem::Specification.new do |s|
s.name = %q{ri_cal}
- s.version = "0.0.11"
+ s.version = "0.5.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-05-23}
+ s.date = %q{2009-05-26}
s.default_executable = %q{ri_cal}
s.description = %q{This is an UNOFFICIAL version. The public official version will be released on RubyForge. Github will be used
for interim versions. USE THIS VERSION AT YOUR OWN RISK.
View
100 spec/ri_cal/component/event_spec.rb
@@ -180,9 +180,9 @@
@it.rrule.should be_kind_of(Array)
end
end
-
+
context ".start_time" do
-
+
it "should be nil if there is no dtstart property" do
RiCal.Event.start_time.should be_nil
end
@@ -191,25 +191,27 @@
event = RiCal.Event {|e| e.dtstart = "20090525T151900"}
event.start_time.should == DateTime.civil(2009,05,25,15,19,0,0)
end
-
+
it "should be the start of the day of dtstart for a date" do
event = RiCal.Event {|e| e.dtstart = "20090525"}
event.start_time.should == DateTime.civil(2009,05,25,0,0,0,0)
end
end
-
+
context ".finish_time" do
before(:each) do
@event = RiCal.Event {|e| e.dtstart = "20090525T151900"}
end
-
+
context "with a given dtend" do
it "should be the same as dtend for a date time" do
@event.dtend = "20090525T161900"
@event.finish_time.should == DateTime.civil(2009,05,25,16,19,0,0)
end
+
+
end
-
+
context "with no dtend" do
context "and a duration" do
it "should be the dtstart plus the duration" do
@@ -217,13 +219,13 @@
@event.finish_time.should == DateTime.civil(2009,5,25,16,19,0,0)
end
end
-
+
context "and no duration" do
context "when the dtstart is not set" do
before(:each) do
@event.dtstart_property = nil
end
-
+
it "should be nil" do
@event.finish_time.should be_nil
end
@@ -234,7 +236,7 @@
# "DTEND" property, the event ends on the same calendar date and time
# of day specified by the "DTSTART" property. RFC 2445 p 53
it "should be the same as start_time" do
- @event.finish_time.should == @event.start_time
+ @event.finish_time.should == @event.start_time
end
end
context "when the dtstart is a date" do
@@ -252,6 +254,76 @@
end
+ context ".zulu_occurrence_range_start_time" do
+
+ it "should be nil if there is no dtstart property" do
+ RiCal.Event.zulu_occurrence_range_start_time.should be_nil
+ end
+
+ it "should be the utc equivalent of dtstart for a date time" do
+ event = RiCal.Event {|e| e.dtstart = "TZID=America/New_York:20090525T151900"}
+ event.zulu_occurrence_range_start_time.should == DateTime.civil(2009,05,25,19,19,0,0)
+ end
+
+ it "should be the utc time of the start of the day of dtstart in the earliest timezone for a date" do
+ event = RiCal.Event {|e| e.dtstart = "20090525"}
+ event.zulu_occurrence_range_start_time.should == DateTime.civil(2009,05,24,12,0,0,0)
+ end
+
+ it "should be the utc time of the dtstart in the earliest timezone if dtstart is a floating datetime" do
+ event = RiCal.Event {|e| e.dtstart = "20090525T151900"}
+ event.zulu_occurrence_range_start_time.should == DateTime.civil(2009,05,25,3,19,0,0)
+ end
+ end
+
+ context ".zulu_occurrence_range_finish_time" do
+ before(:each) do
+ @event = RiCal.Event {|e| e.dtstart = "TZID=America/New_York:20090525T151900"}
+ end
+
+ context "with a given dtend" do
+ it "should be the utc equivalent of dtend if dtend is a date time" do
+ @event.dtend = "TZID=America/New_York:20090525T161900"
+ @event.zulu_occurrence_range_finish_time.should == DateTime.civil(2009,05,25, 20,19,0,0)
+ end
+ end
+
+ context "with no dtend" do
+ context "and a duration" do
+ it "should be the dtstart plus the duration" do
+ @event.duration = "+P1H"
+ @event.zulu_occurrence_range_finish_time.should == DateTime.civil(2009,5,25,20 ,19,0,0)
+ end
+ end
+
+ context "and no duration" do
+ context "when the dtstart is not set" do
+ before(:each) do
+ @event.dtstart_property = nil
+ end
+
+ it "should be nil" do
+ @event.zulu_occurrence_range_finish_time.should be_nil
+ end
+ end
+
+ context "when the dstart is a datetime" do
+
+ it "should be the same as start_time" do
+ @event.zulu_occurrence_range_finish_time.should == @event.zulu_occurrence_range_start_time
+ end
+ end
+
+ context "when the dtstart is a date" do
+ it "should be the utc of end of the same day as start_time in the westermost time zone" do
+ @event.dtstart = "20090525"
+ @event.zulu_occurrence_range_finish_time.should == DateTime.civil(2009,5,26,11,59,59,0)
+ end
+ end
+ end
+ end
+ end
+
context "description property" do
before(:each) do
@ical_desc = "posted by Joyce per Zan\\nASheville\\, Rayan's Restauratn\\, Biltm\n ore Square"
@@ -380,7 +452,7 @@ def unfold(string)
@it.dtstart = Date.parse("April 22, 2009")
unfold(@it.export).should match(/^DTSTART;VALUE=DATE:20090422$/)
end
-
+
it "should properly fold on export when the description contains a carriage return" do
@it.description = "Weather report looks nice, 80 degrees and partly cloudy, so following Michael's suggestion, let's meet at the food court at Crossroads:\n\rhttp://www.shopcrossroadsplaza.c...\n"
export_string = @it.export
@@ -392,7 +464,7 @@ def unfold(string)
if RiCal::TimeWithZone
context "with ActiveSupport loaded" do
-
+
context "an event with an timezoned exdate" do
before(:each) do
@old_timezone = Time.zone
@@ -405,15 +477,15 @@ def unfold(string)
end
@event = cal.events.first
end
-
+
after(:each) do
Time.zone = @old_timezone
end
-
+
it "should pickup the timezone in the exdate property" do
@event.exdate.first.first.tzid.should == "America/New_York"
end
-
+
it "should have the timezone in the ical representation of the exdate property" do
@event.exdate_property.to_s.should match(%r{;TZID=America/New_York[:;]})
end
View
14 spec/ri_cal/component/todo_spec.rb
@@ -14,6 +14,10 @@
todo = RiCal.Todo {|e| e.dtstart = "20090525"}
todo.start_time.should == DateTime.civil(2009,05,25,0,0,0,0)
end
+
+ it "should be nil if the dtstart property is not set" do
+ RiCal.Todo.start_time.should be_nil
+ end
end
context ".finish_time" do
@@ -30,10 +34,18 @@
context "with no due" do
context "and a duration" do
- it "should be the dtstart plus the duration" do
+ before(:each) do
@todo.duration = "+P1H"
+ end
+
+ it "should be the dtstart plus the duration" do
@todo.finish_time.should == DateTime.civil(2009,5,25,16,19,0,0)
end
+
+ it "should be nil if the dtstart property is not set" do
+ @todo.dtstart_property = nil
+ @todo.finish_time.should be_nil
+ end
end
context "and no duration" do
View
40 spec/ri_cal/occurrence_enumerator_spec.rb
@@ -513,6 +513,34 @@ def mock_enumerator(name, next_occurrence)
describe "#zulu_occurrence_range" do
+ context "For an unbounded recurring event" do
+ before(:each) do
+ @event = RiCal.Event do |e|
+ e.dtstart = "TZID=America/New_York:20090525T143500"
+ e.dtend = "TZID=America/New_York:20090525T153500"
+ e.add_rrule("FREQ=DAILY")
+ end
+
+ it "should return an array with the first dtstart and nil" do
+ @event.zulu_occurrence_range.should == [DateTime.civil(2009,5,25,18,35,00, 0), nil]
+ end
+ end
+ end
+
+ context "For a bounded recurring event" do
+ before(:each) do
+ @event = RiCal.Event do |e|
+ e.dtstart = "TZID=America/New_York:20090525T143500"
+ e.dtend = "TZID=America/New_York:20090525T153500"
+ e.add_rrule("FREQ=DAILY;COUNT=3")
+ end
+
+ it "should return an array with the first dtstart last dtend converted to utc" do
+ @event.zulu_occurrence_range.should == [DateTime.civil(2009,5,25,18,35,00, 0), DateTime.civil(2009,5,27,19,35,00, 0)]
+ end
+ end
+ end
+
context "For an event with no recurrence rules" do
context "with a non-floating dtstart and dtend" do
before(:each) do
@@ -526,6 +554,18 @@ def mock_enumerator(name, next_occurrence)
@event.zulu_occurrence_range.should == [DateTime.civil(2009,5,25,18,35,00, 0), DateTime.civil(2009,5,25,19,35,00, 0)]
end
end
+ context "with a floating dtstart and dtend" do
+ before(:each) do
+ @event = RiCal.Event do |e|
+ e.dtstart = "20090525T143500"
+ e.dtend = "20090525T153500"
+ end
+ end
+
+ it "should return an array with dtstart in the first timezone and dtend in the last time zone converted to zulu time" do
+ @event.zulu_occurrence_range.should == [DateTime.civil(2009,5,25,2,35,00, 0), DateTime.civil(2009,5,26,3,35,00, 0)]
+ end
+ end
end
end
View
71 website/index.html
@@ -34,11 +34,14 @@
<div class="sidebar">
<div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/rical"; return false'>
<p>Get Version</p>
- <a href="http://rubyforge.org/projects/rical" class="numbers">0.0.1</a>
+ <a href="http://rubyforge.org/projects/rical" class="numbers">0.5.0</a>
</div>
</div>
<h2>What</h2>
<p>RiCal is a new Ruby Library for parsing, generating, and using iCalendar (<span class="caps">RFC</span> 2445) format data.</p>
+<h2>Installing</h2>
+<p><pre class='syntax'><span class="ident">sudo</span> <span class="ident">gem</span> <span class="ident">install</span> <span class="ident">ri_cal</span></pre></p>
+<h2>The basics</h2>
<p>RiCal distinguishes itself from existing Ruby libraries in providing support for</p>
<ul>
<li>Timezone components in Calendars. This means that RiCal parses <span class="caps">VTIMEZONE</span> data and instantiates timezone objects<br />
@@ -51,42 +54,54 @@
<li>Enumeration of recurring occurrences. For example, if an Event has one or more recurrence rules, then the occurrences <br />
of the event can be enumerated as a series of Event occurrences.</li>
</ul>
-<h2>Installing</h2>
-<p><pre class='syntax'><span class="ident">sudo</span> <span class="ident">gem</span> <span class="ident">install</span> <span class="ident">ri_cal</span></pre></p>
-<h2>The basics</h2>
<h2>Demonstration of usage</h2>
+<p>RiCal provides a builder <span class="caps">DSL</span> for creating calendars and calendar components. An example</p>
+RiCal.Calendar do
+event do
+description &#8220;MA-6 First US Manned Spaceflight&#8221;
+dtstart DateTime.parse(&#8220;2/20/1962 14:47:39&#8221;)
+dtend DateTime.parse(&#8220;2/20/1962 19:43:02&#8221;)
+location &#8220;Cape Canaveral&#8221;
+add_attendee &#8220;john.glenn@nasa.gov&#8221;
+alarm do
+description &#8220;Segment 51&#8221;
+end
+end
+end
+
+<p>The blocks are evaluated in the context of an object which builds the calendar or calendar component. method names<br />
+starting with add_ or remove_ are sent to the component, method names which correspond to a property value setter of<br />
+the object being built will cause that setter to be sent to the component with the provided value.</p>
+<p>A method corresponding to the name of one of the components sub component will create the sub component and <br />
+evaluate the block in the context of the new subcomponent.</p>
+<h2><span class="caps">WIKI</span></h2>
+<p><a href="http://wiki.github.com/rubyredrick/ri_cal">http://wiki.github.com/rubyredrick/ri_cal</a></p>
<h2>Forum</h2>
-<p><a href="http://groups.google.com/group/ri_cal_newgem">http://groups.google.com/group/ri_cal_newgem</a></p>
-<p><span class="caps">TODO</span> &#8211; create Google Group &#8211; ri_cal_newgem</p>
+<p><a href="http://groups.google.com/group/rical_gem">http://groups.google.com/group/rical_gem</a></p>
+<h2>Bug Reports</h2>
+<p><a href="http://rick_denatale.lighthouseapp.com/projects/30941-ri_cal/overview">http://rick_denatale.lighthouseapp.com/projects/30941-ri_cal/overview</a></p>
<h2>How to submit patches</h2>
-<p>Read the <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/">8 steps for fixing other people&#8217;s code</a> and for section <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups">8b: Submit patch to Google Groups</a>, use the Google Group above.</p>
-<p><span class="caps">TODO</span> &#8211; pick <span class="caps">SVN</span> or Git instructions</p>
-<p>The trunk repository is <code>svn://rubyforge.org/var/svn/ri_cal_newgem/trunk</code> for anonymous access.</p>
-<p><span class="caps">OOOORRRR</span></p>
-<p>You can fetch the source from either:</p>
-<ul>
- <li>rubyforge: <a href="http://rubyforge.org/scm/?group_id=8234">http://rubyforge.org/scm/?group_id=8234</a></li>
-</ul>
-<pre>git clone git://rubyforge.org/ri_cal_newgem.git</pre>
-<ul>
- <li>github: <a href="http://github.com/GITHUB_USERNAME/ri_cal_newgem/tree/master">http://github.com/GITHUB_USERNAME/ri_cal_newgem/tree/master</a></li>
-</ul>
-<pre>git clone git://github.com/GITHUB_USERNAME/ri_cal_newgem.git</pre>
-<p><span class="caps">TODO</span> &#8211; add &#8220;github_username: username&#8221; to ~/.rubyforge/user-config.yml and newgem will reuse it for future projects.</p>
-<ul>
- <li>gitorious: <a href="git://gitorious.org/ri_cal_newgem/mainline.git">git://gitorious.org/ri_cal_newgem/mainline.git</a></li>
-</ul>
-<pre>git clone git://gitorious.org/ri_cal_newgem/mainline.git</pre>
+<p>The current development version of RiCal is always maintained on github. The official release here on RubyForge will be updated periodically as warranted.</p>
+<p>I would prefer patches which include a spec which fails before the patch is applied and passes after. The best way to submit a patch is via the <a href="http://rick_denatale.lighthouseapp.com/projects/30941-ri_cal/overview">lighthouse bug tracking system</a></p>
+<p>Get the latest version from github</p>
+<pre>git clone git://rubyforge.org/ri_cal.git</pre>
+<p>Alternatively fork the rical project and create your own github version.</p>
+<p>I would prefer that you submit patches as attachments to lighthouse tickets created using <a href="http://www.us.kernel.org/pub/software/scm/git/docs/git-format-patch.html">git format-patch</a></p>
<h3>Build and test instructions</h3>
-<pre>cd ri_cal_newgem
-rake spec
-rake install_gem</pre>
+<p>RiCal requires either the tzinfo gem, or a version (=&lt; 2.2) of the activesupport gem (part of Rails). To allow users of RiCal to control their own dependencies RiCal itself does not declare these as gem dependencies.</p>
+<p>You will need to install either the tzinfo gem, or the activesupport gem or both.</p>
+<p>There are two rake tasks for running the specs</p>
+<pre>rake spec:with_tzinfo_gem</pre>
+<p>runs the specs after requiring the tzinfo gem. Similarly</p>
+<pre>rake spec:with_active_support</pre>
+<p>runs the specs after requiring activesupport.</p>
+<p>The default rake task runs both of these.</p>
<h2>License</h2>
<p>This code is free to use under the terms of the <span class="caps">MIT</span> license.</p>
<h2>Contact</h2>
<p>Comments are welcome. Send an email to <a href="mailto:rick.denatale@gmail.com">Rick DeNatale</a></p>
<p class="coda">
- <a href="rick.denatale@gmail.com">Rick DeNatale</a>, 27th April 2009<br>
+ <a href="rick.denatale@gmail.com">Rick DeNatale</a>, 26th May 2009<br>
Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
</p>
</div>
View
47 website/index.txt
@@ -46,52 +46,49 @@ the object being built will cause that setter to be sent to the component with t
A method corresponding to the name of one of the components sub component will create the sub component and
evaluate the block in the context of the new subcomponent.
-h2. Forum
-
-"http://groups.google.com/group/rical_gem":http://groups.google.com/group/rical_gem
+h2. WIKI
-h2. How to submit patches
+"http://wiki.github.com/rubyredrick/ri_cal":http://wiki.github.com/rubyredrick/ri_cal
-Read the "8 steps for fixing other people's code":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/ and for section "8b: Submit patch to Google Groups":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups, use the Google Group above.
+h2. Forum
-You can fetch the source from either:
+"http://groups.google.com/group/rical_gem":http://groups.google.com/group/rical_gem
-<% if rubyforge_project_id %>
+h2. Bug Reports
-* rubyforge: "http://rubyforge.org/scm/?group_id=<%= rubyforge_project_id %>":http://rubyforge.org/scm/?group_id=<%= rubyforge_project_id %>
+"http://rick_denatale.lighthouseapp.com/projects/30941-ri_cal/overview":http://rick_denatale.lighthouseapp.com/projects/30941-ri_cal/overview
-<pre>git clone git://rubyforge.org/ri_cal.git</pre>
+h2. How to submit patches
-<% else %>
+The current development version of RiCal is always maintained on github. The official release here on RubyForge will be updated periodically as warranted.
-* rubyforge: MISSING IN ACTION
+I would prefer patches which include a spec which fails before the patch is applied and passes after. The best way to submit a patch is via the "lighthouse bug tracking system":http://rick_denatale.lighthouseapp.com/projects/30941-ri_cal/overview
-TODO - You can not created a RubyForge project, OR have not run <code>rubyforge config</code>
-yet to refresh your local rubyforge data with this projects' id information.
+Get the latest version from github
-When you do this, this message will magically disappear!
+<pre>git clone git://rubyforge.org/ri_cal.git</pre>
-Or you can hack website/index.txt and make it all go away!!
+Alternatively fork the rical project and create your own github version.
-<% end %>
+I would prefer that you submit patches as attachments to lighthouse tickets created using "git format-patch":http://www.us.kernel.org/pub/software/scm/git/docs/git-format-patch.html
-* github: "http://github.com/rubyredrick/ri_cal/tree/master":http://github.com/rubyredrick/ri_cal/tree/master
+h3. Build and test instructions
-<pre>git clone git://github.com/rubyredrick/ri_cal.git</pre>
+RiCal requires either the tzinfo gem, or a version (=< 2.2) of the activesupport gem (part of Rails). To allow users of RiCal to control their own dependencies RiCal itself does not declare these as gem dependencies.
+You will need to install either the tzinfo gem, or the activesupport gem or both.
-TODO - add "rubyredrick: username" to ~/.rubyforge/user-config.yml and newgem will reuse it for future projects.
+There are two rake tasks for running the specs
+<pre>rake spec:with_tzinfo_gem</pre>
-* gitorious: "git://gitorious.org/ri_cal/mainline.git":git://gitorious.org/ri_cal/mainline.git
+runs the specs after requiring the tzinfo gem. Similarly
-<pre>git clone git://gitorious.org/ri_cal/mainline.git</pre>
+<pre>rake spec:with_active_support</pre>
-h3. Build and test instructions
+runs the specs after requiring activesupport.
-<pre>cd ri_cal
-rake spec
-rake install_gem</pre>
+The default rake task runs both of these.
h2. License
Please sign in to comment.
Something went wrong with that request. Please try again.