Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

cleanup ruby warnings in code when running tests

  • Loading branch information...
commit f3beeba246b1f0010f5822cfc9fac27fbf7ba78a 1 parent 7a1ed03
risk danger olson authored March 22, 2008
5  lib/chronic/repeaters/repeater_day.rb
... ...
@@ -1,6 +1,11 @@
1 1
 class Chronic::RepeaterDay < Chronic::Repeater #:nodoc:
2 2
   DAY_SECONDS = 86_400 # (24 * 60 * 60)
3 3
   
  4
+  def initialize(type)
  5
+    super
  6
+    @current_day_start = nil
  7
+  end
  8
+  
4 9
   def next(pointer)
5 10
     super
6 11
     
5  lib/chronic/repeaters/repeater_day_name.rb
... ...
@@ -1,6 +1,11 @@
1 1
 class Chronic::RepeaterDayName < Chronic::Repeater #:nodoc:
2 2
   DAY_SECONDS = 86400 # (24 * 60 * 60)
3 3
   
  4
+  def initialize(type)
  5
+    super
  6
+    @current_day_start = nil
  7
+  end
  8
+  
4 9
   def next(pointer)
5 10
     super
6 11
     
1  lib/chronic/repeaters/repeater_day_portion.rb
@@ -6,6 +6,7 @@ class Chronic::RepeaterDayPortion < Chronic::Repeater #:nodoc:
6 6
   
7 7
   def initialize(type)
8 8
     super
  9
+    @current_span = nil
9 10
     
10 11
     if type.kind_of? Integer
11 12
       @range = (@type * 60 * 60)..((@type + 12) * 60 * 60)
7  lib/chronic/repeaters/repeater_fortnight.rb
... ...
@@ -1,6 +1,11 @@
1 1
 class Chronic::RepeaterFortnight < Chronic::Repeater #:nodoc:
2 2
   FORTNIGHT_SECONDS = 1_209_600 # (14 * 24 * 60 * 60)
3  
-  
  3
+
  4
+  def initialize(type)
  5
+    super
  6
+    @current_fortnight_start = nil
  7
+  end
  8
+
4 9
   def next(pointer)
5 10
     super
6 11
     
7  lib/chronic/repeaters/repeater_hour.rb
... ...
@@ -1,6 +1,11 @@
1 1
 class Chronic::RepeaterHour < Chronic::Repeater #:nodoc:
2 2
   HOUR_SECONDS = 3600 # 60 * 60
3  
-  
  3
+
  4
+  def initialize(type)
  5
+    super
  6
+    @current_hour_start = nil
  7
+  end
  8
+
4 9
   def next(pointer)
5 10
     super
6 11
     
7  lib/chronic/repeaters/repeater_minute.rb
... ...
@@ -1,6 +1,11 @@
1 1
 class Chronic::RepeaterMinute < Chronic::Repeater #:nodoc:
2 2
   MINUTE_SECONDS = 60
3  
-  
  3
+
  4
+  def initialize(type)
  5
+    super
  6
+    @current_minute_start = nil
  7
+  end
  8
+
4 9
   def next(pointer = :future)
5 10
     super
6 11
     
7  lib/chronic/repeaters/repeater_month.rb
... ...
@@ -1,7 +1,12 @@
1 1
 class Chronic::RepeaterMonth < Chronic::Repeater #:nodoc:
2 2
   MONTH_SECONDS = 2_592_000 # 30 * 24 * 60 * 60
3 3
   YEAR_MONTHS = 12
4  
-  
  4
+
  5
+  def initialize(type)
  6
+    super
  7
+    @current_month_start = nil
  8
+  end
  9
+
5 10
   def next(pointer)
6 11
     super
7 12
     
13  lib/chronic/repeaters/repeater_month_name.rb
... ...
@@ -1,6 +1,11 @@
1 1
 class Chronic::RepeaterMonthName < Chronic::Repeater #:nodoc:
2 2
   MONTH_SECONDS = 2_592_000 # 30 * 24 * 60 * 60
3  
-  
  3
+
  4
+  def initialize(type)
  5
+    super
  6
+    @current_month_begin = nil
  7
+  end
  8
+
4 9
   def next(pointer)
5 10
     super
6 11
     
@@ -10,19 +15,19 @@ def next(pointer)
10 15
       when :future
11 16
         if @now.month < target_month
12 17
           @current_month_begin = Time.construct(@now.year, target_month)
