twitter_cldr 4.4.1 → 4.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 86755164899ce2e61eceda0bdd065091cff3c06d
4
- data.tar.gz: de3aab2bae85c48cc15215df2248ab83d44d8e91
3
+ metadata.gz: 8a2cc94453f8c78e48d4303c07f59ce8a95d71cc
4
+ data.tar.gz: f634a139429741d33ba009d334d4e6c5399f14e0
5
5
  SHA512:
6
- metadata.gz: 46d89e23e975a868f389fdb6d11aaab63e0fe8f66ad2f5442a5deb54afbc24db9ee03305a259bc4f144134693b8afb6c6b154ec6cb3f729f719549d4b0a11aec
7
- data.tar.gz: deb156b43344b11924b1725dd5f0a3aaa421f1e2ec9d45c8379cd5c69a29984a333cdc578d8b6170eb32b209996bf7c7b8ca671691a28ce62614ed76850f3baf
6
+ metadata.gz: 50385b053655d25df528fb2005c8a9a347b12e6df95008b705027895bff0936186743272992217ce3b6dc76605747b08d93a701f86ef6714559e1bcf4555f1f4
7
+ data.tar.gz: 1bf6b3213b3815754115f08a322b4182e58a16c4a5b488b172b2292910dfc611de0d79b83d9af16479369b2af768a779f1ccf277a1626f4fde9e8d70b2a8ed77
@@ -15,8 +15,8 @@ module TwitterCldr
15
15
 
16
16
  def format(list, type = :default)
17
17
  if res = resource_for_type(type)
18
- if res.include?(list.size)
19
- compose(res[list.size], list)
18
+ if res.include?(:"#{list.size}")
19
+ compose(res[:"#{list.size}"], list)
20
20
  else
21
21
  compose_list(list, res)
22
22
  end
@@ -71,4 +71,4 @@ module TwitterCldr
71
71
 
72
72
  end
73
73
  end
74
- end
74
+ end
@@ -4,5 +4,5 @@
4
4
  # http://www.apache.org/licenses/LICENSE-2.0
5
5
 
6
6
  module TwitterCldr
7
- VERSION = '4.4.1'
7
+ VERSION = '4.4.2'
8
8
  end
@@ -19,29 +19,51 @@ describe ListFormatter do
19
19
  end
20
20
 
21
21
  describe "#format" do
22
- let(:list) { ["larry", "curly", "moe"] }
22
+ context 'with two elements' do
23
+ let(:list) { ["larry", "curly"] }
23
24
 
24
- context "with an English list formatter" do
25
- before(:each) do
26
- @formatter = ListFormatter.new(:en)
25
+ context 'with an English list formatter' do
26
+ let(:formatter) { ListFormatter.new(:en) }
27
+
28
+ it 'formats English lists correctly using various types' do
29
+ expect(formatter.format(list)).to eq("larry and curly")
30
+ expect(formatter.format(list, :unit)).to eq("larry, curly")
31
+ expect(formatter.format(list, :"unit-narrow")).to eq("larry curly")
32
+ end
27
33
  end
28
34
 
29
- it "formats English lists correctly using various types" do
30
- expect(@formatter.format(list)).to eq("larry, curly, and moe")
31
- expect(@formatter.format(list, :unit)).to eq("larry, curly, moe")
32
- expect(@formatter.format(list, :"unit-narrow")).to eq("larry curly moe")
35
+ context 'with a Spanish list formatter' do
36
+ let(:formatter) { ListFormatter.new(:es) }
37
+
38
+ it 'formats correctly' do
39
+ expect(formatter.format(list)).to eq("larry y curly")
40
+ expect(formatter.format(list, :unit)).to eq("larry y curly")
41
+ expect(formatter.format(list, :"unit-narrow")).to eq("larry curly")
42
+ end
33
43
  end
34
44
  end
35
45
 
36
- context "with a Spanish list formatter" do
37
- before(:each) do
38
- @formatter = ListFormatter.new(:es)
46
+ context 'with three elements' do
47
+ let(:list) { ["larry", "curly", "moe"] }
48
+
49
+ context "with an English list formatter" do
50
+ let(:formatter) { ListFormatter.new(:en) }
51
+
52
+ it "formats English lists correctly using various types" do
53
+ expect(formatter.format(list)).to eq("larry, curly, and moe")
54
+ expect(formatter.format(list, :unit)).to eq("larry, curly, moe")
55
+ expect(formatter.format(list, :"unit-narrow")).to eq("larry curly moe")
56
+ end
39
57
  end
40
58
 
41
- it "formats Spanish lists correctly using various types" do
42
- expect(@formatter.format(list)).to eq("larry, curly y moe")
43
- expect(@formatter.format(list, :unit)).to eq("larry, curly y moe")
44
- expect(@formatter.format(list, :"unit-narrow")).to eq("larry curly moe")
59
+ context "with a Spanish list formatter" do
60
+ let(:formatter) { ListFormatter.new(:es) }
61
+
62
+ it "formats Spanish lists correctly using various types" do
63
+ expect(formatter.format(list)).to eq("larry, curly y moe")
64
+ expect(formatter.format(list, :unit)).to eq("larry, curly y moe")
65
+ expect(formatter.format(list, :"unit-narrow")).to eq("larry curly moe")
66
+ end
45
67
  end
46
68
  end
47
69
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twitter_cldr
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.4.1
4
+ version: 4.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cameron Dutro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-26 00:00:00.000000000 Z
11
+ date: 2017-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: camertron-eprun