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: e315e195eaf2ffc7641dafa65b29f64daf5270cf
4
- data.tar.gz: ade2b242b65632eb4164c42ae859af019604f4d1
3
+ metadata.gz: c8ede3c28aed23c5d67ef9500395c8f2b690027f
4
+ data.tar.gz: 23ffd3eb2997c725f28d022a14ec8dfc03e897ad
5
5
  SHA512:
6
- metadata.gz: 03d540be38622615ed373e3f48aeb9288b58c16b12fbb5bb5aba1e9bd4e1270806b9ac04faeda0e7596b1a7ea61cf54165549970295ed5e19328e7c1ac3fe07a
7
- data.tar.gz: 9fe8dc68f570ca829850deebdf3fd1f5bac7c5afbbb3c7bc0aaa8650412dbb1bb2b5ce8b95f631cfe41faffbc9a027077bb81c777835bdd89f747910feed8d7d
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 = :default, options = {})
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.formats.#{format}.#{object.to_s}")
41
+ return I18n.translate("boolean.human.#{object.to_s}_class")
41
42
  elsif object.is_a?(String)
42
43
  return object
43
44
  else
@@ -1,3 +1,3 @@
1
1
  module I18nComplements
2
- VERSION = "0.0.12"
2
+ VERSION = "0.0.13"
3
3
  end
@@ -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
- assert_nothing_raised do
25
- I18nComplements::Numisma.currency_rate("EUR", "JPY")
26
- end
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.12
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-10-12 00:00:00.000000000 Z
11
+ date: 2014-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n