ordinalize_full 1.2.0 → 1.2.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: 9c4ec1c859df34e7e1fc4406dc770305b8edacbe
4
- data.tar.gz: 4489967b56b7b24185081858c528ec1b1d273790
3
+ metadata.gz: d09ede4cebe7628af68020a5b0dd83fece85fdf8
4
+ data.tar.gz: 6ac4cac4fdff2d4877cdacf1204861b41ed1d933
5
5
  SHA512:
6
- metadata.gz: 28177340ea0e2048af4b6c13b3653e19266331ff1b3a349df2ea05befacbaf9da034e2d075f9d008be9512e3a37f82fa5e77d8e3c6088da13c60998b7dc44123
7
- data.tar.gz: 4fda783b4bcd3e7440c64883e2dfef93056a9dd05bdd31f5ee36c190ddcf9cc4ec2d0f861ab2ca4857d69a7f77abb94aa24a9c24cea5bd1640fc6daa3e00020e
6
+ metadata.gz: d50191512b2affe24ce8311f89a72396dfa77b6d116fe4261927792a2e8868a8fd87e2d4f20d9b53509a8b020bdf1d95bb5891477b22fbf222cbc57b8689800f
7
+ data.tar.gz: 097383b19eec711220ca39293716d99ad92938d426e4816cd2071efad572681888dc03197658669acb0b02b87dc68eb1debe5493cffec680a1e6ad807f84b163
data/README.md CHANGED
@@ -40,5 +40,5 @@ MyIntegerLikeClass.new.ordinalize_in_full #=> "forty second"
40
40
  ## Limitations
41
41
 
42
42
  - only works up to 100 (for now)
43
- - locales only available in English, French and Italian (pull requests welcome!)
43
+ - locales only available in English, French, Italian and Dutch (pull requests welcome!)
44
44
 
@@ -0,0 +1,34 @@
1
+ nl:
2
+ ordinalize_full:
3
+ n_1: eerste
4
+ n_2: tweede
5
+ n_3: derde
6
+ n_4: vierde
7
+ n_5: vijfde
8
+ n_6: zesde
9
+ n_7: zevende
10
+ n_8: achtste
11
+ n_9: negende
12
+ n_10: tiende
13
+ n_11: elfde
14
+ n_12: twaalfde
15
+ n_13: dertiende
16
+ n_14: veertiende
17
+ n_15: vijftiende
18
+ n_16: zestiende
19
+ n_17: zeventiende
20
+ n_18: achttiende
21
+ n_19: negentiende
22
+ n_20: twintigste
23
+ n_21: eenentwintigste
24
+ n_22: tweeëntwintigste
25
+ n_30: dertigste
26
+ n_40: veertigste
27
+ n_50: vijftigste
28
+ n_60: zestigste
29
+ n_70: zeventigste
30
+ n_80: tachtigste
31
+ n_90: negentigste
32
+ n_100: honderdste
33
+ n_1000: duizendste
34
+ n_1000000: miljoenste
@@ -37,6 +37,8 @@ private
37
37
  self == 1 ? "er" : "ème"
38
38
  when :it
39
39
  "°"
40
+ when :nl
41
+ self % 100 == 8 || self % 100 == 1 || self % 100 > 19 || self % 100 == 0 ? "ste" : "de"
40
42
  else
41
43
  raise NotImplementedError, "Unknown locale #{I18n.locale}"
42
44
  end
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "ordinalize_full"
7
- spec.version = "1.2.0"
7
+ spec.version = "1.2.1"
8
8
  spec.authors = ["Cédric Félizard"]
9
9
  spec.email = ["cedric@felizard.fr"]
10
10
  spec.summary = %q{Turns a number into an ordinal string such as first, second, third or 1st, 2nd, 3rd.}
@@ -16,6 +16,13 @@ describe OrdinalizeFull do
16
16
  specify { expect(42.ordinalize_in_full).to eq("quarante-deuxième") }
17
17
  end
18
18
 
19
+ context "with locale = :nl" do
20
+ before { I18n.locale = :nl }
21
+
22
+ specify { expect(1.ordinalize_in_full).to eq("eerste") }
23
+ specify { expect(22.ordinalize_in_full).to eq("tweeëntwintigste") }
24
+ end
25
+
19
26
  it "raises for unknown locales" do
20
27
  I18n.locale = :zz
21
28
  expect { 1.ordinalize_in_full }.to raise_error(NotImplementedError)
@@ -48,6 +55,13 @@ describe OrdinalizeFull do
48
55
  specify { expect(1.ordinalize(in_full: false)).to eq("1°") }
49
56
  end
50
57
 
58
+ context "with locale = :nl" do
59
+ before { I18n.locale = :nl }
60
+
61
+ specify { expect(1.ordinalize(in_full: true)).to eq("eerste") }
62
+ specify { expect(1.ordinalize(in_full: false)).to eq("1ste") }
63
+ end
64
+
51
65
  it "raises for unknown locales" do
52
66
  I18n.locale = :zz
53
67
  expect { 1.ordinalize(in_full: false) }.to raise_error(NotImplementedError)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ordinalize_full
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cédric Félizard
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-10 00:00:00.000000000 Z
11
+ date: 2014-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
@@ -85,6 +85,7 @@ files:
85
85
  - lib/ordinalize_full/locales/en.yml
86
86
  - lib/ordinalize_full/locales/fr.yml
87
87
  - lib/ordinalize_full/locales/it.yml
88
+ - lib/ordinalize_full/locales/nl.yml
88
89
  - ordinalize_full.gemspec
89
90
  - spec/ordinalize_full_spec.rb
90
91
  homepage: https://github.com/infertux/ordinalize_full
@@ -107,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
107
108
  version: '0'
108
109
  requirements: []
109
110
  rubyforge_project:
110
- rubygems_version: 2.2.2
111
+ rubygems_version: 2.4.2
111
112
  signing_key:
112
113
  specification_version: 4
113
114
  summary: Turns a number into an ordinal string such as first, second, third or 1st,