<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>config/website.yml</filename>
    </added>
    <added>
      <filename>profiling/ical_files/profile3.ics</filename>
    </added>
    <added>
      <filename>profiling/profile1.rb</filename>
    </added>
    <added>
      <filename>profiling/profile2.rb</filename>
    </added>
    <added>
      <filename>profiling/profile3.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,6 +1,7 @@
 coverage/
 tmp/
 pkg/
+profiles/
 doc/
 \.DS_Store
 .ackrc
\ No newline at end of file</diff>
      <filename>.gitignore</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,6 @@
+=== 0.5.3 - 1 June, 2009
+ * Improved performance of time zone enumeration, TimeZonePeriod now caches occurrences
+ * Added a profiling directory which contains ruby programs which benchmark and/or profile performance
 === 0.5.2
  * Fixed http://rick_denatale.lighthouseapp.com/projects/30941/tickets/11
    Export folding is not UTF-8 Safe</diff>
      <filename>History.txt</filename>
    </modified>
    <modified>
      <diff>@@ -89,6 +89,10 @@ 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
+profiling/ical_files/profile3.ics
+profiling/profile1.rb
+profiling/profile2.rb
+profiling/profile3.rb
 ri_cal.gemspec
 sample_ical_files/from_ical_dot_app/test1.ics
 script/console</diff>
      <filename>Manifest.txt</filename>
    </modified>
    <modified>
      <diff>@@ -6,7 +6,7 @@ require File.dirname(__FILE__) + '/lib/ri_cal'
 
 # Generate all the Rake tasks
 # Run 'rake -T' to see list of generated tasks (from gem root directory)
-$hoe = Hoe.new('ri-cal', RiCal::VERSION) do |p|
+$hoe = Hoe.new('ri_cal', RiCal::VERSION) do |p|
   p.developer('author=Rick DeNatale', 'rick.denatale@gmail.com')
   p.changes              = p.paragraphs_of(&quot;History.txt&quot;, 0..1).join(&quot;\n\n&quot;)
   # p.post_install_message = 'PostInstall.txt' # TODO remove if post-install message not required
