i18n-complements 0.0.12 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8ede3c28aed23c5d67ef9500395c8f2b690027f
|
4
|
+
data.tar.gz: 23ffd3eb2997c725f28d022a14ec8dfc03e897ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8e08fe273d4d45d1e513b36baa1f01aa8efe6d8b326df3f24b946e5b88f56dd62c3abd6069b165b60d4dc0d80c334e18187bc26099aaca89ca7555e613edfa7
|
7
|
+
data.tar.gz: 1e327cda4ea19ef92bb505dd3a834a8edf7d0605226fc8d11b84ea30fce5634f788f9f95f08750aa76a2ec25e91787e73c5b95bf0ff77d2bf7e6918d4a613706
|
@@ -3,9 +3,10 @@ module I18n
|
|
3
3
|
|
4
4
|
class Simple
|
5
5
|
|
6
|
-
def localize_with_complements(locale, object, format =
|
6
|
+
def localize_with_complements(locale, object, format = nil, options = {})
|
7
7
|
|
8
8
|
if object.respond_to?(:strftime)
|
9
|
+
format ||= :default
|
9
10
|
return localize_without_complements(locale, object, format, options)
|
10
11
|
elsif object.respond_to?(:abs)
|
11
12
|
if currency = options[:currency]
|
@@ -37,7 +38,7 @@ module I18n
|
|
37
38
|
end
|
38
39
|
end
|
39
40
|
elsif object.is_a?(TrueClass) or object.is_a?(FalseClass)
|
40
|
-
return I18n.translate("boolean.
|
41
|
+
return I18n.translate("boolean.human.#{object.to_s}_class")
|
41
42
|
elsif object.is_a?(String)
|
42
43
|
return object
|
43
44
|
else
|
data/test/test_currency_rates.rb
CHANGED
@@ -19,12 +19,11 @@ class TestCurrencies < Test::Unit::TestCase
|
|
19
19
|
|
20
20
|
r1 = I18nComplements::Numisma.currency_rate("EUR", "JPY")
|
21
21
|
r2 = I18nComplements::Numisma.currency_rate("JPY", "EUR")
|
22
|
-
assert 0.01 >= 1 - (r1 * r2).round(2)
|
22
|
+
assert 0.01 >= 1 - (r1 * r2).round(2), "EUR -> JPY: #{r1}, JPY -> EUR: #{r2}, #{r1 * r2}, #{(r1 * r2).round(2)}"
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
24
|
+
rate = I18nComplements::Numisma.currency_rate("EUR", "JPY")
|
25
|
+
assert !rate.nil?, "Rate cannot be nil"
|
26
|
+
assert rate != 0, "Rate cannot be null"
|
28
27
|
end
|
29
28
|
|
30
29
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: i18n-complements
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brice Texier
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|