Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Whitespace cleanup so it commits cleanly in apps using Git's pre-comm…

…it hooks.
  • Loading branch information...
commit 1349064f3f5feba6b1bd2313c6355acd34eda143 1 parent c257c45
@grempe grempe authored
View
1  MIT-LICENSE
@@ -18,3 +18,4 @@ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
View
10 README
@@ -9,16 +9,16 @@ Example
You can render the current year in your ERb views like so:
<%= current_year -%>
-
-If you want to provide a year range, you can use year_range and provide the
-year that you started.
+
+If you want to provide a year range, you can use year_range and provide the
+year that you started.
Example: With the assumption that the current year was 2008
-
+
<%= year_range(2005) -%> # => 2005-2008
<%= year_range(2008) -%> # => 2008 (just returns current year)
-You can access the code here:
+You can access the code here:
* http://github.com/robbyrussell/year_after_year/
View
1  init.rb
@@ -1,2 +1,3 @@
require 'year_after_year'
ActionController::Base.helper PlanetArgon::YearAfterYear
+
View
2  lib/year_after_year.rb
@@ -5,7 +5,7 @@ module YearAfterYear
def current_year
Time.now.strftime('%Y')
end
-
+
def year_range(start_year)
if start_year.to_s == current_year
current_year
View
12 spec/year_after_year_spec.rb
@@ -3,9 +3,9 @@
describe PlanetArgon::YearAfterYear, 'current_year' do
before(:each) do
t = mock('Time')
- Time.stub!(:now).and_return( Time.parse( 'Sun Jan 27 15:31:39 -0800 2006' ) )
+ Time.stub!(:now).and_return( Time.parse( 'Sun Jan 27 15:31:39 -0800 2006' ) )
end
-
+
it 'should return the current year example: 2006' do
current_year.should == '2006'
end
@@ -14,14 +14,14 @@
describe PlanetArgon::YearAfterYear, 'year_range()' do
before(:each) do
t = mock('Time')
- Time.stub!(:now).and_return( Time.parse( 'Sun Jan 27 15:31:39 -0800 2006' ) )
+ Time.stub!(:now).and_return( Time.parse( 'Sun Jan 27 15:31:39 -0800 2006' ) )
end
-
+
it 'should return a range of years when provided a start year' do
year_range(2004).should == '2004-2006'
end
-
+
it 'should return only the current year if the start year is the same' do
year_range(2006).should == '2006'
- end
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.