i18n-date 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/lib/i18n-date.rb CHANGED
@@ -1,6 +1,5 @@
1
1
  #encoding: UTF-8
2
2
  require 'date'
3
- require 'pry'
4
3
  require "i18n-date/version"
5
4
 
6
5
  class Date
@@ -11,8 +10,12 @@ class Date
11
10
  end
12
11
 
13
12
  private
14
-
15
- NonValidObject = 'Invalid object, it should be a String'
13
+
14
+ class NonValidObject < StandardError
15
+ def to_s
16
+ 'Invalid object, it should be a String'
17
+ end
18
+ end
16
19
 
17
20
  PREPOSITIONS = (%w/de/) if !Object.const_defined?('PREPOSITIONS')
18
21
 
@@ -1,5 +1,5 @@
1
1
  module I18n
2
2
  module Date
3
- VERSION = "0.0.6"
3
+ VERSION = "0.0.7"
4
4
  end
5
5
  end
data/spec/date_spec.rb CHANGED
@@ -31,10 +31,6 @@ describe Date do
31
31
  end
32
32
 
33
33
  it "should return an error message when object to parse is not a string" do
34
- begin
35
- Date.month_to_english(1)
36
- rescue RuntimeError => e
37
- e.to_s.should be_eql('Invalid object, it should be a String')
38
- end
34
+ expect { Date.month_to_english(1) }.to raise_error(Date::NonValidObject)
39
35
  end
40
36
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: i18n-date
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
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: 2012-11-12 00:00:00.000000000 Z
12
+ date: 2013-06-13 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: This gems is a monkey patch to Date class, that allows to take any Spanish/Portuguese
15
15
  date into a valid ruby date, to simplify operations between them.
@@ -50,7 +50,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
50
50
  version: '0'
51
51
  requirements: []
52
52
  rubyforge_project:
53
- rubygems_version: 1.8.24
53
+ rubygems_version: 1.8.25
54
54
  signing_key:
55
55
  specification_version: 3
56
56
  summary: Gem to convert intenational dates into a english date