i18n_data 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/i18n_data.rb +3 -7
- data/lib/i18n_data/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9f6c5d2fd7892ae09db4bd6dd2b7ce38fa6895a94d823c666b0af763fb0be646
|
4
|
+
data.tar.gz: efea2ece2e8f0a1d725303cfc9c43d54887bd8958a96538a511f17717b559fa1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 128c9bb8a1479702dd00919de3ccdb867c2cc7bb904ad768517ea1bd79bd3c1360a5e8c9b6442d34819d0c945a15934387d763bbba25922f24f5eebe61424a6c
|
7
|
+
data.tar.gz: d159a8289f57daeaa27bd0225baa04283fe60944c7e028892625590b5a07f7b35013e3aa86ef9addc68dbf10e55bb9e7811b64d7f6a39d879a322df027aa5245
|
data/lib/i18n_data.rb
CHANGED
@@ -47,13 +47,9 @@ module I18nData
|
|
47
47
|
|
48
48
|
private
|
49
49
|
|
50
|
-
def fetch(
|
51
|
-
@cache ||= {}
|
52
|
-
|
53
|
-
@cache[args]
|
54
|
-
else
|
55
|
-
@cache[args] = yield
|
56
|
-
end
|
50
|
+
def fetch(type, language_code)
|
51
|
+
@cache ||= Hash.new { |h, k| h[k] = {} }
|
52
|
+
@cache[type].fetch(language_code) { @cache[type][language_code] = yield }
|
57
53
|
end
|
58
54
|
|
59
55
|
# hardcode languages that do not have a default type
|
data/lib/i18n_data/version.rb
CHANGED