@@ -15,7 +15,8 @@ $hoe = Hoe.new('ri-cal', RiCal::VERSION) do |p|
   #   ['tzinfo','&gt;= 2.0.2'],
   # ]
   p.extra_dev_deps = [
-    ['newgem', &quot;&gt;= #{::Newgem::VERSION}&quot;]
+    ['newgem', &quot;&gt;= #{::Newgem::VERSION}&quot;],
+    'ruby-prof'
   ]
 
   p.clean_globs |= %w[**/.DS_Store tmp *.log]</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -14,7 +14,7 @@ module RiCal
   autoload :OccurrenceEnumerator, &quot;#{my_dir}/ri_cal/occurrence_enumerator.rb&quot;
   
   # :stopdoc:
-  VERSION = '0.5.2'
+  VERSION = '0.5.3'
   LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
   PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR
 </diff>
      <filename>lib/ri_cal.rb</filename>
    </modified>
    <modified>
      <diff>@@ -55,13 +55,17 @@ module RiCal
         end
 
         def last_before_local(local_time) #:nodoc:
-          fill_cache(local_time)
-          cand_occurrence = nil
-          occurrence_cache.each do |occurrence|
-            return cand_occurrence if occurrence.dtstart_property &gt; local_time
-            cand_occurrence = occurrence
+          if recurs?
+            fill_cache(local_time)
+            cand_occurrence = nil
+            occurrence_cache.each do |occurrence|
+              return cand_occurrence if occurrence.dtstart_property &gt; local_time
+              cand_occurrence = occurrence
+            end
+            return cand_occurrence
+          else
+            return self
           end
-          return cand_occurrence
         end
 
          def enumeration_instance</diff>
      <filename>lib/ri_cal/component/timezone/timezone_period.rb</filename>
    </modified>
    <modified>
      <diff>@@ -232,6 +232,10 @@ module RiCal
     def recurrence(occurrence) # :nodoc:
       result = self.dup.set_occurrence_properties!(occurrence)
     end
+    
+    def recurs?
+      @rrule_property &amp;&amp; @rrule_property.length &gt; 0 || @rdate_property &amp;&amp; @rdate_property.length &gt; 0
+    end
 
   end
 end
\ No newline at end of file</diff>
      <filename>lib/ri_cal/occurrence_enumerator.rb</filename>
    </modified>
    <modified>
      <diff>@@ -11,27 +11,51 @@ describe RiCal::Component::Timezone do
     end
   end
 
+  context &quot;for a Timezone with no DST periods&quot; do
+    before(:each) do
+      @it = RiCal.parse_string rectify_ical &lt;&lt;-'ENDCAL'
+      BEGIN:VTIMEZONE
+      TZID:Australia/Brisbane
+      X-LIC-LOCATION:Australia/Brisbane
+      BEGIN:STANDARD
+      TZOFFSETFROM:+1000
+      TZOFFSETTO:+1000
+      TZNAME:EST
+      DTSTART:19700101T000000
+      END:STANDARD
+      END:VTIMEZONE
+      ENDCAL
+      @it = @it.first
+    end
+
+    context &quot;.periods_for_local&quot; do
+      it &quot;should return a single period&quot; do
+        @it.periods_for_local(DateTime.parse(&quot;20090530T100000&quot;)).length.should == 1
+      end
+    end
+  end
+
   context &quot;from an iCal.app calendar for America/New_York starting March 11 2007&quot; do
     before(:each) do
-      @it = RiCal.parse_string &lt;&lt;TZEND
-BEGIN:VTIMEZONE
-TZID:US/Eastern
-BEGIN:DAYLIGHT
-TZOFFSETFROM:-0500
-TZOFFSETTO:-0400
-DTSTART:20070311T020000
-RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU
-TZNAME:EDT
-END:DAYLIGHT
-BEGIN:STANDARD
-TZOFFSETFROM:-0400
-TZOFFSETTO:-0500
-DTSTART:20071104T020000
-RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU
-TZNAME:EST
-END:STANDARD
-END:VTIMEZONE
-TZEND
+      @it = RiCal.parse_string rectify_ical &lt;&lt;-'ENDCAL'
+      BEGIN:VTIMEZONE
+      TZID:US/Eastern
+      BEGIN:DAYLIGHT
+      TZOFFSETFROM:-0500
+      TZOFFSETTO:-0400
+      DTSTART:20070311T020000
+      RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU
+      TZNAME:EDT
+      END:DAYLIGHT
+      BEGIN:STANDARD
+      TZOFFSETFROM:-0400
+      TZOFFSETTO:-0500
+      DTSTART:20071104T020000
+      RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU
+      TZNAME:EST
+      END:STANDARD
+      END:VTIMEZONE
+      ENDCAL
       @it = @it.first
     end
 
@@ -69,7 +93,7 @@ TZEND
           it &quot;should return a dst period if the dst parameter is true&quot; do
             @it.period_for_local(DateTime.parse(&quot;Nov 1, 2009 2:00&quot;), true).should be_dst
           end
-          
+
           it &quot;should return a std period if the dst parameter is false&quot; do
             @it.period_for_local(DateTime.parse(&quot;Nov 1, 2009 2:00&quot;), false).should_not be_dst
           end
@@ -78,27 +102,21 @@ TZEND
         context &quot;with a block&quot; do
           it &quot;should return a period if the block returns a TimezonePeriod&quot; do
             mock_period = ::RiCal::Component::Timezone::TimezonePeriod.new(nil)
-            @it.period_for_local(DateTime.parse(&quot;Nov 1, 2009 2:00&quot;)) { |results|
-              mock_period
-            }.should == mock_period
+            @it.period_for_local(DateTime.parse(&quot;Nov 1, 2009 2:00&quot;)) { |results| mock_period}.should == mock_period
           end
-          
+
           it &quot;should return a period if the block returns a single element array&quot; do
             mock_period = :foo
-            @it.period_for_local(DateTime.parse(&quot;Nov 1, 2009 2:00&quot;)) { |results|
-             [ mock_period]
-            }.should == mock_period
+            @it.period_for_local(DateTime.parse(&quot;Nov 1, 2009 2:00&quot;)) { |results| [ mock_period]}.should == mock_period
           end
-          
+
           it &quot;should raise TZInfo::PeriodNotFound if the block returns a multi-element array&quot; do
             lambda {
-              @it.period_for_local(DateTime.parse(&quot;Mar 8, 2009 2:30&quot;)) {|results| [1,2]}
-              }.should raise_error(TZInfo::PeriodNotFound)
+              @it.period_for_local(DateTime.parse(&quot;Mar 8, 2009 2:30&quot;)) {|results| [1,2]}}.should raise_error(TZInfo::PeriodNotFound)
+            end
           end
-          
         end
       end
-    end
 
     context &quot;.periods_for_local&quot; do
       context &quot;for the date on which DST begins springing ahead e.g. Mar 8, 2009&quot; do
@@ -150,66 +168,66 @@ TZEND
       end
     end
   end
-  
+
   context &quot;Bug report from paulsm&quot; do
-      before(:each) do
-        cals = RiCal.parse_string &lt;&lt;ENDCAL
-BEGIN:VCALENDAR
-X-WR-TIMEZONE:America/New_York
-PRODID:-//Apple Inc.//iCal 3.0//EN
-CALSCALE:GREGORIAN
-X-WR-CALNAME:test
-VERSION:2.0
-X-WR-RELCALID:1884C7F8-BC8E-457F-94AC-297871967D5E
-X-APPLE-CALENDAR-COLOR:#2CA10B
-BEGIN:VTIMEZONE
-TZID:US/Eastern
-BEGIN:DAYLIGHT
-TZOFFSETFROM:-0500
-TZOFFSETTO:-0400
-DTSTART:20070311T020000
-RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU
-TZNAME:EDT
-END:DAYLIGHT
-BEGIN:STANDARD
-TZOFFSETFROM:-0400
-TZOFFSETTO:-0500
-DTSTART:20071104T020000
-RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU
-TZNAME:EST
-END:STANDARD
-END:VTIMEZONE
-BEGIN:VEVENT
-SEQUENCE:5
-TRANSP:OPAQUE
-UID:00481E53-9258-4EA7-9F8D-947D3041A3F2
-DTSTART;TZID=US/Eastern:20090224T090000
-DTSTAMP:20090225T000908Z
-SUMMARY:Test Event
-CREATED:20090225T000839Z
-DTEND;TZID=US/Eastern:20090224T100000
-RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20090228T045959Z
-END:VEVENT
-END:VCALENDAR
-ENDCAL
+    before(:each) do
+      cals = RiCal.parse_string rectify_ical &lt;&lt;-'ENDCAL'
+      BEGIN:VCALENDAR
+      X-WR-TIMEZONE:America/New_York
+      PRODID:-//Apple Inc.//iCal 3.0//EN
+      CALSCALE:GREGORIAN
+      X-WR-CALNAME:test
+      VERSION:2.0
+      X-WR-RELCALID:1884C7F8-BC8E-457F-94AC-297871967D5E
+      X-APPLE-CALENDAR-COLOR:#2CA10B
+      BEGIN:VTIMEZONE
+      TZID:US/Eastern
+      BEGIN:DAYLIGHT
+      TZOFFSETFROM:-0500
+      TZOFFSETTO:-0400
+      DTSTART:20070311T020000
+      RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU
+      TZNAME:EDT
+      END:DAYLIGHT
+      BEGIN:STANDARD
+      TZOFFSETFROM:-0400
+      TZOFFSETTO:-0500
+      DTSTART:20071104T020000
+      RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU
+      TZNAME:EST
+      END:STANDARD
+      END:VTIMEZONE
+      BEGIN:VEVENT
+      SEQUENCE:5
+      TRANSP:OPAQUE
+      UID:00481E53-9258-4EA7-9F8D-947D3041A3F2
+      DTSTART;TZID=US/Eastern:20090224T090000
+      DTSTAMP:20090225T000908Z
+      SUMMARY:Test Event
+      CREATED:20090225T000839Z
+      DTEND;TZID=US/Eastern:20090224T100000
+      RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20090228T045959Z
+      END:VEVENT
+      END:VCALENDAR
+      ENDCAL
       @event = cals.first.events.first
     end
-    
+  
     context &quot;the events dtstart&quot; do
       it &quot;should be the right DateTime&quot; do
         @event.dtstart.should == DateTime.civil(2009, 2, 24, 9, 0, 0, Rational(-5, 24))
       end
-      
+  
       it &quot;should have the right tzid&quot; do
         @event.dtstart.tzid.should == &quot;US/Eastern&quot;
       end
     end
-    
+  
     context &quot;the events dtend&quot; do
       it &quot;should be the right DateTime&quot; do
         @event.dtend.should == DateTime.civil(2009, 2, 24, 10, 0, 0, Rational(-5, 24))
       end
-      
+  
       it &quot;should have the right tzid&quot; do
         @event.dtend.tzid.should == &quot;US/Eastern&quot;
       end</diff>
      <filename>spec/ri_cal/component/timezone_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>a891aa4c7b9869c56604d276f07c4e27fceb2ad5</id>
    </parent>
  </parents>
  <author>
    <name>Rick DeNatale</name>
    <email>rick.denatale@gmail.com</email>
  </author>
  <url>http://github.com/rubyredrick/ri_cal/commit/31fd75f725271c718ef752e18d1038c9f2fee6b7</url>
  <id>31fd75f725271c718ef752e18d1038c9f2fee6b7</id>
  <committed-date>2009-06-01T07:25:06-07:00</committed-date>
  <authored-date>2009-06-01T07:25:06-07:00</authored-date>
  <message>ready to merge</message>
  <tree>dd34b7bef138ea032c0af2c7d2c890166f8c54bf</tree>
  <committer>
    <name>Rick DeNatale</name>
    <email>rick.denatale@gmail.com</email>
  </committer>
</commit>
