inflections 3.2.8 → 3.2.9.20121201
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.
- data/CHANGELOG.markdown +5 -1
- data/README.markdown +1 -0
- data/Rakefile +1 -0
- data/lib/inflections/nb.rb +14 -0
- data/lib/inflections/version.rb +2 -2
- data/test/nb_test.rb +39 -0
- metadata +6 -2
data/CHANGELOG.markdown
CHANGED
@@ -1,5 +1,9 @@
|
|
1
|
-
3.2.
|
1
|
+
3.2.9 (current version)
|
2
2
|
=======================
|
3
|
+
* Support for Norwegian Bokmål (thanks to [Henrik Hodne](https://github.com/henrikhodne))
|
4
|
+
|
5
|
+
3.2.8
|
6
|
+
=====
|
3
7
|
* Support for British English (thanks to [creativetags](https://github.com/creativetags))
|
4
8
|
* Now versioning alongside ActiveSupport
|
5
9
|
|
data/README.markdown
CHANGED
data/Rakefile
CHANGED
@@ -0,0 +1,14 @@
|
|
1
|
+
module Inflections
|
2
|
+
ActiveSupport::Inflector.inflections do |inflect|
|
3
|
+
inflect.clear
|
4
|
+
|
5
|
+
inflect.plural(/$/, 'er')
|
6
|
+
inflect.plural(/r$/i, 're')
|
7
|
+
inflect.plural(/e$/i, 'er')
|
8
|
+
|
9
|
+
inflect.singular(/er$/i, '')
|
10
|
+
inflect.singular(/re$/i, 'r')
|
11
|
+
|
12
|
+
inflect.irregular('konto', 'konti')
|
13
|
+
end
|
14
|
+
end
|
data/lib/inflections/version.rb
CHANGED
data/test/nb_test.rb
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'test_helper'
|
4
|
+
require 'inflections/nb'
|
5
|
+
|
6
|
+
class TestNorwegianBokmalInflections < MiniTest::Unit::TestCase
|
7
|
+
def test_svake_substantiv_er
|
8
|
+
assert_equal 'hunder', 'hund'.pluralize
|
9
|
+
assert_equal 'hund', 'hunder'.singularize
|
10
|
+
|
11
|
+
assert_equal 'dager', 'dag'.pluralize
|
12
|
+
assert_equal 'dag', 'dager'.singularize
|
13
|
+
|
14
|
+
assert_equal 'tester', 'test'.pluralize
|
15
|
+
assert_equal 'test', 'tester'.singularize
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_svake_substantiv_r
|
19
|
+
assert_equal 'lærere', 'lærer'.pluralize
|
20
|
+
assert_equal 'lærer', 'lærere'.singularize
|
21
|
+
|
22
|
+
assert_equal 'kalendere', 'kalender'.pluralize
|
23
|
+
assert_equal 'kalender', 'kalendere'.singularize
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_svake_substantiv_e
|
27
|
+
assert_equal 'bakker', 'bakke'.pluralize
|
28
|
+
# TODO: Fix this. How do we keep this form apart from "hunder"?
|
29
|
+
# assert_equal 'bakke', 'bakker'.singularize
|
30
|
+
|
31
|
+
assert_equal 'epler', 'eple'.pluralize
|
32
|
+
# assert_equal 'eple', 'epler'.singularize
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_sterke_verb
|
36
|
+
assert_equal 'konti', 'konto'.pluralize
|
37
|
+
assert_equal 'konto', 'konti'.singularize
|
38
|
+
end
|
39
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inflections
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.
|
4
|
+
version: 3.2.9.20121201
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-12-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -79,11 +79,13 @@ files:
|
|
79
79
|
- lib/inflections/en-GB.rb
|
80
80
|
- lib/inflections/en.rb
|
81
81
|
- lib/inflections/es.rb
|
82
|
+
- lib/inflections/nb.rb
|
82
83
|
- lib/inflections/railtie.rb
|
83
84
|
- lib/inflections/version.rb
|
84
85
|
- test/en-GB_test.rb
|
85
86
|
- test/en_test.rb
|
86
87
|
- test/es_test.rb
|
88
|
+
- test/nb_test.rb
|
87
89
|
- test/test_helper.rb
|
88
90
|
homepage: https://github.com/davidcelis/inflections
|
89
91
|
licenses: []
|
@@ -113,3 +115,5 @@ test_files:
|
|
113
115
|
- test/en-GB_test.rb
|
114
116
|
- test/en_test.rb
|
115
117
|
- test/es_test.rb
|
118
|
+
- test/nb_test.rb
|
119
|
+
has_rdoc:
|