year_after_year 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,11 @@
1
+ require File.expand_path("../view_helpers", __FILE__)
2
+
3
+ module YearAfterYear
4
+ class Railtie < Rails::Railtie
5
+ railtie_name :year_after_year
6
+
7
+ initializer "year_after_year.view_helpers" do
8
+ ActionController::Base.helper YearAfterYear::ViewHelpers
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,3 @@
1
+ module YearAfterYear
2
+ VERSION = "1.0.1"
3
+ end
@@ -0,0 +1,15 @@
1
+ module YearAfterYear
2
+ module ViewHelpers
3
+ # Renders the current year.
4
+ # Example: 2008
5
+ def current_year
6
+ Time.now.year
7
+ end
8
+
9
+ def current_year_range( start_year = current_year, separator = '-' )
10
+ [start_year, current_year].sort.uniq.join(separator)
11
+ end
12
+
13
+ alias :year_range :current_year_range
14
+ end
15
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: year_after_year
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -14,7 +14,7 @@ date: 2011-11-02 00:00:00.000000000Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec
17
- requirement: &2220872000 !ruby/object:Gem::Requirement
17
+ requirement: &2273662940 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,7 +22,7 @@ dependencies:
22
22
  version: '0'
23
23
  type: :development
24
24
  prerelease: false
25
- version_requirements: *2220872000
25
+ version_requirements: *2273662940
26
26
  description: This plugin allows you to keep your copyright year up-to-date.
27
27
  email: github@phlippers.net
28
28
  executables: []
@@ -30,6 +30,9 @@ extensions: []
30
30
  extra_rdoc_files: []
31
31
  files:
32
32
  - lib/year_after_year.rb
33
+ - lib/year_after_year/railtie.rb
34
+ - lib/year_after_year/version.rb
35
+ - lib/year_after_year/view_helpers.rb
33
36
  homepage: https://github.com/phlipper/year_after_year
34
37
  licenses:
35
38
  - MIT