inflections 4.0.0 → 4.0.1
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 +4 -4
- data/.travis.yml +1 -1
- data/README.markdown +6 -14
- data/inflections.gemspec +1 -1
- data/lib/inflections/version.rb +2 -3
- data/test/en-GB_test.rb +1 -1
- data/test/en_test.rb +1 -1
- data/test/es_test.rb +1 -1
- data/test/fr_test.rb +2 -2
- data/test/kk_test.rb +1 -1
- data/test/nb_test.rb +1 -1
- data/test/tr_test.rb +2 -2
- metadata +15 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de0afd7263d22768a902318aae96d0c16602d3d6
|
4
|
+
data.tar.gz: 610ddbc4350533bab6e0acc3c3f2b529411abdc9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ac0437626498016422653003a80d552b027eab3669bfd097a75c3b1fb493f4fd3083751c910fa088591fa2340f3be83e1c69361015c9ba6b6c406868b89dbb5
|
7
|
+
data.tar.gz: 5be371032c050ee7d4d6169d6350522716e79a6eadc1a2314b2a62af292c230ae3d06e269ebfcc4f9bd52e777b1160ac148bd6ca05eaef7cdcb76e02e03cf678
|
data/.travis.yml
CHANGED
data/README.markdown
CHANGED
@@ -22,20 +22,13 @@ $ bundle
|
|
22
22
|
|
23
23
|
## Usage
|
24
24
|
|
25
|
-
|
26
|
-
|
27
|
-
You're done. The default inflections defined in ActiveSupport will be overwritten, and you can continue to define your own special cases in `config/intializers/inflections.rb`. I18n's default locale (set in `config/application.rb`) will determine which inflections are loaded.
|
28
|
-
|
29
|
-
### Otherwise
|
30
|
-
|
31
|
-
Wherever you need 'em:
|
25
|
+
To inflect strings in a different locale:
|
32
26
|
|
33
27
|
```ruby
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
#
|
38
|
-
# require 'inflections/es'
|
28
|
+
'persona'.pluralize(:es)
|
29
|
+
# => "personas"
|
30
|
+
'madame'.pluralze(:fr)
|
31
|
+
# => "mesdames"
|
39
32
|
```
|
40
33
|
|
41
34
|
Define your own additional rules as such:
|
@@ -51,10 +44,9 @@ end
|
|
51
44
|
|
52
45
|
# Rails < 4.0.0
|
53
46
|
|
54
|
-
If you're not using ActiveSupport 4
|
47
|
+
If you're not using ActiveSupport 4, the [multilingual Inflector](http://davidcelis.com/blog/2012/07/31/edge-rails-a-multilingual-inflector/) won't be supported. You should install inflections 3.2.x and you'll have to choose which locale you use by requiring a specific file:
|
55
48
|
|
56
49
|
```ruby
|
57
|
-
# Require the old version and choose your locale
|
58
50
|
gem 'inflections', '~> 3.2', require: 'inflections/en'
|
59
51
|
```
|
60
52
|
|
data/inflections.gemspec
CHANGED
data/lib/inflections/version.rb
CHANGED
data/test/en-GB_test.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
require 'inflections/en-GB'
|
3
3
|
|
4
|
-
class TestEnglishInflections <
|
4
|
+
class TestEnglishInflections < Minitest::Test
|
5
5
|
def test_regular_plurals
|
6
6
|
assert_equal 'dogs', 'dog'.pluralize(:'en-GB')
|
7
7
|
assert_equal 'dog', 'dogs'.singularize(:'en-GB')
|
data/test/en_test.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
require 'inflections/en'
|
3
3
|
|
4
|
-
class TestEnglishInflections <
|
4
|
+
class TestEnglishInflections < Minitest::Test
|
5
5
|
def test_regular_plurals
|
6
6
|
assert_equal 'dogs', 'dog'.pluralize(:en)
|
7
7
|
assert_equal 'dog', 'dogs'.singularize(:en)
|
data/test/es_test.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
require 'test_helper'
|
4
4
|
require 'inflections/es'
|
5
5
|
|
6
|
-
class TestSpanishInflections <
|
6
|
+
class TestSpanishInflections < Minitest::Test
|
7
7
|
def test_plurales_regulares
|
8
8
|
assert_equal 'libros', 'libro'.pluralize(:es)
|
9
9
|
assert_equal 'libro', 'libros'.singularize(:es)
|
data/test/fr_test.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
require 'test_helper'
|
4
4
|
require 'inflections/fr'
|
5
5
|
|
6
|
-
class TestFrenchInflections <
|
6
|
+
class TestFrenchInflections < Minitest::Test
|
7
7
|
def test_regular_plurals
|
8
8
|
assert_equal 'amis', 'ami'.pluralize(:fr)
|
9
9
|
assert_equal 'ami', 'amis'.singularize(:fr)
|
@@ -57,7 +57,7 @@ class TestFrenchInflections < MiniTest::Unit::TestCase
|
|
57
57
|
def test_exceptions_to_ending_in_ail
|
58
58
|
assert_equal 'travaux', 'travail'.pluralize(:fr)
|
59
59
|
assert_equal 'travail', 'travaux'.singularize(:fr)
|
60
|
-
|
60
|
+
|
61
61
|
assert_equal 'baux', 'bail'.pluralize(:fr)
|
62
62
|
assert_equal 'bail', 'baux'.singularize(:fr)
|
63
63
|
|
data/test/kk_test.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
require 'test_helper'
|
4
4
|
require 'inflections/kk'
|
5
5
|
|
6
|
-
class TestKazakhInflections <
|
6
|
+
class TestKazakhInflections < Minitest::Test
|
7
7
|
def test_voiceless
|
8
8
|
assert_equal 'сабақтар', 'сабақ'.pluralize(:kk)
|
9
9
|
assert_equal 'сабақ', 'сабақтар'.singularize(:kk)
|
data/test/nb_test.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
require 'test_helper'
|
4
4
|
require 'inflections/nb'
|
5
5
|
|
6
|
-
class TestNorwegianBokmalInflections <
|
6
|
+
class TestNorwegianBokmalInflections < Minitest::Test
|
7
7
|
def test_svake_substantiv_er
|
8
8
|
assert_equal 'hunder', 'hund'.pluralize(:nb)
|
9
9
|
assert_equal 'hund', 'hunder'.singularize(:nb)
|
data/test/tr_test.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
require 'test_helper'
|
4
4
|
require 'inflections/tr'
|
5
5
|
|
6
|
-
class TestTurkishInflections <
|
6
|
+
class TestTurkishInflections < Minitest::Test
|
7
7
|
def test_regular_plurals
|
8
8
|
assert_equal 'günler', 'gün'.pluralize(:tr)
|
9
9
|
assert_equal 'gün', 'günler'.singularize(:tr)
|
@@ -16,7 +16,7 @@ class TestTurkishInflections < MiniTest::Unit::TestCase
|
|
16
16
|
|
17
17
|
assert_equal 'köpekler', 'köpek'.pluralize(:tr)
|
18
18
|
assert_equal 'köpek', 'köpekler'.singularize(:tr)
|
19
|
-
|
19
|
+
|
20
20
|
assert_equal 'testler', 'test'.pluralize(:tr)
|
21
21
|
assert_equal 'test', 'testler'.singularize(:tr)
|
22
22
|
|
metadata
CHANGED
@@ -1,57 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inflections
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Celis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-05-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: minitest
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: activesupport
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 4.0.0
|
47
|
+
version: 4.0.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 4.0.0
|
54
|
+
version: 4.0.0
|
55
55
|
description: A better set of singularization and pluralization rules for Ruby/Rails
|
56
56
|
applications using ActiveSupport.
|
57
57
|
email:
|
@@ -60,8 +60,8 @@ executables: []
|
|
60
60
|
extensions: []
|
61
61
|
extra_rdoc_files: []
|
62
62
|
files:
|
63
|
-
- .gitignore
|
64
|
-
- .travis.yml
|
63
|
+
- ".gitignore"
|
64
|
+
- ".travis.yml"
|
65
65
|
- CHANGELOG.markdown
|
66
66
|
- Gemfile
|
67
67
|
- LICENSE
|
@@ -94,17 +94,17 @@ require_paths:
|
|
94
94
|
- lib
|
95
95
|
required_ruby_version: !ruby/object:Gem::Requirement
|
96
96
|
requirements:
|
97
|
-
- -
|
97
|
+
- - ">="
|
98
98
|
- !ruby/object:Gem::Version
|
99
99
|
version: '0'
|
100
100
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
101
|
requirements:
|
102
|
-
- -
|
102
|
+
- - ">="
|
103
103
|
- !ruby/object:Gem::Version
|
104
104
|
version: '0'
|
105
105
|
requirements: []
|
106
106
|
rubyforge_project:
|
107
|
-
rubygems_version: 2.
|
107
|
+
rubygems_version: 2.4.5
|
108
108
|
signing_key:
|
109
109
|
specification_version: 4
|
110
110
|
summary: Sane inflection rules for ActiveSupport.
|