i18n-date 0.0.2 → 0.0.3b
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/.gitignore +1 -1
- data/bin/release.sh +4 -4
- data/lib/i18n-date/version.rb +1 -1
- data/lib/i18n-date.rb +1 -2
- data/spec/date_spec.rb +11 -1
- metadata +5 -6
data/.gitignore
CHANGED
data/bin/release.sh
CHANGED
@@ -8,7 +8,7 @@ gem inabox i18n-date-${gem_version}.gem
|
|
8
8
|
|
9
9
|
rm i18n-date-${gem_version}.gem
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
11
|
+
git pull origin develop
|
12
|
+
git push origin develop
|
13
|
+
git tag -a -m "i18n-date-${gem_version}" i18n-version-${gem_version}
|
14
|
+
git push --tags
|
data/lib/i18n-date/version.rb
CHANGED
data/lib/i18n-date.rb
CHANGED
@@ -41,7 +41,7 @@ class Date
|
|
41
41
|
|
42
42
|
MONTH_TRANSLATIONS.merge! make_month_hash(%w/janeiro fevereiro março abril maio junho julho agosto setembro outubro novembro dezembro/) # Portuguese
|
43
43
|
|
44
|
-
MONTH_TRANSLATIONS.merge! make_month_hash(%w/jan
|
44
|
+
MONTH_TRANSLATIONS.merge! make_month_hash(%w/jan fev mar abr mai jun jul ago set out nov dez/) # Portuguese short form
|
45
45
|
|
46
46
|
DAY_TRANSLATIONS = {}
|
47
47
|
|
@@ -81,7 +81,6 @@ class Date
|
|
81
81
|
return new_date.join(' ').sub(month_from, month_to.to_s) if month_to
|
82
82
|
end
|
83
83
|
|
84
|
-
binding.pry
|
85
84
|
string
|
86
85
|
end
|
87
86
|
end
|
data/spec/date_spec.rb
CHANGED
@@ -1,14 +1,17 @@
|
|
1
|
+
#encoding: UTF-8
|
1
2
|
require './lib/i18n-date.rb'
|
2
3
|
|
3
4
|
describe Date do
|
4
5
|
|
5
6
|
RESULT_DATE = "22 June 2010"
|
7
|
+
RESULT_DATE_MAY = '22 May 2010'
|
8
|
+
RESULT_DATE_MARCH = '22 March 2010'
|
6
9
|
|
7
10
|
it "should respond to parse_international" do
|
8
11
|
Date.should be_respond_to(:parse_international)
|
9
12
|
end
|
10
13
|
|
11
|
-
it "should return a date correctly" do
|
14
|
+
it "should return a date correctly for Spanish" do
|
12
15
|
Date.month_to_english("22 jun 2010").should be_eql(RESULT_DATE)
|
13
16
|
Date.month_to_english("22 de jun 2010").should be_eql(RESULT_DATE)
|
14
17
|
Date.month_to_english("22 de jun de 2010").should be_eql(RESULT_DATE)
|
@@ -20,4 +23,11 @@ describe Date do
|
|
20
23
|
Date.month_to_english("Viernes 14 de diciembre").should be_eql('14 December')
|
21
24
|
end
|
22
25
|
|
26
|
+
it "should return a date correctly for Portuguese" do
|
27
|
+
Date.month_to_english('22 mai 2010').should be_eql(RESULT_DATE_MAY)
|
28
|
+
Date.month_to_english('22 maio 2010').should be_eql(RESULT_DATE_MAY)
|
29
|
+
Date.month_to_english('22 março 2010').should be_eql(RESULT_DATE_MARCH)
|
30
|
+
|
31
|
+
end
|
32
|
+
|
23
33
|
end
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: i18n-date
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.3b
|
5
|
+
prerelease: 5
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Gonzalo Testa
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-11-
|
12
|
+
date: 2012-11-12 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.
|
@@ -45,9 +45,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
45
45
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
46
46
|
none: false
|
47
47
|
requirements:
|
48
|
-
- - ! '
|
48
|
+
- - ! '>'
|
49
49
|
- !ruby/object:Gem::Version
|
50
|
-
version:
|
50
|
+
version: 1.3.1
|
51
51
|
requirements: []
|
52
52
|
rubyforge_project:
|
53
53
|
rubygems_version: 1.8.24
|
@@ -56,4 +56,3 @@ specification_version: 3
|
|
56
56
|
summary: Gem to convert intenational dates into a english date
|
57
57
|
test_files:
|
58
58
|
- spec/date_spec.rb
|
59
|
-
has_rdoc:
|