Permalink
Browse files

cleanup ruby warnings in code when running tests

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

0 comments on commit f3beeba

Please sign in to comment.