cldr-plurals 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +3 -5
- data/History.txt +4 -0
- data/lib/cldr-plurals/ruby_emitter.rb +3 -3
- data/lib/cldr-plurals/version.rb +1 -1
- data/spec/spec_helper.rb +9 -0
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de9e5324a2d08c79db6732520b97bc327ffe3f02
|
4
|
+
data.tar.gz: deefd40040f23526295eb1f896bf81a28a02a76a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72945352775128fad0bdf2a1422d2dfd0f299fe6fed4bc704f7411a1cc2b13909ba922ffc4df334af84b8bcd1c9b469aa3bbbbd70dfe609bd12d172d79078c54
|
7
|
+
data.tar.gz: 4db915e627d0a90d81b9f0b31d3f555ec896bfec440c6537a39de66c541bb17f54fbe6bbb7e4fd4d3f2811fe645d09eebc0c54c1a3f8e4ca0234e6e87ef0c55e
|
data/Gemfile
CHANGED
@@ -12,9 +12,7 @@ group :test do
|
|
12
12
|
gem 'rspec'
|
13
13
|
gem 'rr'
|
14
14
|
|
15
|
-
gem 'therubyracer', '~> 0.12
|
16
|
-
gem 'cldr-plurals-runtime-rb', '~> 1.0
|
17
|
-
gem 'cldr-plurals-runtime-js', '~> 1.0
|
18
|
-
|
19
|
-
gem 'libv8', '= 3.16.14.11' # 2016-04-20 lock to older working version on Clang/OS X (3.16.14.13 won't compile)
|
15
|
+
gem 'therubyracer', '~> 0.12'
|
16
|
+
gem 'cldr-plurals-runtime-rb', '~> 1.0'
|
17
|
+
gem 'cldr-plurals-runtime-js', '~> 1.0'
|
20
18
|
end
|
data/History.txt
CHANGED
@@ -32,11 +32,11 @@ module CldrPlurals
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def emit_or_condition(cond)
|
35
|
-
"(#{emit(cond.left)} || #{emit(cond.right)})"
|
35
|
+
"((#{emit(cond.left)}) || (#{emit(cond.right)}))"
|
36
36
|
end
|
37
37
|
|
38
38
|
def emit_and_condition(cond)
|
39
|
-
"(#{emit(cond.left)} && #{emit(cond.right)})"
|
39
|
+
"((#{emit(cond.left)}) && (#{emit(cond.right)}))"
|
40
40
|
end
|
41
41
|
|
42
42
|
def emit_expression(expr)
|
@@ -84,7 +84,7 @@ module CldrPlurals
|
|
84
84
|
|
85
85
|
def emit_range_check(range, operand)
|
86
86
|
# a..b represents all *integers* between a and b, inclusive.
|
87
|
-
n = emit(operand)
|
87
|
+
n = "(#{emit(operand)})"
|
88
88
|
"(#{n}.floor == #{n}) && (#{n} >= #{range.start}) && (#{n} <= #{range.finish})"
|
89
89
|
end
|
90
90
|
|
data/lib/cldr-plurals/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -8,6 +8,10 @@ RSpec.configure do |config|
|
|
8
8
|
config.mock_with :rr
|
9
9
|
end
|
10
10
|
|
11
|
+
ADDITIONAL_SAMPLES = {
|
12
|
+
"ar" => { other: %w(3.1 3.2 3.3) } # improve test coverage for Arabic
|
13
|
+
}
|
14
|
+
|
11
15
|
def each_rule
|
12
16
|
samples.each_pair do |locales, rules|
|
13
17
|
rules.each do |rule|
|
@@ -19,6 +23,7 @@ def each_rule
|
|
19
23
|
end
|
20
24
|
end
|
21
25
|
|
26
|
+
|
22
27
|
def each_rule_list
|
23
28
|
samples.each_pair do |locales, rules|
|
24
29
|
rule_list = CldrPlurals::Compiler::RuleList.new(locales)
|
@@ -35,6 +40,10 @@ def each_rule_list
|
|
35
40
|
end
|
36
41
|
end
|
37
42
|
|
43
|
+
(ADDITIONAL_SAMPLES[locales] || {}).each do |name, more_samples|
|
44
|
+
samples_per_name[name].concat(more_samples)
|
45
|
+
end
|
46
|
+
|
38
47
|
yield rule_list, samples_per_name
|
39
48
|
end
|
40
49
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cldr-plurals
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cameron Dutro
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Tokenizes and parses CLDR plural rules and provides a mechanism for emitting
|
14
14
|
them as source code
|
@@ -62,4 +62,3 @@ specification_version: 4
|
|
62
62
|
summary: Tokenizes and parses CLDR plural rules and provides a mechanism for emitting
|
63
63
|
them as source code
|
64
64
|
test_files: []
|
65
|
-
has_rdoc: true
|