Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

We love fixnum. current_year will get converted into a string when ca…

…lled in a template, anyway. Removed spurious whitespace in init.
  • Loading branch information...
commit 2174a960d91ab86e53476c133a898ce47a04f550 1 parent 179f64d
Tim Riley authored
View
1  init.rb
@@ -1,3 +1,2 @@
require 'year_after_year'
ActionController::Base.helper PlanetArgon::YearAfterYear
-
View
6 lib/year_after_year.rb
@@ -3,11 +3,11 @@ module YearAfterYear
# Renders the current year.
# Example: 2008
def current_year
- Time.now.strftime('%Y')
+ Time.now.year
end
- def year_range( start_year = Date.today().year )
- [start_year, Date.today().year].sort.uniq.join('-')
+ def year_range( start_year = current_year )
+ [start_year, current_year].sort.uniq.join('-')
end
end
end
View
2  spec/year_after_year_spec.rb
@@ -7,7 +7,7 @@
end
it 'should return the current year example: 2006' do
- current_year.should == '2006'
+ current_year.should == 2006
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.