string_date_accessors 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.4
1
+ 0.0.5
@@ -1,4 +1,5 @@
1
1
  require 'date'
2
+ require 'active_support'
2
3
  module StringDateAccessors
3
4
  def self.date_format=(string)
4
5
  @date_format = string
@@ -21,8 +22,8 @@ module StringDateAccessors
21
22
  end
22
23
 
23
24
  def self.formatted(input)
24
- DateTime.strptime(input, datetime_format)
25
- rescue ArgumentError
25
+ DateTime.strptime(input, datetime_format).to_time
26
+ rescue ArgumentError, NoMethodError
26
27
  begin
27
28
  Date.strptime(input, date_format)
28
29
  rescue ArgumentError
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{string_date_accessors}
8
- s.version = "0.0.4"
8
+ s.version = "0.0.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Andrew Bruce"]
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 4
9
- version: 0.0.4
8
+ - 5
9
+ version: 0.0.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - Andrew Bruce