13  
-        else @now.month > target_month
  18
+        elsif @now.month > target_month
14 19
           @current_month_begin = Time.construct(@now.year + 1, target_month)
15 20
         end
16 21
       when :none
17 22
         if @now.month <= target_month
18 23
           @current_month_begin = Time.construct(@now.year, target_month)
19  
-        else @now.month > target_month
  24
+        elsif @now.month > target_month
20 25
           @current_month_begin = Time.construct(@now.year + 1, target_month)
21 26
         end
22 27
       when :past
23 28
         if @now.month > target_month
24 29
           @current_month_begin = Time.construct(@now.year, target_month)
25  
-        else @now.month < target_month
  30
+        elsif @now.month < target_month
26 31
           @current_month_begin = Time.construct(@now.year - 1, target_month)
27 32
         end
28 33
       end
7  lib/chronic/repeaters/repeater_season.rb
@@ -55,7 +55,12 @@ class Chronic::RepeaterSeason < Chronic::Repeater #:nodoc:
55 55
               :summer => Season.new( MiniDate.new(6,21),MiniDate.new(9,22) ),
56 56
               :autumn => Season.new( MiniDate.new(9,23),MiniDate.new(12,21) ),
57 57
               :winter => Season.new( MiniDate.new(12,22),MiniDate.new(3,19) ) }
58  
-  
  58
+
  59
+  def initialize(type)
  60
+    super
  61
+    @next_season_start = nil
  62
+  end
  63
+
59 64
   def next(pointer)
60 65
     super
61 66
     
7  lib/chronic/repeaters/repeater_second.rb
... ...
@@ -1,6 +1,11 @@
1 1
 class Chronic::RepeaterSecond < Chronic::Repeater #:nodoc:
2 2
   SECOND_SECONDS = 1 # haha, awesome
3  
-  
  3
+
  4
+  def initialize(type)
  5
+    super
  6
+    @second_start = nil
  7
+  end
  8
+
4 9
   def next(pointer = :future)
5 10
     super
6 11
     
1  lib/chronic/repeaters/repeater_time.rb
@@ -25,6 +25,7 @@ def to_s
25 25
   end
26 26
   
27 27
   def initialize(time, options = {})
  28
+    @current_time = nil
28 29
     t = time.gsub(/\:/, '')
29 30
     
30 31
     @type = 
7  lib/chronic/repeaters/repeater_week.rb
... ...
@@ -1,6 +1,11 @@
1 1
 class Chronic::RepeaterWeek < Chronic::Repeater #:nodoc:
2 2
   WEEK_SECONDS = 604800 # (7 * 24 * 60 * 60)
3  
-  
  3
+
  4
+  def initialize(type)
  5
+    super
  6
+    @current_week_start = nil
  7
+  end
  8
+
4 9
   def next(pointer)
5 10
     super
6 11
     
5  lib/chronic/repeaters/repeater_weekday.rb
@@ -2,6 +2,11 @@ class Chronic::RepeaterWeekday < Chronic::Repeater #:nodoc:
2 2
   WEEK_WEEKDAYS = 5
3 3
   DAY_SECONDS = 86400 # (24 * 60 * 60)
4 4
   
  5
+  def initialize(type)
  6
+    super
  7
+    @current_weekday_start = nil
  8
+  end
  9
+  
5 10
   def next(pointer)
6 11
     super
7 12
     
5  lib/chronic/repeaters/repeater_weekend.rb
... ...
@@ -1,5 +1,10 @@
1 1
 class Chronic::RepeaterWeekend < Chronic::Repeater #:nodoc:
2 2
   WEEKEND_SECONDS = 172_800 # (2 * 24 * 60 * 60)
  3
+
  4
+  def initialize(type)
  5
+    super
  6
+    @current_week_start = nil
  7
+  end
3 8
   
4 9
   def next(pointer)
5 10
     super
5  lib/chronic/repeaters/repeater_year.rb
... ...
@@ -1,6 +1,11 @@
1 1
 class Chronic::RepeaterYear < Chronic::Repeater #:nodoc:
2 2
   YEAR_SECONDS =  31536000  # 365 * 24 * 60 * 60
3 3
   
  4
+  def initialize(type)
  5
+    super
  6
+    @current_year_start = nil
  7
+  end
  8
+  
4 9
   def next(pointer)
5 10
     super
6 11
     

0 notes on commit f3beeba

Please sign in to comment.
Something went wrong with that request. Please try again.