prick-inflector 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/prick-inflector/version.rb +1 -1
- data/lib/prick-inflector.rb +3 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ffc4c6b3f0e1b00a5dc6bdc56bd1ea60ad834956604f1b621206545df1c6dc9a
|
4
|
+
data.tar.gz: 46be81d23f549b91108ebd02fef2686f62d1a9e414d7fa092af6871e72f5dc26
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d5fdbb7adc0d67ccbce0575a894532b26a5ed76a08f28dbc7cb2d34f5aff531c66deda9639e28ffbd0a3ce867ee8453bcdca2b153bb01ef6b656e1067fd53c5
|
7
|
+
data.tar.gz: 9c0ad1f1fd6b4bab004542751c63a33df797ce1752097f9c165e231059ff5dde6e7ce38bc792ed5d356ebc9bdead3f6b399d838d5ffeb943ad14abf8607a3ecf
|
data/lib/prick-inflector.rb
CHANGED
@@ -22,7 +22,9 @@ module Prick::Inflector
|
|
22
22
|
# Note that DryInflector::singularize handles the special PgGraph
|
23
23
|
# pluralization rules by default
|
24
24
|
def self.singularize(word)
|
25
|
-
if word
|
25
|
+
if word == "s" # Dry::Inflector return an empty string
|
26
|
+
"s"
|
27
|
+
elsif word =~ /^(.*s)es$/ && pluralize($1) == word
|
26
28
|
$1
|
27
29
|
else
|
28
30
|
@@inflector.singularize(word)
|