Permalink
Browse files

r3214@asus: jeremy | 2005-11-20 02:03:05 -0800

 Parenthesize args in Inflections


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3126 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 27f96c7 commit 1a44b9cf1ab1b5d3745de5fa6d73c27ec246080c @jeremy jeremy committed Nov 21, 2005
Showing with 48 additions and 48 deletions.
  1. +48 −48 activesupport/lib/active_support/inflections.rb
@@ -1,53 +1,53 @@
Inflector.inflections do |inflect|
- inflect.plural /$/, 's'
- inflect.plural /s$/i, 's'
- inflect.plural /(ax|test)is$/i, '\1es'
- inflect.plural /(octop|vir)us$/i, '\1i'
- inflect.plural /(alias|status)$/i, '\1es'
- inflect.plural /(bu)s$/i, '\1ses'
- inflect.plural /(buffal|tomat)o$/i, '\1oes'
- inflect.plural /([ti])um$/i, '\1a'
- inflect.plural /sis$/i, 'ses'
- inflect.plural /(?:([^f])fe|([lr])f)$/i, '\1\2ves'
- inflect.plural /(hive)$/i, '\1s'
- inflect.plural /([^aeiouy]|qu)y$/i, '\1ies'
- inflect.plural /([^aeiouy]|qu)ies$/i, '\1y'
- inflect.plural /(x|ch|ss|sh)$/i, '\1es'
- inflect.plural /(matr|vert|ind)ix|ex$/i, '\1ices'
- inflect.plural /([m|l])ouse$/i, '\1ice'
- inflect.plural /^(ox)$/i, '\1en'
- inflect.plural /(quiz)$/i, '\1zes'
+ inflect.plural(/$/, 's')
+ inflect.plural(/s$/i, 's')
+ inflect.plural(/(ax|test)is$/i, '\1es')
+ inflect.plural(/(octop|vir)us$/i, '\1i')
+ inflect.plural(/(alias|status)$/i, '\1es')
+ inflect.plural(/(bu)s$/i, '\1ses')
+ inflect.plural(/(buffal|tomat)o$/i, '\1oes')
+ inflect.plural(/([ti])um$/i, '\1a')
+ inflect.plural(/sis$/i, 'ses')
+ inflect.plural(/(?:([^f])fe|([lr])f)$/i, '\1\2ves')
+ inflect.plural(/(hive)$/i, '\1s')
+ inflect.plural(/([^aeiouy]|qu)y$/i, '\1ies')
+ inflect.plural(/([^aeiouy]|qu)ies$/i, '\1y')
+ inflect.plural(/(x|ch|ss|sh)$/i, '\1es')
+ inflect.plural(/(matr|vert|ind)ix|ex$/i, '\1ices')
+ inflect.plural(/([m|l])ouse$/i, '\1ice')
+ inflect.plural(/^(ox)$/i, '\1en')
+ inflect.plural(/(quiz)$/i, '\1zes')
- inflect.singular /s$/i, ''
- inflect.singular /(n)ews$/i, '\1ews'
- inflect.singular /([ti])a$/i, '\1um'
- inflect.singular /((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i, '\1\2sis'
- inflect.singular /(^analy)ses$/i, '\1sis'
- inflect.singular /([^f])ves$/i, '\1fe'
- inflect.singular /(hive)s$/i, '\1'
- inflect.singular /(tive)s$/i, '\1'
- inflect.singular /([lr])ves$/i, '\1f'
- inflect.singular /([^aeiouy]|qu)ies$/i, '\1y'
- inflect.singular /(s)eries$/i, '\1eries'
- inflect.singular /(m)ovies$/i, '\1ovie'
- inflect.singular /(x|ch|ss|sh)es$/i, '\1'
- inflect.singular /([m|l])ice$/i, '\1ouse'
- inflect.singular /(bus)es$/i, '\1'
- inflect.singular /(o)es$/i, '\1'
- inflect.singular /(shoe)s$/i, '\1'
- inflect.singular /(cris|ax|test)es$/i, '\1is'
- inflect.singular /([octop|vir])i$/i, '\1us'
- inflect.singular /(alias|status)es$/i, '\1'
- inflect.singular /^(ox)en/i, '\1'
- inflect.singular /(vert|ind)ices$/i, '\1ex'
- inflect.singular /(matr)ices$/i, '\1ix'
- inflect.singular /(quiz)zes$/i, '\1'
+ inflect.singular(/s$/i, '')
+ inflect.singular(/(n)ews$/i, '\1ews')
+ inflect.singular(/([ti])a$/i, '\1um')
+ inflect.singular(/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i, '\1\2sis')
+ inflect.singular(/(^analy)ses$/i, '\1sis')
+ inflect.singular(/([^f])ves$/i, '\1fe')
+ inflect.singular(/(hive)s$/i, '\1')
+ inflect.singular(/(tive)s$/i, '\1')
+ inflect.singular(/([lr])ves$/i, '\1f')
+ inflect.singular(/([^aeiouy]|qu)ies$/i, '\1y')
+ inflect.singular(/(s)eries$/i, '\1eries')
+ inflect.singular(/(m)ovies$/i, '\1ovie')
+ inflect.singular(/(x|ch|ss|sh)es$/i, '\1')
+ inflect.singular(/([m|l])ice$/i, '\1ouse')
+ inflect.singular(/(bus)es$/i, '\1')
+ inflect.singular(/(o)es$/i, '\1')
+ inflect.singular(/(shoe)s$/i, '\1')
+ inflect.singular(/(cris|ax|test)es$/i, '\1is')
+ inflect.singular(/([octop|vir])i$/i, '\1us')
+ inflect.singular(/(alias|status)es$/i, '\1')
+ inflect.singular(/^(ox)en/i, '\1')
+ inflect.singular(/(vert|ind)ices$/i, '\1ex')
+ inflect.singular(/(matr)ices$/i, '\1ix')
+ inflect.singular(/(quiz)zes$/i, '\1')
- inflect.irregular 'person', 'people'
- inflect.irregular 'man', 'men'
- inflect.irregular 'child', 'children'
- inflect.irregular 'sex', 'sexes'
- inflect.irregular 'move', 'moves'
+ inflect.irregular('person', 'people')
+ inflect.irregular('man', 'men')
+ inflect.irregular('child', 'children')
+ inflect.irregular('sex', 'sexes')
+ inflect.irregular('move', 'moves')
- inflect.uncountable %w( equipment information rice money species series fish sheep )
+ inflect.uncountable(%w(equipment information rice money species series fish sheep))
end

0 comments on commit 1a44b9c

Please sign in to comment.