useful_helpers 0.0.22 → 0.0.23

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,13 +2,15 @@
2
2
  module UsefulHelpers
3
3
  module Helpers
4
4
  module DateTimeHelper
5
- def localize_date(date, format=:long)
6
- begin
7
- I18n.localize(date, :format => format)
8
- rescue
9
- ""
10
- end
11
- end
5
+ def localize_date(date, format=:long)
6
+ I18n.localize(date, :format => format) rescue ""
7
+ end
8
+
9
+ ["long", "short"].each do |date_format|
10
+ define_method "#{date_format}date" do |date|
11
+ I18n.l(date, :format => date_format.to_sym) rescue ""
12
+ end
13
+ end
12
14
  end
13
15
  end
14
16
  end
@@ -1,3 +1,3 @@
1
1
  module UsefulHelpers
2
- VERSION = "0.0.22"
2
+ VERSION = "0.0.23"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: useful_helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.22
4
+ version: 0.0.23
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-17 00:00:00.000000000 Z
12
+ date: 2013-07-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler