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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 59430246aed9b504a141819047e22ac4f8bd8b5c
4
- data.tar.gz: f3ed5c3a87b64b5fe420007b4a25e2aaeabe8b2a
3
+ metadata.gz: de9e5324a2d08c79db6732520b97bc327ffe3f02
4
+ data.tar.gz: deefd40040f23526295eb1f896bf81a28a02a76a
5
5
  SHA512:
6
- metadata.gz: 1f63dc50f4d0ed9891de5c01a5de8ed845ae28e8c74117381b75573cbb3b58a4e9d40468578ad90cc2b161fd982fab5ca5bf103fc64cae6f8b6ae6ebdaf2cfbd
7
- data.tar.gz: e4c17f51182c16dea89dadc9c137478196284bf50551af68faa35a2f086ca9829acacd67ea7c9e01f72ef408f8ce60354a684b43b2f03a0436d99c65dc235903
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.0'
16
- gem 'cldr-plurals-runtime-rb', '~> 1.0.0'
17
- gem 'cldr-plurals-runtime-js', '~> 1.0.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
@@ -1,3 +1,7 @@
1
+ == 1.1.1
2
+
3
+ * Wrap operands when emitting ranges in Ruby. (@sickp)
4
+
1
5
  == 1.1.0
2
6
 
3
7
  * Better, more accurate range handling according to TR-35.
@@ -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
 
@@ -1,5 +1,5 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  module CldrPlurals
4
- VERSION = '1.1.0'
4
+ VERSION = '1.1.1'
5
5
  end
@@ -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.0
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-04-22 00:00:00.000000000 Z
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