singleton-cldr-rb 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sgtn-cldr/formatters/plurals/plural_formatter.rb +0 -26
- data/lib/version.rb +1 -1
- data/spec/unit/plural_spec.rb +0 -5
- 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: a11b0c87eda1d838bda30a9593ab573a6317ece76f64301866cf19b14c2e419c
|
4
|
+
data.tar.gz: 9ab8fe0d1d31b8cdfea5b24e67e7cdce6f600a27e3e9921662812a77e99e3af5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe7c170760798d22d64ac439b129a317c039af91d4027927124d4c60203d673ff5c4a5c401f22950ca7866f7fb7ef851c7acedb8eb48e7d7bbe87cb094365320
|
7
|
+
data.tar.gz: 4166be54ecc061b529c9ad21351815bf9c58be9998af2f712bfde006e7efa3b5ea11ea5cda5279a7866150fd20eb16026f498366518afd963013c0206e152d20
|
@@ -10,25 +10,6 @@ module SgtnCldr
|
|
10
10
|
@locale = TwitterCldr.convert_locale(locale)
|
11
11
|
end
|
12
12
|
|
13
|
-
def deep_symbolize_keys(arg)
|
14
|
-
#puts 3221
|
15
|
-
case arg
|
16
|
-
when Array
|
17
|
-
# puts 44
|
18
|
-
arg.map { |elem| deep_symbolize_keys(elem) }
|
19
|
-
when Hash
|
20
|
-
# puts 77
|
21
|
-
# puts arg
|
22
|
-
# Hash[arg.map { |k, v| [k.is_a?(String) ? k.to_sym : k, deep_symbolize_keys(v)] }]
|
23
|
-
# puts arg
|
24
|
-
Hash[arg.map { |k, v| [k.is_a?(String) ? k.to_sym : k, deep_symbolize_keys(v)] }]
|
25
|
-
else
|
26
|
-
# puts 99
|
27
|
-
# puts arg
|
28
|
-
arg
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
13
|
def num_s(string, replacements)
|
33
14
|
reg = Regexp.union(
|
34
15
|
/%<(\{.*?\})>/
|
@@ -45,13 +26,6 @@ module SgtnCldr
|
|
45
26
|
raise ArgumentError.new('invalide format')
|
46
27
|
end
|
47
28
|
count = replacements[count_placeholder.to_sym].to_s
|
48
|
-
puts 11
|
49
|
-
puts count
|
50
|
-
puts patterns
|
51
|
-
puts deep_symbolize_keys(patterns)[count.to_sym]
|
52
|
-
puts 0
|
53
|
-
puts locale
|
54
|
-
puts TwitterCldr::Formatters::Plurals::Rules.rule_for(count, locale)
|
55
29
|
if patterns.is_a?(Hash)
|
56
30
|
return TwitterCldr::Utils.deep_symbolize_keys(patterns)[count.to_sym]
|
57
31
|
else
|
data/lib/version.rb
CHANGED
data/spec/unit/plural_spec.rb
CHANGED
@@ -17,11 +17,6 @@ describe SgtnCldr do
|
|
17
17
|
expect(str.to_plural_s(:cy, { :cat_count => 2 })).to eq 'there are two cats in the room'
|
18
18
|
s = '%<{"count": {"0": "no horse", "one": "one horse", "other": "%{count} horses"}}>'
|
19
19
|
expect(s.to_plural_s(:cy, { :count => 0 })).to eq 'no horse'
|
20
|
-
puts 0
|
21
|
-
puts "5" + s.to_plural_s(:pt, { :count => 0 })
|
22
|
-
puts TwitterCldr::Formatters::Plurals::Rules.all_for(:pt_PT)
|
23
|
-
puts 0.localize("it").plural_rule
|
24
|
-
puts (0).floor
|
25
20
|
end
|
26
21
|
end
|
27
22
|
end
|